CN110659199B - Class integration test sequence generation method based on transfer dependence - Google Patents
Class integration test sequence generation method based on transfer dependence Download PDFInfo
- Publication number
- CN110659199B CN110659199B CN201810696612.7A CN201810696612A CN110659199B CN 110659199 B CN110659199 B CN 110659199B CN 201810696612 A CN201810696612 A CN 201810696612A CN 110659199 B CN110659199 B CN 110659199B
- Authority
- CN
- China
- Prior art keywords
- class
- test
- classes
- complexity
- transfer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 187
- 238000012546 transfer Methods 0.000 title claims abstract description 69
- 238000000034 method Methods 0.000 title claims abstract description 55
- 230000010354 integration Effects 0.000 title claims abstract description 37
- 230000008878 coupling Effects 0.000 claims abstract description 40
- 238000010168 coupling process Methods 0.000 claims abstract description 40
- 238000005859 coupling reaction Methods 0.000 claims abstract description 40
- 238000004364 calculation method Methods 0.000 claims description 15
- 230000001419 dependent effect Effects 0.000 claims description 12
- 230000005540 biological transmission Effects 0.000 claims description 11
- 230000007246 mechanism Effects 0.000 claims description 10
- 239000011159 matrix material Substances 0.000 claims description 7
- 238000004458 analytical method Methods 0.000 claims description 5
- 238000013101 initial test Methods 0.000 claims description 5
- 230000003068 static effect Effects 0.000 claims description 5
- 230000008901 benefit Effects 0.000 claims description 4
- 238000010276 construction Methods 0.000 claims description 3
- 230000009191 jumping Effects 0.000 claims description 3
- 239000002131 composite material Substances 0.000 claims description 2
- 238000005259 measurement Methods 0.000 claims description 2
- 238000004088 simulation Methods 0.000 claims description 2
- 230000008569 process Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000013522 software testing Methods 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a class integration test sequence generation method based on transfer dependence, which comprises the following steps: 1) constructing an inter-class transfer dependency model; 2) calculating the complexity of control coupling; 3) calculating the complexity of the test pile; 4) and generating a class integration test sequence. The invention solves the problems of higher test cost of the class integrated test sequence generated by the current method and too long time for generating the class integrated test sequence of a large-scale system, not only can generate the class integrated test sequence with lower test cost in a shorter time, but also can provide various selectable test schemes for testers, thereby improving the software test efficiency and finally better controlling the quality of software products.
Description
Technical Field
The present invention belongs to the field of software testing technology, and more particularly, to a method for generating a class integration test sequence based on transfer dependency.
Background
The software testing phase includes five parts in total, namely unit testing, integration testing, system testing, verification and validation, and regression testing. The integration test is a key step in the software test stage, and ensures that each module and each subsystem can accurately and stably run according to an expected target.
Common integration testing methods include bottom-up, top-down, and sandwich methods. The testing methods conform to the characteristics of the process-oriented program and can accurately and efficiently complete the process-oriented program integration testing task. However, for the object-oriented program, because the system lacks an obvious hierarchical structure, the calling relationship between classes is complicated, and a tester cannot directly utilize the method to perform the integrated test. Therefore, for the inter-class dependency characteristics of the object-oriented program, a reasonable class integration test strategy needs to be designed, and the tested sequence of each class in the system is determined.
In the process of performing the integration test, if the currently tested class needs other classes to provide services, and other classes are not integrated yet, a test pile needs to be constructed to simulate a corresponding method or attribute so as to provide the services needed by the class to be tested. Because various types of dependencies exist in the object-oriented program, various types of test piles are inevitably required to be constructed, and additional test cost is increased. How to perform integrated test on a program to output a reliable software product at a low test cost is a critical problem to be solved by researchers and developers. Test pile complexity is a measure of the cost of constructing each test pile. And carrying out integrated test according to different inter-class test sequences, wherein the complexity of the test piles required to be constructed is different. A reasonable class integration test sequence can effectively reduce the complexity of the test pile and avoid generating unnecessary test cost. Therefore, the reasonable generation technology of the class integration test sequence is provided for the integration test of the object-oriented program, and the method has important significance.
Disclosure of Invention
The invention aims to provide a method for generating a class integrated test sequence based on transfer dependence, which solves the problems that the test cost of the class integrated test sequence generated by the existing method is higher and the time required for generating the class integrated test sequence of a large-scale system is too long, thereby greatly improving the efficiency of integrated test and ensuring higher availability.
In order to achieve the above object, the present invention provides a method for generating a class integration test sequence based on a transmission dependency. The method comprises the following steps:
1) constructing an inter-class transfer dependency model: performing static analysis on a source program to obtain member variable information and member method information of various classes and attribute coupling and method coupling among the classes, and obtaining transfer dependency information among the classes on the basis to form a transfer dependency call chain and construct a transfer dependency model among the classes;
2) calculating and controlling the coupling complexity: extracting all access operations involved in the inter-class transfer dependency call chain, and calculating the execution probability of each access operation so as to calculate the execution probability of the transfer dependency call chain; calculating the complexity of control coupling between classes according to the execution probability of each transfer dependence call chain;
3) calculating the complexity of the test pile: according to the inter-class control coupling complexity calculated in the part 2, combining the inter-class attribute coupling and method coupling complexity, calculating the test cost required for constructing the test pile for the inter-class relationship, namely testing pile complexity;
4) generating a class integration test sequence: and constructing a test cost matrix for the system by using the complexity of the test pile, adjusting the class test priority by using a reward and punishment mechanism, and generating a complete class integrated test sequence according to the test priority of each class.
Further, the specific steps of the step 1) are as follows:
step 1) -1: statically analyzing a source program to obtain inter-class coupling information;
step 1) -2: generating an inter-class transfer dependency call chain;
step 1) -3: and constructing an inter-class transfer dependency model and identifying inter-class transfer dependencies.
Further, the specific steps of the step 2) are as follows:
step 2) -1: acquiring an inter-class transfer dependency call chain and extracting all access operations in the inter-class transfer dependency call chain;
step 2) -2: aiming at each access operation, acquiring all calling statements and corresponding path conditions of the access operation;
step 2) -3: calculating the execution probability of each calling statement;
step 2) -4: calculating the occurrence probability of the access operation;
step 2) -5: calculating an execution probability of the transfer dependency call chain;
step 2) -6: the complexity of the control coupling between classes is calculated.
Further, the specific steps of the step 3) are as follows:
step 3) -1: calculating the complexity of attribute coupling and method coupling between classes;
step 3) -2: and calculating the complexity of the test pile.
Further, the specific steps of the step 4) are as follows:
step 4) -1: constructing a test cost matrix and initializing various test priorities;
step 4) -2: calculating the net income of each type of initial test;
step 4) -3: selecting a proper class to be added into the class integration test sequence;
step 4) -4: adjusting the test priority of the rest classes by utilizing a reward and punishment mechanism;
step 4) -5: adjusting the net test yield of the remaining classes;
step 4) -6: checking whether the generation of the class integration test sequence is finished, if so, finishing; otherwise, jumping to the step 4) 3-5 to continue execution.
Drawings
FIG. 1 is a flowchart of a method for generating a class integration test sequence based on delivery dependency according to an embodiment of the present invention.
FIG. 2 is a flow chart of the construction of the inter-class pass-dependency model of FIG. 1.
Fig. 3 is a flow chart of the calculation of the control coupling complexity of fig. 1.
Fig. 4 is a flowchart of calculating the complexity of the test pile in fig. 1.
FIG. 5 is a flow chart of the generation of the class integration test sequence of FIG. 1.
Detailed Description
For a further understanding of the technical aspects of the present invention, reference is made to the following description taken in conjunction with the accompanying drawings.
FIG. 1 is a flowchart of a method for generating a class integration test sequence based on delivery dependency according to an embodiment of the present invention.
A class integration test sequence generation method based on transfer dependence comprises the steps of firstly, performing static analysis on a program, constructing a transfer dependence model between classes, and identifying the transfer dependence relationship between the classes; then, calculating the possibility of occurrence of the transfer dependence among classes according to the executed probability of each calling statement, namely controlling the coupling complexity, and taking the measurement as the cost required by the transfer dependence relationship to construct the test pile; then, designing a new test pile complexity calculation formula, calculating the test cost and the test net gain of each class, selecting a proper class to be added into the class integrated test sequence by comparing the test cost and the test net gain, and adjusting the test priority of the remaining classes by utilizing a reward and punishment mechanism to finally form a complete class integrated test sequence, wherein the method comprises the following steps:
s1, constructing an inter-class transfer dependency model and identifying inter-class transfer dependencies. The inter-class transfer dependency model is constructed by adding a transfer dependency call chain in the system on the basis of an object relationship diagram. The inter-class transfer dependency call chain is an execution path leading from a source class to a target class, the starting node and the ending node of the path are the attributes (methods) of the source class and the target class respectively, the rest nodes in the path are the attributes (methods) belonging to other classes, all nodes in the path only appear once, and a method call or an attribute access exists between two classes where adjacent nodes in the path are located. And extracting inter-class transmission dependence after constructing an inter-class transmission dependence model. There is a transitive dependency between the two classes if and only if the source class mediates the third class to achieve access to the target class.
The specific scheme is as follows: definition 1: passing dependencies, classiDependent on classkWhen, asiAre as followskAs media access classjProperty or call class ofjMethod of (1), classiAnd classjClass of passagekEstablishing a dependency relationship, then, calling the classiPair classjThe implicit dependency of (a) is a transitive dependency;
definition 2: passing dependent call chains, classesiAnd classj(i, j∈V∧i≠j) A call chain of transfer dependencies between is a general classiLead to classjX → y → … → w, wherein x and w belong toiAndjthe remaining nodes y in the path belong to other classesk(k∈V∧k≠i, j) The method (attribute) of (1) there is a method call or attribute access between two classes represented by two adjacent nodes in the path, and (2) all nodes on the directed path appear only once, that is, there is no repeated call and acquisition of the method or attribute;
the inter-class transfer dependency model is added on the basis of the object relation graphAdding a transfer dependency call chain in the system, wherein an inter-class transfer dependency model can be represented as a directed graph ICTRD = (V, L, E), wherein a node set V represents a set of classes in the program P; a set of identifiers L = { D, T, C }, which represents a set of types of dependencies among classes in the program P; set of directed edges E = ED∪ET∪ECRepresenting a set of dependencies between classes in the program P, EDRepresenting direct dependencies between classes, e.g. inheritance, aggregation, association, etcTRepresenting inter-class transitive dependencies, ECIndicating that there are both direct and transitive dependencies between the two classes.
In constructing the inter-class transfer dependency model, classes are used as nodes in the model, and direct dependencies and transfer dependencies between classes are used as edges in the model.
S2 calculates the control coupling complexity, measured as the cost of the transfer dependence to construct the test pile. And adopting a control coupling complexity calculation method based on the execution probability, and giving different control coupling complexity values to the transmission dependence according to the possibility of the transmission dependence. There is a transfer dependency between two classes if and only if there is at least one transfer dependency call chain between the two. A chain of transitive dependency calls contains multiple access operations, each potentially involving multiple call statements. The probability of each calling statement being executed is different, so that the probability of the transfer dependency calling chain being executed is different, and the probability of the transfer dependency actually occurring is different. And calculating the execution probability of the calling statement by judging whether the path condition of the calling statement can be met, thereby calculating the control coupling complexity of the transfer dependence.
The specific scheme is as follows: controlling the coupling complexity for measuring the probability of occurrence of a transfer dependency between classes, a transfer dependency between two classes if and only if there is at least one transfer dependency call chain between the two classes, assuming that the classes areiAndjbetween areNThe strip transfer depends on the call chain, only ifNClass when none of the bar pass dependent calls are trueiAndjthere will not be a transfer dependency relationship between them, and the control coupling complexity calculation formula is as follows:
assume that certain propagation dependencies are involved in call chainsMThe probability of execution of each access operation determines the probability of execution of the propagation dependent call chain, i.e. the probability of execution of the propagation dependent call chain is equal to the product of the probabilities of execution of all the access operations therein, and the calculation formula of the execution probability of the propagation dependent call chain is as follows:
probability of execution of certain access operationpc(x) The calculation steps are as follows:
step 1, aiming at the access operation, acquiring all the calling statements where the access operation is located, and aiming at each calling statement, extracting the path condition of the calling statement;
step 2, calculating the execution probability of each calling statement according to the path condition of the calling statement;
when the path condition of the calling statement is null, the statement can be sequentially executed and cannot be interrupted due to the jump of the branch statement, so that the execution probability is 1; when the path condition of the calling statement is not empty, the path condition of the calling statement is extracted from the branch statement, so that the probability of the path condition being established is different for different branch statements; for the conditional judgment statement if, when the path condition of the calling statement is a plurality of inequalities, firstly judging whether conflicts exist among the inequalities, and if the conflicts exist, the calling statement cannot be executed; if a path condition is a simple path condition that does not contain an AND, OR relationship, e.g.y< 5, in the case of lack of other information for reference, the probability of considering the path condition to be true is 0.5; conversely, if a path condition is a composite path condition that contains an and, or, relationship, it is assumed that the path condition is common, also in the absence of other information for referenceNA partial item, when the relation between partial items is AND, the path condition is satisfiedProbability of 1/2 N (ii) a When the relationship between the components is "OR", the probability that the path condition is satisfied is (1-1/2) N ) (ii) a For judging the selection statement switch, on the basis of basically consistent with the principle, the number of the code blocks associated with case and default needs to be considered at the same time, and the number of the associated code blocks is assumed to beNIn the absence of other information for reference, the probability that the path condition is considered to be true is 1 ≦ based on the determined path conditionN(ii) a For loop statements for and while, since the calling statement is located in the loop body, indicating that the software developer wants the statement to be repeatedly executed, the probability that the path condition is satisfied is considered to be 1 in the absence of other information for reference;
and 3, calculating the execution probability of the access operation, wherein the execution of each calling statement is not influenced mutually, one access operation can be completed by a plurality of calling statements, and the access operation cannot be completed only when all the calling statements are not executed, so that different combination conditions of the calling statements need to be considered after the execution probability of each calling statement is calculated, and the execution probability of the access operation is finally calculated.
It should be noted that, in calculating the control coupling complexity, the satisfying probability of the path condition is used as the execution probability of the call statement, the execution probability of the call statement is used as the standard for measuring the execution probability of the access operation, and the execution probability of the transfer dependent call chain is used as the index for measuring the control coupling complexity between classes.
S3 calculates the test pile complexity. When a source class depends on a target class and is tested before the target class, a test stub needs to be constructed for the source class for simulating the methods and attributes provided in the target class. And measuring the cost of constructing the test pile by combining the complexity of attribute coupling, method coupling and control coupling in a linear weighting mode.
The specific scheme is as follows: class IIIiDependent on classjAnd need to take precedence over classjWhen tested, needs to be classiConstruction of a test pileStub(i, j) For simulation classjThe method and attribute provided in (1), and the computational complexity of the test pileThe formula is as follows:
s4 generates a class integration test sequence. By comparing the test cost and the test net gain of each class, selecting proper classes in sequence and adding the proper classes into the class integrated test sequence; and adjusting the test priority of the rest classes and the test net gain by using a reward and punishment mechanism, and repeating the process until a complete class integrated test sequence is formed.
The specific scheme is as follows:
step 1, calculating the complexity of the test piles among classes according to the test pile complexity calculation formula, constructing a test cost matrix, and initializing the test priorities of the classes;
step 2, calculating various initial test costs and initial test net profits by using the test cost matrix, and setting a setS untest Including all untested classes in the systemuThe test cost is calculated as follows:
the test net gain is calculated as follows:
step 4, adjusting the test priority of the rest classes which are not tested by using a reward and punishment mechanism according to the test net income of the classes, and if the test net income of the classes is positive, improving the test priority of the classes; if the net test yield of the type is negative, reducing the test priority; if the net benefit of the test is zero, the test priority of the test is not required to be adjusted;
step 5, taking the dependence relationship of the untested classes and the integration classes in the current round as feedback information, adjusting the test net income of the rest untested classes, and assuming a setS select All classes containing the current round selected for integrated testsThat is, the class with the maximum test net gain or the test cost being zero, the adjustment formula of the test net gain of the unselected class to be tested is as follows:
step 6, checking whether all classes are added into the class integration test sequence, if so, finishing the generation of the class integration test sequence; otherwise, jumping to the 3 rd to 5 th step to continue execution.
FIG. 2 is a flow chart of constructing an inter-class transfer dependency model, and performing static analysis on a tested program to complete extraction of inter-class transfer dependency. The method comprises the following specific steps: firstly, performing static analysis on a source program to acquire member variable information and member method information of various classes and attribute coupling and method coupling among the classes; then, forming an inter-class transfer dependency call chain; and finally, constructing an inter-class transmission dependency model and acquiring inter-class transmission dependency information.
FIG. 3 is a flow chart of calculating the complexity of controlling coupling, for new inter-class propagation dependencies, calculating the probability that they may occur. The method comprises the following specific steps: firstly, counting all related inter-class transmission dependency call chains of the transmission dependency, and extracting all related access operations; then, aiming at each access operation, acquiring a calling statement of the operation and a path condition of the statement, and calculating the possibility of executing the calling statement so as to calculate the occurrence probability of the access operation; and finally, calculating the execution probability of the transfer dependence calling chain, and further obtaining a control coupling complexity value.
Fig. 4 is a flowchart of calculating the complexity of a test pile, and for each inter-class dependency, the test cost required to construct the test pile is calculated. The method comprises the following specific steps: firstly, calculating the complexity of attribute coupling and method coupling between classes; and then, calculating the complexity of the test pile by combining the control coupling complexity obtained by the previous step and utilizing a linear weighting mode.
Fig. 5 is a flowchart for generating an integrated test sequence, and generates the integrated test sequence with the minimum complexity of the test stub for the system under test by using a reward and punishment mechanism. The method comprises the following specific steps: firstly, constructing a test cost matrix, and initializing various test priorities, wherein the initial values are all 1; then, calculating the test cost and the test net profit of each type, and selecting a proper type for testing; then, adjusting the test priority of the remaining classes by utilizing a reward and punishment mechanism, and recalculating the test net gain of the remaining classes; the above process is repeated until all classes have been tested.
In summary, the invention solves the problems of low execution efficiency and high test cost of the generated class integration test sequence in the existing method, and the invention not only can generate the class integration test sequence with low test cost in a short time, but also can provide various selectable test schemes for testers, thereby improving the software test efficiency and finally better controlling the quality of software products.
Claims (5)
1. A class integration test sequence generation method based on transfer dependence is characterized in that firstly, a program is subjected to static analysis, an inter-class transfer dependence model is constructed, and an inter-class transfer dependence relationship is identified; then, calculating the possibility of occurrence of the transfer dependence among classes according to the executed probability of each calling statement, namely controlling the coupling complexity, and taking the measurement as the cost required by the transfer dependence relationship to construct the test pile; then, designing a new test pile complexity calculation formula, calculating the test cost and the test net gain of each class, selecting a proper class to be added into the class integrated test sequence by comparing the test cost and the test net gain, and adjusting the test priority of the remaining classes by utilizing a reward and punishment mechanism to finally form a complete class integrated test sequence, wherein the method comprises the following steps:
1) building inter-class transfer dependency model
Definition 1: passing dependencies, classiDependent on classkWhen, asiAre as followskAs media access classjProperty or call class ofjMethod of (1), classiAnd classjClass of passagekEstablishing a dependency relationship, then, calling the classiPair classjThe implicit dependency of (a) is a transitive dependency;
definition 2: passing dependent call chains, classesiAnd classj(i, j∈V∧i≠j) A call chain of transfer dependencies between is a general classiLead to classjX → y → … → w, wherein x and w belong toiAndjthe remaining nodes y in the path belong to other classesk(k∈V∧k≠i, j) The method of (1) method call or attribute access exists between two classes represented by two adjacent nodes in the path, and (2) all nodes on the directed path only appear once, namely, repeated call and acquisition of the method or the attribute do not exist;
the inter-class transmission dependency model is characterized in that a transmission dependency call chain in a system is added on the basis of an object relation graph, and is represented as an oriented graph ICTRD = (V, L, E), wherein a node set V represents a set of classes in a program P; a set of identifiers L = { D, T, C }, which represents a set of types of dependencies among classes in the program P; set of directed edges E = ED∪ET∪ECRepresenting a set of dependencies between classes in the program P, EDRepresenting direct dependencies between classes, ETRepresenting inter-class transitive dependencies, ECIndicating that both direct and transitive dependencies exist between the two classes;
2) calculating control coupling complexity
Controlling the coupling complexity for measuring the probability of occurrence of a transfer dependency between classes, a transfer dependency between two classes if and only if there is at least one transfer dependency call chain between the two classes, assuming that the classes areiAndjbetween areNThe strip transfer depends on the call chain, only ifNClass when none of the bar pass dependent calls are trueiAndjhas no transfer dependency relationship between the two, and controls the coupling complexityT (i,j)The calculation formula is as follows:
wherein,kindicating that the delivery depends on the call chain,t ij (k)representing the execution probability of the transfer dependent call chain;
assume that certain propagation dependencies are involved in call chainsMAn access operation, each access operationxProbability of executionpc(x)Determines the probability of the pass-dependent call chain being executed, i.e. the probability of the pass-dependent call chain being executedt ij (k)Equal to the product of the probabilities in which all access operations are performed, passing the probability of execution of a dependent call chaint ij (k)The calculation formula of (a) is as follows:
wherein,TRCrepresenting a chain of transfer relationships;
probability of execution of certain access operationpc(x) The calculation steps are as follows:
step 1, aiming at the access operation, acquiring all the calling statements where the access operation is located, and aiming at each calling statement, extracting the path condition of the calling statement;
step 2, calculating the execution probability of each calling statement according to the path condition of the calling statement;
when the path condition of the calling statement is null, the statement is sequentially executed, and the branch statement cannot be interrupted due to the jump, so that the execution probability is 1; when the path condition of the calling statement is not empty, the path condition of the calling statement is extracted from the branch statement, so that the probability of the path condition being established is different for different branch statements; for the conditional judgment statement if, when the path condition of the calling statement is a plurality of inequalities, firstly judging whether conflicts exist among the inequalities, and if the conflicts exist, the calling statement cannot be executed; if it isA certain path condition is a simple path condition without an AND or relation; conversely, if a path condition is a composite path condition that contains an and, or, relationship, it is assumed that the path condition is common, also in the absence of other information for referenceNWhen the relation between the components is AND, the probability that the path condition is satisfied is 1/2 N (ii) a When the relationship between the components is "OR", the probability that the path condition is satisfied is (1-1/2) N ) (ii) a For judging the selection statement switch, the number of code blocks associated with case and default is also considered, and the number of associated code blocks is assumed to beNIn the absence of other information for reference, the probability that the path condition is considered to be true is 1 ≦ based on the determined path conditionN(ii) a For loop statements for and while, since the calling statement is located in the loop body, indicating that the software developer wants the statement to be repeatedly executed, the probability that the path condition is satisfied is considered to be 1 in the absence of other information for reference;
step 3, calculating the execution probability of the access operation, wherein the execution of each calling statement is not influenced mutually, one access operation is completed by a plurality of calling statements, and the access operation cannot be completed only when all the calling statements are not executed, so that after the execution probability of each calling statement is calculated, different combination conditions of the calling statements need to be considered, and the execution probability of the access operation is finally calculated;
3) calculating test pile complexity
Class IIIiDependent on classjAnd need to take precedence over classjWhen tested, needs to be classiConstruction of a test pileStub(i, j) For simulation classjThe method and attributes provided in (1), test pile complexitySCplx(i, j)The calculation formula of (a) is as follows:
WAweight, W, representing complexity of an attributeMWeight, W, representing complexity of the methodTRepresenting control coupling complexityThe weight of (a) is determined,the standard deviation of the complexity of the attribute is represented,the standard deviation of the complexity of the method is expressed,T(i,j) represents the control coupling complexity;
4) generating class integration test sequences
Step 1, calculating the complexity of the test piles among classes according to the test pile complexity calculation formula, constructing a test cost matrix, and initializing the test priorities of the classes;
step 2, calculating various initial test costs and initial test net profits by using the test cost matrix, and setting a setS untest Including all untested classes in the systemuTest costTC(i)The calculation formula of (a) is as follows:
testing net gainNR(i) The calculation formula of (a) is as follows:
the class with zero test cost in the step 3 is added into the class integration test sequence; if the class with the zero test cost does not exist, adding the class with the maximum test benefit into the class integrated test sequence;
step 4, adjusting the test priority of the rest classes which are not tested by using a reward and punishment mechanism according to the test net income of the classes, and if the test net income of the classes is positive, improving the test priority of the classes; if the net test yield of the type is negative, reducing the test priority; if the net benefit of the test is zero, the test priority of the test is not required to be adjusted;
step 5 to not testThe dependence relationship of the test class and the class integration in the current round is feedback information, the test net income of the rest untested classes is adjusted, and a hypothesis setS select All classes containing the current round selected for integrated testsThat is, the class with the maximum test net gain or the test cost being zero, the adjustment formula of the test net gain of the unselected class to be tested is as follows:
step 6, checking whether all classes are added into the class integration test sequence, if so, finishing the generation of the class integration test sequence; otherwise, jumping to the 3 rd to 5 th step to continue execution.
2. The method for generating the class integration test sequence based on the transfer dependency as claimed in claim 1, wherein in the step 1) of constructing the inter-class transfer dependency model, classes are used as nodes in the model, and direct dependency and transfer dependency between the classes are used as edges in the model.
3. The method for generating a class integration test sequence based on propagation dependence as claimed in claim 1, wherein in the step 2) calculating the control coupling complexity, the satisfiable probability of the path condition is used as the execution probability of the call statement, the execution probability of the call statement is used as a criterion for measuring the execution probability of the access operation, and the execution probability of the propagation dependence call chain is used as an index for measuring the control coupling complexity between classes.
4. The method for generating the class integration test sequence based on the transfer dependency as claimed in claim 1, wherein in the step 3) of calculating the complexity of the test pile, the complexity of the test pile is calculated by linear weighting.
5. The method as claimed in claim 1, wherein in the step 4) of generating the integrated test sequence, the class test priority is adjusted by using a reward and punishment mechanism.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810696612.7A CN110659199B (en) | 2018-06-29 | 2018-06-29 | Class integration test sequence generation method based on transfer dependence |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810696612.7A CN110659199B (en) | 2018-06-29 | 2018-06-29 | Class integration test sequence generation method based on transfer dependence |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110659199A CN110659199A (en) | 2020-01-07 |
CN110659199B true CN110659199B (en) | 2021-07-30 |
Family
ID=69026723
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810696612.7A Active CN110659199B (en) | 2018-06-29 | 2018-06-29 | Class integration test sequence generation method based on transfer dependence |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110659199B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113377651A (en) * | 2021-06-10 | 2021-09-10 | 中国矿业大学 | Class integration test sequence generation method based on reinforcement learning |
CN113868113B (en) * | 2021-06-22 | 2024-09-06 | 中国矿业大学 | Class integrated test sequence generation method based on Actor-Critic algorithm |
CN113656227B (en) * | 2021-08-13 | 2024-07-19 | 昆仑芯(北京)科技有限公司 | Chip verification method and device, electronic equipment and storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105528296A (en) * | 2016-01-13 | 2016-04-27 | 东北大学 | Project-software-oriented class cluster test method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8601446B2 (en) * | 2008-10-22 | 2013-12-03 | Wipro Limited | Complexity dependency change impact system and method |
-
2018
- 2018-06-29 CN CN201810696612.7A patent/CN110659199B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105528296A (en) * | 2016-01-13 | 2016-04-27 | 东北大学 | Project-software-oriented class cluster test method |
Non-Patent Citations (3)
Title |
---|
《基于依赖性分析的面向对象程序测试技术研究》;张艳梅;《中国博士学位论文全文数据库 信息科技辑》;20121015;第2012年卷(第10期);1-165 * |
《基于复杂网络的类间集成测试序列生成方法》;赵玉丽,王莹,于海,朱志良;《东北大学学报(自然科学版)》;20151231;第36卷(第12期);1696-1700 * |
《多目标优化类集成测试序列确定问题研究进展》;张妙,姜淑娟,张艳梅;《小型微型计算机系统》;20170831;1772-1777 * |
Also Published As
Publication number | Publication date |
---|---|
CN110659199A (en) | 2020-01-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Agha et al. | A survey of statistical model checking | |
CN103257921B (en) | Improved random forest algorithm based system and method for software fault prediction | |
Lou et al. | A survey on regression test-case prioritization | |
CN108595341B (en) | Automatic example generation method and system | |
Calder et al. | Analysis of signalling pathways using continuous time Markov chains | |
Lanubile et al. | Evaluating predictive quality models derived from software measures: lessons learned | |
CN110659199B (en) | Class integration test sequence generation method based on transfer dependence | |
Ballarini et al. | COSMOS: a statistical model checker for the hybrid automata stochastic logic | |
Sun et al. | Metamorphic testing for web services: Framework and a case study | |
Pan et al. | Measuring structural quality of object-oriented softwares via bug propagation analysis on weighted software networks | |
EP4075281A1 (en) | Ann-based program test method and test system, and application | |
CN106022517A (en) | Risk prediction method and device based on nucleus limit learning machine | |
Lee et al. | Software measurement and software metrics in software quality | |
Thimm | Stream-based inconsistency measurement | |
Lu et al. | Nonconformity resolving recommendations for product line configuration | |
CN110297765A (en) | Software reliability earlier evaluations method | |
Jiang et al. | An integration test order strategy to consider control coupling | |
US8875074B1 (en) | Formal fault detection | |
Healy | Predicting SMT solver performance for software verification | |
CN104111887A (en) | Software fault prediction system and method based on Logistic model | |
CN106095669B (en) | Parallel program testing method based on scheduling sequence reduction | |
Arvanitou et al. | Assessing change proneness at the architecture level: An empirical validation | |
CN101894070A (en) | Method and system for quantitatively estimating code size of new requirements based on weight adjustment | |
Fontes et al. | Automated support for unit test generation | |
CN114297063B (en) | Method and system for automated formal modeling and verification of source code |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |