A regression test case set selection method based on requirement association

By constructing a regression test case set selection model based on demand relevance and multidimensional features, the problem of one-sidedness in selecting regression test case sets in existing technologies is solved, achieving more efficient and accurate regression testing and reducing costs.

CN115481018BActive Publication Date: 2026-06-26NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
Filing Date
2022-08-23
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies for regression testing have limitations when selecting test case sets based solely on requirements or test case priorities. They are insufficient to select the most suitable regression test case set from multiple dimensions such as software defects and requirements.

Method used

Based on multi-dimensional characteristics such as software requirement relevance, test case priority, and software defects, a selection model for regression test case sets is constructed. By establishing a correlation matrix and priority ranking, the optimal regression test case set is selected.

Benefits of technology

It improves the scientific rigor and efficiency of regression test case set selection, saves testing costs, and enhances software testing quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115481018B_ABST
    Figure CN115481018B_ABST
Patent Text Reader

Abstract

The application discloses a regression test case set selection method based on requirement association, comprising: association relationship basic library construction: requirement association matrix is constructed for a plurality of test requirements, and test item-requirement association matrix is constructed, mapping relationship of test case to test item is constructed, priority order of test case is set, and test defect-test case association matrix is constructed; regression test case selection model construction: test defect is associated with test case, test case is associated with test item, test item is associated with test requirement, and test requirements with different relationship strengths are selected for association; regression test case set selection: based on the regression test case selection model, test requirement, test case priority and defect library are combined to obtain the best regression test case set. The application is based on multiple factors for selection of the regression test case set, so that the effectiveness of the selection is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of regression testing technology, and in particular to a method for selecting regression test case sets based on requirement association. Background Technology

[0002] In the field of regression testing, there are many strategies for selecting test case sets, such as:

[0003] Invention patent CN101908017B discloses a regression test case selection method based on partial multiple coverage. First, a test requirement coverage matrix is ​​constructed based on software system characteristics and historical data from the test case library. Then, for modified components, the test requirement set is divided into a focus set and an irrelevant set. The HATS algorithm is used to select the regression test set. For maintaining the test case library, a multiple coverage strategy is adopted based on risk or operational profiles to define test requirements. Based on the given multiple coverage strategy, the MHATS algorithm is used to select the test case set. This invention retains redundant test cases through a multiple coverage strategy, thereby maintaining the defect detection capability of the test case library while streamlining it. Furthermore, by selecting the regression test set based on partial coverage, it avoids covering irrelevant test requirements, further reducing the number of test cases while lowering the cost of test execution and analysis.

[0004] Chinese patent application CN104536896A discloses a method and system for selecting and sorting regression test cases based on function call paths. The method includes: finding the associated functions of the modified function, obtaining the function call paths of the modified function and the associated functions, and selecting test cases that are associated with the modified function and the associated functions according to the function call paths to form a regression test case set; prioritizing and sorting the test cases in the regression test case set, and dynamically adjusting the sorting results; and selecting test cases from the dynamically adjusted regression test case set to determine the final regression test case set.

[0005] Invention patent application CN110941545A discloses a method, apparatus, and computing device for processing defect-based regression test cases. The processing method includes: establishing a mapping relationship between at least one test case and at least one defect, wherein the test case is the test case used in the previous round of testing, and the defect is the defect discovered by the software when the test case was used in the previous round of testing; determining the capability value of each influencing factor corresponding to each test case when detecting defects according to the mapping relationship; determining the priority value of each test case using the preset weight value of each influencing factor of each test case and the capability value of each test case; and prioritizing all test cases according to their priority values.

[0006] However, selecting a test case set solely based on requirements or test case priority is somewhat one-sided. Therefore, how to select the most suitable regression test case set from multiple dimensions such as software defects and requirements is a challenging problem to be solved. Summary of the Invention

[0007] To address the aforementioned issues, this invention proposes a regression test case set selection method based on requirement correlation. This method constructs a regression test case set selection model based on multi-dimensional characteristics such as software requirement correlation, test case priority, and software defects. This makes the selection of regression test case sets more scientific and efficient, saving significant testing costs and improving software testing quality.

[0008] The technical solution adopted in this invention is as follows:

[0009] A regression test case set selection method based on requirement correlation includes:

[0010] Building a foundational library of relationships: For several test requirements, establish relationships between test requirements and construct a requirement relationship matrix, setting relationship strength values; decompose test requirements into several test items and construct a test item-requirement relationship matrix; further decompose test items into several test cases, construct a mapping relationship from test cases to test items, and set priority order for test cases; finally, construct a relationship matrix from test defects to test cases.

[0011] Regression test case selection model construction: test cases are associated with test defects, test items are associated with test cases, and test requirements are associated with test items. Test requirements with different relationship strengths are selected for association.

[0012] Regression test case set selection: Based on the regression test case selection model, the optimal regression test case set is obtained by combining test requirements, test case priorities and defect library.

[0013] Furthermore, if there are m test requirements, their requirement set... The demand correlation matrix is ​​then:

[0014]

[0015] in: For demand and demand The degree of correlation between relative demand and supply.

[0016] Furthermore, the m test requirements are decomposed into n test items, and the set of test items is: The test item-requirement association matrix is ​​then:

[0017]

[0018] in: Indicates test item Demand Coverage status.

[0019] Furthermore, a test item There are s optional test cases, and the set of optional test cases is denoted as . Priority is denoted as ,in Represents test cases In the test item Priority in the test case; each test case has a one-to-one correspondence with a test item, meaning that testing the device under test will result in a test case set C = {n test items}. }

[0020] Furthermore, if the set of k test defects is Then test defects and test items The association matrix of the s test cases is as follows:

[0021]

[0022] in: Indicates in the test item test cases For testing defects The testing results;

[0023] For the entire device under test, the set of association matrices between n test defects and test cases is denoted as M. .

[0024] Furthermore, the test case association based on test defects includes: combining the test execution results, for the k discovered test defects, obtaining the relevant test cases that detected the test defects based on the association matrix set M, and the set of test cases for detection results is:

[0025]

[0026] in: The set of retrieved test cases, and , This is the function that associates test cases with test defects. This is a set of association matrices between test defects and test cases. This is a set of test defects.

[0027] Furthermore, the step of associating test items based on test cases includes: obtaining a set of related test items by combining the test case set C of the test items.

[0028]

[0029] in: The set of retrieved test items, and , Let T be the association function between test items and test cases, where T is the set of all test items of the device under test. This is the collection of retrieved test cases.

[0030] Furthermore, the requirement based on test item association includes: filtering and aggregation. For related requirements, traverse the test item-requirement association matrix according to the degree of requirement association. Obtain the set of related requirements:

[0031]

[0032] in: For the retrieved set of requirements, and , This is a function that associates test requirements with test items. For the requirement-test item association matrix, This is the set of retrieved test items.

[0033] Furthermore, in the actual regression testing phase, requirements with different relationship strengths are selected for association:

[0034]

[0035] in: For a set of requirements specifying the strength of the association, To test the relationship between the requirements, This is a demand correlation matrix. For the retrieved set of requirements, The degree of correlation between demands.

[0036] Furthermore, the selection of the regression test case set includes the following sub-steps:

[0037] During the testing phase, test cases of different priorities are selected based on the defect database:

[0038]

[0039] in: For the regression test itemset, and , Selecting functions for reverse tracing For a set of requirements specifying the strength of the association, Test item-requirement association matrix;

[0040] If regression test itemset If there are j test items, then the regression test case set is:

[0041]

[0042] in: For regression test case set, For depth selection function, For the i-th regression test item, Let i be the set of test cases corresponding to test item i. Sort the test cases corresponding to test item i by priority. Regression depth refers to the degree to which use case priorities are obtained.

[0043] The beneficial effects of this invention are as follows:

[0044] This invention selects regression test case sets based on multiple factors, resulting in higher effectiveness. Secondly, it combines software defects with the selection of regression test case sets, making the selection more targeted and accurate. Furthermore, it obtains the relationships between requirements through correlation analysis and selects test cases based on the strength of these relationships, providing a certain guarantee for the impact domain of changes. In summary, this invention not only saves manpower and reduces workload in selecting regression test case sets, but also improves the efficiency and accuracy of regression testing. Attached Figure Description

[0045] Figure 1 This is a flowchart of the regression test case set selection method according to an embodiment of the present invention. Detailed Implementation

[0046] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments are now described. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention; that is, the described embodiments are only a part of the embodiments of the invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0047] like Figure 1 As shown, this embodiment provides a regression test case set selection method based on requirement association, which includes three steps: constructing a basic library of association relationships, constructing a regression test case selection model, and selecting a regression test case set. It can obtain the optimal regression test case set based on multi-dimensional features such as software requirement association, test case priority, and software defects.

[0048] (1) Construction of the basic database of relationships

[0049] For several test requirements, establish the relationships between test requirements and construct a requirement association matrix, setting the strength of the relationships; decompose the test requirements into several test items and construct a test item-requirement association matrix; then decompose the test items into several test cases, construct the mapping relationship from test cases to test items, set the priority order for test cases, and finally construct the association matrix from test defects to test cases.

[0050] Preferably, if there are m test requirements, their requirement set is... The demand correlation matrix is ​​then:

[0051]

[0052] in: for The degree of relative demand correlation. Specifically, the degree of relative demand correlation can be set from strong to weak as 5, 4, 3, 2, 1, 0.

[0053] The m test requirements are then broken down into n test items, resulting in a set of test items. Then the test item-requirement association matrix :

[0054]

[0055] in: Indicates test item Demand The coverage status can be set to 1 or 0, which represent coverage and no coverage, respectively.

[0056] In this embodiment, each test case and test item have a one-to-one correspondence. Let's denote a test item. There are s optional test cases, and the set of optional test cases is denoted as . Testing the device under test will result in a test case set C = { with n test items} }

[0057] Sorting test cases within a test item narrows the sorting scope and ensures the relevance of the test cases. The priority is denoted as follows: ,in Represents test cases In the test item The priority of test cases is determined by their relative importance. Specifically, the priority of test cases can be set to 1, 2, or 3.

[0058] Let the set of k test defects be ? Then test defects and test items The association matrix of s test cases :

[0059]

[0060] in: Indicates in the test item test cases For testing defects The testing results.

[0061] In summary, for the entire device under test, the set of association matrices between n test defects and test cases is denoted as M. .

[0062] (2) Construction of regression test case selection model

[0063] Test defects are associated with test cases, test cases are associated with test items, and test items are associated with test requirements. Test requirements with different levels of relationship strength are then selected for association.

[0064] Preferably, the test case association based on test defects includes: combining the test execution results, for the k discovered test defects, obtaining the relevant test cases that detected the test defects based on the association matrix set M, and the set of test cases for the detection results is:

[0065]

[0066] in: The set of retrieved test cases, and , This is the function that associates test cases with test defects. This is a set of association matrices between test defects and test cases. This is a set of test defects.

[0067] Preferably, associating test items based on test cases includes: obtaining a set of related test items by combining the test case set C of the test items.

[0068]

[0069] in: The set of retrieved test items, and , Let T be the association function between test items and test cases, where T is the set of all test items of the device under test. This is the collection of retrieved test cases.

[0070] Preferably, the requirements based on test item association include: filtering and aggregation. For related requirements, traverse the test item-requirement association matrix according to the degree of requirement association. Obtain the set of related requirements:

[0071]

[0072] in: For the retrieved set of requirements, and , This is a function that associates test requirements with test items. For the requirement-test item association matrix, This is the set of retrieved test items.

[0073] Preferably, during the actual regression testing phase, requirements with different relationship strengths are selected for association:

[0074]

[0075] in: For a set of requirements specifying the strength of the association, To test the relationship between the requirements, This is a demand correlation matrix. For the retrieved set of requirements, The degree of correlation between demands.

[0076] (3) Selection of regression test case set

[0077] Based on the regression test case selection model, the optimal set of regression test cases is obtained by combining test requirements, test case priorities, and a defect library. Preferably, this includes the following sub-steps:

[0078] During the testing phase, test cases of different priorities are selected based on the defect database:

[0079]

[0080] in: For the regression test itemset, and , Selecting functions for reverse tracing For a set of requirements specifying the strength of the association, Test item-requirement association matrix;

[0081] If regression test itemset If there are j test items, then the regression test case set is:

[0082]

[0083] in: For regression test case set, For depth selection function, For the i-th regression test item, Let i be the set of test cases corresponding to test item i. Sort the test cases corresponding to test item i by priority. Regression depth refers to the degree to which use case priorities are acquired (0 indicates acquisition of all levels). Specifically, the regression depth can be selected according to requirements.

[0084] It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

Claims

1. A method for selecting regression test case sets based on requirement association, characterized in that, include: Building a foundational library of relationships: For several test requirements, establish relationships between test requirements, construct a requirement relationship matrix, and set relationship strength values ​​in the requirement relationship matrix; decompose test requirements into several test items and construct a test item-requirement relationship matrix; further decompose test items into several test cases, construct a mapping relationship from test cases to test items, and set priority order for test cases; Reconstruct the correlation matrix between test defects and test cases; Regression test case selection model construction: test cases are associated with test defects, test items are associated with test cases, and test requirements are associated with test items, so as to select test requirements with different relationship strengths for association; Regression test case set selection: Based on the regression test case selection model, the optimal regression test case set is obtained by combining test requirements, test case priorities and defect library; The test case association based on test defects includes: combining the test execution results, for the k discovered test defects, obtaining the relevant test cases that detected the test defects based on the association matrix set M, and the set of test cases for detection results is: in: The set of retrieved test cases. This is the function that associates test cases with test defects. This is a set of association matrices between test defects and test cases. A collection of test defects; The test item association based on test cases includes: a set of retrieved test cases. Retrieve the relevant test item set: in: The set of retrieved test items. Let T be the association function between test items and test cases, where T is the set of all test items of the test object; The test requirements based on test item association include: filtering and aggregation. For related requirements, traverse the test item-requirement association matrix according to the degree of requirement association. Obtain the set of related requirements: in: For the retrieved set of related requirements, This is a function that associates test requirements with test items. Test item-requirement association matrix; In the actual regression testing phase, test requirements with different relationship strengths are selected for association: in: For a set of requirements specifying the strength of the association, To test the relationship between the requirements, This is a demand correlation matrix. For the retrieved set of related requirements, The degree of correlation between demands; The selection of the regression test case set includes the following sub-steps: During the testing phase, test cases of different priorities are selected based on the defect database: in: For the set of regression test items, Select a function for reverse tracing; If the regression test item set If there are j test items, then the regression test case set is: in: For the set of regression test cases, For depth selection function, For the i-th regression test item, Let i be the set of test cases corresponding to test item i. The priority ranking result of the test cases corresponding to test item i. Regression depth refers to the degree to which test case priorities are obtained.

2. The regression test case set selection method based on requirement association as described in claim 1, characterized in that, If there are m test requirements, their set is as follows: The demand correlation matrix is ​​then: in: For demand and demand The degree of correlation between relative demand and supply.

3. The regression test case set selection method based on requirement association as described in claim 2, characterized in that, Decompose m test requirements into n test items, and the set of test items is: The test item-requirement association matrix is ​​then: in: Indicates test item Demand Coverage status.

4. The regression test case set selection method based on requirement association as described in claim 3, characterized in that, A test item There are s optional test cases, and the set of optional test cases is denoted as . Priority is denoted as ,in Represents test cases In the test item Priority in the test case; each test case has a one-to-one correspondence with a test item, meaning that testing the device under test will result in a test case set C = {n test items}. } 5. The method for selecting regression test case sets based on requirement association according to claim 4, characterized in that, If the set of k test defects is Then test defects and test items The association matrix of the s test cases is as follows: in: Indicates in the test item test cases For testing defects The testing results; For the entire device under test, the set of association matrices between n test defects and test cases is denoted as M. .