CN106991051B - Test case reduction method based on variation test and association rule - Google Patents

Test case reduction method based on variation test and association rule Download PDF

Info

Publication number
CN106991051B
CN106991051B CN201710216887.1A CN201710216887A CN106991051B CN 106991051 B CN106991051 B CN 106991051B CN 201710216887 A CN201710216887 A CN 201710216887A CN 106991051 B CN106991051 B CN 106991051B
Authority
CN
China
Prior art keywords
test
mlist
transaction
test case
list
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
Application number
CN201710216887.1A
Other languages
Chinese (zh)
Other versions
CN106991051A (en
Inventor
王曙燕
孙家泽
陈朋媛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian University of Posts and Telecommunications
Original Assignee
Xian University of Posts and Telecommunications
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Xian University of Posts and Telecommunications filed Critical Xian University of Posts and Telecommunications
Priority to CN201710216887.1A priority Critical patent/CN106991051B/en
Publication of CN106991051A publication Critical patent/CN106991051A/en
Application granted granted Critical
Publication of CN106991051B publication Critical patent/CN106991051B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Computational Linguistics (AREA)
  • Genetics & Genomics (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Physiology (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A test case reduction method based on variation test and association rule measures the sufficiency of test case set by using variation score and reduces test case by using association rule. Reducing a large number of original test case sets, and creating a variant transaction set matrix by utilizing variants designed according to source program characteristics and taking whether the test cases can find specified variants as the basis; reducing the variant transaction set matrix; analyzing the reduced transaction set matrix and acquiring a frequent item set of the test cases; generating all association rules by using the frequent item set; and reducing the test cases according to the incidence relation of the test cases. The invention can measure the characteristic of the sufficiency of the test case set by applying the variation test, obtains the incidence relation among the test cases, and effectively reduces the test cases on the premise of not changing or minimally changing the variation score.

Description

Test case reduction method based on variation test and association rule
Technical Field
The invention belongs to the field of software testing, in particular to the field of variation testing, and also relates to a data mining technology. On the basis of the mutation test, the incidence relation among the test cases is analyzed and the test cases are reduced by applying the incidence rule, so that the test case reduction method is provided.
Background
With the continuous development of the computer field, the software scale is continuously enlarged, the software design tends to be complicated, and the requirement of software industry on specialized and high-efficiency software testing is higher and higher. In the software development process, software testing is required to be frequently carried out, the scale of the test cases is larger and larger, due to the limitation of test resources, the scale of the original test case set is reduced, the software testing efficiency is greatly improved, given testing requirements are met by using as few test cases as possible, the testing efficiency can be greatly improved, and the testing cost is reduced.
Test case reduction aims to meet a given test requirement to the maximum extent with a minimum set of test cases. In order to solve the test case set reduction problem, researchers provide a plurality of reduction methods, which mainly comprise greedy algorithm, heuristic algorithm, integer programming and the like. And in the process of test case reduction iteration, selecting the test case meeting the most test requirements each time, deleting the test requirements which are met in the test requirements each time iteration is performed, and performing loop iteration until all the test requirements are met, thus finishing the algorithm. Heuristic algorithms, also known as H-algorithms, typically select one (or more) locally optimal (e.g., covering the largest number of test requirements) test case sets at a time, eliminate test requirements that have already been covered, and loop until all requirements are covered. In the process of test case reduction, the two algorithms always search for the optimal test case in the current test requirements, and the selected test case is locally optimal in a certain sense, so that the global optimization of the test cases cannot be ensured. The integer programming method converts the selection problem of the optimal representative set of the test cases into the integer linear programming problem, is suitable for various constraint conditions, adaptive value functions and test sufficiency criteria, is a supplement of a greedy algorithm and a heuristic algorithm, but has higher time complexity and exponentially increased operation overhead.
The algorithms are simplification strategies for the test case sets, the effects of the algorithms depend on the initialized test case sets, optimization of the test cases according to test targets cannot be fundamentally guaranteed, and the test case sets are determined according to test requirements. Therefore, the invention provides a test case reduction method based on mutation test and association rules, wherein the mutation test is a software test technology based on defects, can simulate the actual defects or potential defects in software by using the mutation defects, and can effectively evaluate the sufficiency of a test case set. The test cases are divided according to whether the test cases can kill (or find) the designated variants. A variant is a killer variant (or a variant that can be discovered by a test case) if there is a test case that performs differently on the source program and the variant, and a survivable variant (or a variant that cannot be discovered by a test case) otherwise. And obtaining the incidence relation among the test cases by applying an incidence mining algorithm, and further effectively reducing the test cases.
The association mining algorithm is used for mining valuable association rules in a large amount of or massive data sets, wherein the classical algorithm comprises an Apriori algorithm and an FP-Tree algorithm, the Apriori algorithm gradually acquires frequent project sets through the continuous increase of project set elements, a transaction database needs to be scanned for many times, a large I/O load is occupied, and a large candidate set is possibly generated; the FP-Tree algorithm does not generate a candidate set but directly generates a frequent pattern of a frequent set, but the algorithm is still insufficient, when the data volume is large, a large amount of I/O time is consumed, a large amount of memory is occupied, even the memory is crashed, and the processing efficiency is very low. The invention stores the transaction set database in the form of binary matrix, replaces the existing relation of each test case in the transaction item with binary data, can effectively reduce the memory load of the computer, and in addition, the binary data can be directly processed by the computer, so the test case reduction method based on the mutation test and the association rule provided by the invention has higher time efficiency.
Disclosure of Invention
A test case reduction method based on variation test and association rules is characterized in that a variant transaction set matrix is created according to whether a specified variant can be found in a test case, the association rules of the test case are mined, and the test case is reduced according to the association rules. The method is characterized by comprising the following steps:
(1) performing a variation test: defining p original test case sets test ═ { test ═ test1,test2,...,testpM variants ═ mutant } ═ mutant1,mutant2,...,mutantmExecuting the test case set on the source program and the variant respectively; storing the test case information as a list MutantRecord with the criterion of whether the test case can kill the specified variant, wherein the MutantRecord is { Record1,Record2,...,RecordqThen, for any variant mutantkAnd mutantkE, Mutants, existing test cases which can find the variant or can not find the variant, and storing the test cases which can not find the variant into a variant list MListkPerforming the following steps; MList assuming that the variant could not be found in gamma test casesk={testk1,testk2,…,testStore all variant lists as variant transaction set lists ErrorRecord, then ErrorRecord ═ MList1,MList2,...,MListm};
(2) Calculating the frequency of the test cases: let minSup denote the minimum support of association rules,set ErrMap ═ { test ═ test1:num1,test2:num2,...,testp:numpDenotes the test cases traversed from the list ErrorRecord and the frequency of the test cases, assuming a list of variant transactions MListkTest case test exists inTest being∈MListkIf test is trueE e.g. ErrMap, then test in ErrMap will be setThe frequency of (2) increases by 1; otherwise test will beAdding the test case frequency into an ErrMap set, and setting the frequency of the test case to be 1; and finally, storing the test cases with the frequency greater than or equal to the minimum support degree as a test case list ErrList ═ test according to a descending sequencet1,testt2,...,testtwW is the number of test cases with the support degree larger than minSup, and t1, t2, … and tw are different numbers of test cases in a test case set with the support degree larger than the minimum support degree;
(3) creating a variant transaction set matrix: creating and initializing transaction set matrix M from variant transaction set list ErrorRecord and test case list ErrList dataa×b
Figure GDA0002434674780000021
Wherein a is the number of the ErrorRecord elements plus 1, b is the number of the errorlist elements plus 2, that is, a ═ ErrorRecord | +1, b ═ errorlist | +2, each item of transaction information in the ErrorRecord is stored according to a row, the first row of the matrix stores the frequency count of the corresponding test cases according to the sequence of the ErrList, wherein the zero-number element of the matrix is not stored, the first column is set as the number of the test cases contained in the transaction item, the last column stores the frequency count of the occurrence of the transaction item, the column is initialized to 1, that is, for any integer δ, and δ ∈ [1, a ], which satisfies mδ(b-1)1 is ═ 1; suppose the kth transaction item MList in the transaction itemskThere are β test cases, MListk={testk1,testk2,...,test},
Figure GDA0002434674780000022
Figure GDA0002434674780000023
Then the zero-number element in the k-th row of the matrix is transaction MListkThe number of test cases involved, i.e. mk0=|MListkL, |; the xth element of the row is set to: if the xth test case in the test case list ErrList exists in the transaction item MListkThen this element is set to 1, otherwise to 0, i.e. the remaining elements of the row are set as follows:
Figure GDA0002434674780000031
wherein x belongs to [1, b-1), x is an integer, and x belongs to [1, b-1), testx∈ErrList;
(4) Reducing transaction set matrix Ma×b: firstly, ordering a transaction set matrix M, arranging the transaction set matrix M in a descending order according to the number of test cases contained in each transaction, and then reducing the matrix, wherein the specific reduction process is as follows:
(a) let vaccy represent the position that the next transaction should move in the process of transaction set matrix reduction, sign represent the position of the first variant transaction item with the same number of test cases in multiple continuous transaction items, where vaccy and sign are integers, and 2 ≤ vaccy<a, 1 is not less than sign and not more than a-1; current Pre-processing List MListiWherein sign<i<a, if mi0≦ 1, proceed to step (c), otherwise associate the transaction item with its previous list MList, respectivelyjComparison, where sign is ≦ j<i, if mi0=mj0Then transaction MListiAnd MListjCarrying out the step (b) with the same number of test cases; if mi0≠mj0Increasing the value of vaccy, moving down the current pre-processed transaction item, i.e. making vaccy +1, MListi=MListi+1Repeating step (a);
(b) to transaction MListiAnd MListjPerforming exclusive OR operation on the specified positions, and if the specified position elements of the two transaction items are the same, namely for any k, wherein k is an integer and belongs to [1, b-1 ]), satisfying
Figure GDA0002434674780000032
Then the transaction item MListiAnd MListjConsistency, deletable transaction list MListiAnd order list MListjAdding 1 to the frequency; if MListiNot consistent with any previous transaction item, then the transaction MListiMove to the position with the subscript of vacacy, and increase the value of vacacy, and move down the current pre-processed transaction item, i.e. make vacacy as vacacy +1, MListi=MListi+1Repeating step (a);
(c) if there is a transaction item MListiThe number of test cases contained is less than or equal to 1, i.e. mi0If the value is less than or equal to 1, the transaction item cannot acquire the association relationship among the test cases, and the transaction item and all the subsequent transaction items can be deleted directly, at this time, the value is equal to i, and step (d) is performed;
(d) changing the matrix size to make a equal to vacacy, and assigning the frequency of each transaction item to the first element of the transaction item, namely mi0=mi(b-1)Wherein m isi0For transaction item MListiThe last column of the matrix is deleted, and b is equal to b-1;
(5) acquiring a frequent mode: mining binary matrix Ma×bSet of frequent patterns L ═ L1,L2,...,Li,...,La-1Wherein 1 is less than or equal to i<a,LiFor transaction MListiThe intersection lists of all the transactions before the transaction comprise non-empty subsets of each intersection list, and the frequency of each subset is calculated at the same time, and the method specifically comprises the following steps:
(e) transactional MListiMList for all transactions respectively preceding the transactionjIntersection of the phases with each other, wherein 1<j<i, if an integer k exists, k belongs to [1, b), satisfying the condition mik∩mjk1, then MListiAnd MListjThe existence of intersection LijAdding all k values satisfying the condition to the intersection LijIn each case obtaining an intersection LijObtaining the list non-empty subset according to step (f);
(f) pair list LijTo carry out the position pressingAND operation obtains all non-empty subsets, L, of the listijNumber of elements r ═ LijLet binary number start be 1,
Figure GDA0002434674780000033
the mark values are increased by 1 from start, each value of the mark is mapped to a subset list L, the frequency of each subset is calculated according to the step (g), and L is added to the list LiPerforming the following steps;
(g) acquiring transactional MListiAnd MListjIntersection list LijFrequency of the subset l, if
Figure GDA0002434674780000041
And the frequency is count, then the subset l frequency is equal to the original frequency count and the transaction MListjSum of frequencies, i.e. count + mj0(ii) a If it is
Figure GDA0002434674780000042
Then the subset l is frequently transactional MListiAnd MListjSum of frequencies, i.e. count mi0+mj0
(6) Reducing the test case according to the association rule: acquiring a rule of rule ═ rule { rule ] by the frequent pattern generated in the step (5)1,rule2,...,ruleρ,.. }; let the test case reduce to minConfidence, if rule is associatedρIf the confidence conf is greater than or equal to minConfidence, namely, conf is greater than or equal to minConfidence, the test case is a reducible test case.
The invention is characterized in that: (1) a measurement mode of the correlation relation between the test cases is provided; (2) effectively acquiring association rules by using a binary matrix; (3) and carrying out test case reduction by combining the mutation test and the association rule. Experiments prove that the test case can be more effectively reduced through lower cost.
Advantageous effects
The purpose of test case reduction is to use as few test case sets as possible and meet the given software test target to the greatest extent, thereby improving the test efficiency and reducing the test cost. To date, researchers have proposed a variety of test case reduction methods, with typical test case reduction methods being the greedy algorithm and the HGS algorithm. The greedy algorithm is also called as the G algorithm, the cases which can cover the test requirements at most are selected from the original test case set, when the test requirements are met, the test requirements are deleted from the test requirement set, and the process is repeated until all the requirements are met. The HGS algorithm firstly groups the test requirements according to the importance degree of each test requirement in the test requirements, then processes the test cases in each group according to the importance degree of the test requirements, and repeats the process until the test requirements in all groups are processed. Due to the uncertainty of random selection of the two methods, the global optimal solution cannot be obtained finally, and the selected local optimal solution cannot ensure the global optimal solution.
The invention provides a test case reduction method based on mutation test and association rules, which is characterized in that mutation scores are used for measuring the sufficiency of test cases, the association relationship of the test cases is obtained according to whether the test cases can find specified variants, and the test cases are reduced according to the obtained association relationship. The invention discloses a matrix-based association mining method, which replaces a transaction set matrix with binary data, greatly reduces the I/O load of a computer, and the binary data can be directly processed by the computer, so that the binary matrix has higher time efficiency.
The effectiveness and feasibility of the method of the invention is demonstrated by comparing the method of the invention with two classical algorithms (HGS and G algorithms) in a typical experiment.
(1) Test object
When selecting the experimental object, the test program selects a classic experimental program jtcas program (downloaded in http:// sir. unl. edu) on the Siemens program set, the program has 169 lines of codes, and the program is widely applied to verifying the effectiveness of different software test methods and is a classic benchmark program.
(2) Evaluation criterion
According to the method, the experimental result is analyzed from the perspective of variation scoring and test coverage, the variation scoring can effectively evaluate the sufficiency of the test case set, and the higher the scoring is, the more the test case is. The experiment aims to effectively reduce the test cases on the premise of not changing or extremely changing the variation scores, so that the reduced test cases have the minimum influence on the test coverage rate.
(3) Experimental implementation
Designing test cases with different scales, firstly recording the test coverage rate of an original test case set and the sufficiency, namely the variation score of the test case set, respectively reducing the test cases by using the reduction method and two classical methods (HGS and G algorithm) provided by the invention, and analyzing the reduction rates of the test cases in different test case scales by the three methods by comparing the reduction numbers of the original test case set by the different methods; and (4) re-acquiring the variation score and the test coverage rate of the reduced test case, and analyzing the influence of the three test case reduction methods on the test coverage rate and the test case sufficiency through experiments. Table 1 shows the scale of the different test case sets designed for this experiment.
TABLE 1 test case set Scale
Figure GDA0002434674780000051
(4) Analysis of results
The experimental results are shown in fig. 2, 3 and 4. FIG. 2 is a comparison graph of reduction rates of test cases of three methods, and it can be seen from the graph that when the number of original test cases is small, the reduction rate of the method proposed by the present invention has no great advantage compared with the other two methods, but when the scale of the original test case set is increased, the method proposed by the present invention has great advantage, when the number of test cases is continuously increased, the reduction rates of the test cases of the HGS algorithm and the G algorithm are obviously reduced, and along with the increase of the number of test cases, the reduction rate of the test cases is also increased, so that the test cases can be more efficiently reduced; fig. 3 analyzes the experimental effect of the three methods from the perspective of the variation score of the reduced test case set, and the test case is reduced by using the conventional methods (HGS algorithm and G algorithm), which has a large influence on the variation score, but the variation score can be unchanged or changed very little by the method disclosed by the present invention, so that the reduced test case set and the original test case set have the same test sufficiency; fig. 4 analyzes the effectiveness of the three test case reduction methods from the test coverage direction, and it can be seen that the test case after reduction has higher test coverage by the method provided by the present invention.
The comprehensive experimental data shows that the method disclosed by the invention can effectively reduce the test case set under the same conditions. The test cases are effectively reduced on the premise of not changing or slightly changing the variation scores, and the reduced test cases have the minimum influence on the test coverage rate.
Drawings
FIG. 1 is a functional block diagram of the present invention
FIG. 2 is a reduction ratio comparison of test cases of three algorithms in the experiment of the present invention
FIG. 3 is a comparison of variation scores for three algorithms in the experiments of the present invention
FIG. 4 is a comparison of the test coverage of three algorithms in the experiment of the present invention
Figure 5 is an exemplary source program cal
Detailed Description
The invention utilizes the characteristic that the mutation test can measure the sufficiency of the test case, and effectively reduces the test case on the premise of not changing or slightly influencing the mutation score, and the design flow chart of the method provided by the invention is shown in figure 1.
(1) Three variation factors were designed for the example source program of fig. 5, and as shown in table 2, performing these three variation factors on the source program would yield 40 variants. Let there be test case set test ═ test1,test2,...,test9And executing Tests on the source program and the variants respectively.
TABLE 2 variation factors and description
Figure GDA0002434674780000061
Each variant can have a test case capable of finding the variant and a test case incapable of finding the variant, and the inventionThe main analysis is to analyze the test cases which can not find the variants and perform association rule mining, and the test cases which can not find the variant in each variant are stored as a list MList and are used as a transaction item. Suppose that the ith variant transaction item information is MListi={testi1,testi2,...,testiqAnd (c) the step of (c) in which,
Figure GDA0002434674780000062
ErrorRecord is a list of variant transaction sets, let ErrorRecord ═ MList1,MList2,...,MListi,...,MList40}。
(2) Acquiring a frequent set of test cases: let the minimum support of association rule minSu be 20, and the frequency set of test cases ErrMap be { test }1:24,test2:4,test3:20,test4:24,test5:24,test6:24,test7:24,test8:9,test920, wherein, the element testiNum (1. ltoreq. i. ltoreq.9) represents the test case testiThe frequency of (d) is num; the ErrMap sets are sorted in descending order according to the frequency of the test cases, and the test cases with the frequency greater than or equal to the minimum support degree are stored as the ErrList, so that the ErrList is { test }4,test5,test6,test7,test1,test3,test9}。
(3) Creating a variant transaction set matrix: determining the matrix M from the variant transaction set list ErrorRecord and the test case set list ErrLista×bSize, then, a ═ ErrorRecord | +1 ═ 41, b ═ ErrList | +2 ═ 9, i.e. the transaction set matrix is:
Figure GDA0002434674780000063
let M41×9=[c0,c1,...,c8],M41×9=[r1,r2,…,r40]TWherein c isi(i is more than or equal to 0 and less than or equal to 8) is a column vector, ri(0≤i≤40) Is a row vector, i.e. riTransaction item information representing the ith variant. The first row of the matrix stores the frequency of the corresponding test cases, namely row vector r, in sequence according to ErrList list sequence0=[24,24,24,24,24,20,20](ii) a The first column of the matrix represents the number of test cases for which no corresponding variant can be found, i.e.
Figure GDA0002434674780000064
Wherein i represents the ith row of the matrix, namely the test case information contained in the ith variant; the last column of the matrix records the frequency of the occurrence of the transaction, initialized to 1, i.e.
Figure GDA0002434674780000065
The remaining elements of the ith row of the matrix are set as:
Figure GDA0002434674780000066
then, the transaction set matrix is initialized to:
Figure GDA0002434674780000071
(4) reduce transaction set matrix: arranging the transaction set matrix created in the step (3) in a descending order of rows, and taking the number of test cases contained in each transaction item as an ordering criterion; deleting duplicate redundant transaction entries in the matrix:
suppose a transaction item MListi(1 ≦ i ≦ 40) for {7, 1, 1, 1, 1, 1, 1, 1}, then the row vector riComparing the transaction item with the previous transaction items, namely {7, 1, 1, 1, 1, 1, 1 }; if MList existsj={7,1,1,1,1,1,1,1,5}(1≤j<i) I.e. rjWith {7, 1, 1, 1, 1, 1, 1, 1, 5}, it is possible to have both transaction items specify the same location, i.e., for any k (k ∈ [2, 7 ])]) Satisfy mik=mjkThen transaction item MListiAnd MListjIs a duplicate transaction item; deleting transaction item MListiAdding transaction item MList at the same timejFrequency, i.e. deleting row vectors riSimultaneously order mj8When 5+1 is 6, MList is performedj1, 1, 1, 1, 1, 1, 6, and a row vector rj={7,1,1,1,1,1,1,1,6};
Assume that there is a transaction MListi(1. ltoreq. i.ltoreq.40) contains 1 or less test cases, i.e., mi0If the correlation of the test cases in the transaction item cannot be mined, deleting the transaction and all the subsequent transactions;
after the reduction of the matrix is finished, the size of the matrix needs to be changed, the row vectors in the first row of the matrix are deleted, the number of test cases contained in each transaction is further covered as the frequency of the transaction item, and the column vectors of the original frequency are deleted, so that the matrix M41×9The reduction is as follows:
Figure GDA0002434674780000072
(5) obtaining a variant transaction set frequent pattern set L (L ═ L-1,L2,...,LnN is an integer), a matrix M needs to be solveda×bAnd acquiring the intersection of each row vector and the vector before the row vector, acquiring the non-empty subsets of the intersection and calculating the frequency of each subset. Suppose a transaction item MListi(1 ≦ i ≦ 5), and solving the intersection of the transaction item and each of the previous transaction items and the intersection non-empty subset Li(Li={Li1,Li2,...,LimAnd m is an integer), the specific process comprises:
(a) suppose there is a transaction item MListj={19,1,1,1,1,1,1,1},(1≤j<i) Obtaining a transaction item MListiAnd MListjIntersection set Lij: if k, k ∈ [1,7 ]]Satisfy mik∧mjk1, then MListiAnd MListjThere is an intersection LijAnd add k to the list LijIn (1). Then Lij=MListi∩MListj={1,4,5};
(b) Obtaining the intersection LijAll non-empty subsets: to LijDo twoCarry the bit-wise AND operation, let n ═ LijI, binary number start is 1,
Figure GDA0002434674780000073
mark is initialized to start, and increased by 1 in series until end is added, each mark value is mapped to a subset list, and each non-empty subset is added to LijThe method comprises the following steps:
such as L ij1, 4, 5, then start is 1 and end is 111. When mark is 001, the subset l is mapped1-5; when mark is 010, the subset l2-4; when mark is 011, subset l34, 5; when mark is 100, the subset l 41; when mark is 101, subset l 51, 5; when mark is 110, subset l 61, 4; when mark is 111, subset l 71, 4, 5. Then LijAll subsets are { l1,l2,l3,l4,l5.l6,l7}。
(c) Obtaining the frequency of each subset: suppose that
Figure GDA0002434674780000081
Wherein
Figure GDA0002434674780000082
Then lkFrequency of LijThe subset frequency and MListjSum of frequency counts; if it is
Figure GDA0002434674780000083
Then the subset lkMList with transaction frequencyiAnd MListjSum of frequencies, i.e. count mi0+mj0=19+2=21。
All frequent patterns of this variant transaction set are shown in table 3 (minSup ═ 20):
table 3 variant transaction set frequency patterns
Figure GDA0002434674780000084
(6) Root of herbaceous plantAnd (3) reducing the test case according to the association rule: obtaining the rule of association of test cases (rule) from the frequent pattern set L generated in step (5) by applying the existing technique1,rule2,...,rulenThe symbols (n is an integer) are shown in Table 4:
TABLE 4 test case Association rules
Figure GDA0002434674780000085
Let the minimum confidence level minConfidence of association rule be 1.0, and if there is a rule confidence level conf be 1.0, where the rule is
Figure GDA0002434674780000086
And rule belongs to rule, and if conf is more than or equal to minConfidence, then test case test5Test cases may be deleted. Analyzing all the association rules, the deletable test cases of the original test case set Tests are { test5,test3,test9,test6,test7,test1}。
The test case reduction method based on the mutation test and the association rule can effectively improve the time efficiency and the space utilization rate of the test case reduction, and the reduced test case set can not change or slightly change the mutation score and the test coverage rate of original data.

Claims (1)

1. A test case reduction method based on mutation test and association rule is characterized by comprising the following steps:
(1) performing a variation test: defining p original test case sets test ═ { test ═ test1,test2,...,testpM variants ═ mutant } ═ mutant1,mutant2,...,mutantmExecuting the test case set on the source program and the variant respectively; storing the test case information as a list MutantRecord with the criterion of whether the test case can kill the specified variant, wherein the MutantRecord is { Record1,Record2,...,RecordqThen, the position of the end of the frame,for any variant mutantkAnd mutantkE, Mutants, existing test cases which can find the variant or can not find the variant, and storing the test cases which can not find the variant into a variant list MListkPerforming the following steps; MList assuming that the variant could not be found in gamma test casesk={testk1,testk2,...,testStore all variant lists as variant transaction set lists ErrorRecord, then ErrorRecord ═ MList1,MList2,...,MListm};
(2) Calculating the frequency of the test cases: let minSup denote the minimum support of association rule, and the set ErrMap ═ test1:num1,test2:num2,...,testp:numpDenotes the test cases traversed from the list ErrorRecord and the frequency of the test cases, assuming a list of variant transactions MListkTest case test exists inTest being∈MListkIf test is trueE e.g. ErrMap, then test in ErrMap will be setThe frequency of (2) increases by 1; otherwise test will beAdding the test case frequency into an ErrMap set, and setting the frequency of the test case to be 1; and finally, storing the test cases with the frequency greater than or equal to the minimum support degree as a test case list ErrList ═ test according to a descending sequencet1,testt2,...,testtwW is the number of test cases with the support degree larger than minSup, and t1, t2, … and tw are different numbers of test cases in a test case set with the support degree larger than the minimum support degree;
(3) creating a variant transaction set matrix: creating and initializing transaction set matrix M from variant transaction set list ErrorRecord and test case list ErrList dataa×b
Figure FDA0002434674770000011
Wherein a is the number of ErrorRecord element plus 1, b is the number of ErrList element plus 2, i.e. a | ErrorRecord | +1,b ═ ErrList | +2, store every item of affair information of the ErrorRecord according to the row, matrix first row according to listing ErrList sequence deposit corresponding test case frequency count, wherein matrix zero number element does not store, first column sets up as the test case number that the affair item contains, last column stores the frequency count that the affair item appears, the column is initialized to 1, namely for any integer δ, and δ ∈ [1, a), satisfy mδ(b-1)1 is ═ 1; suppose the kth transaction item MList in the transaction itemskThere are β test cases, MListk={testk1,testk2,...,test},
Figure FDA0002434674770000013
Figure FDA0002434674770000014
Then the zero-number element in the k-th row of the matrix is transaction MListkThe number of test cases involved, i.e. mk0=|MListk|;
The xth element of the row is set to: if the xth test case in the test case list ErrList exists in the transaction item MListkThen this element is set to 1, otherwise to 0, i.e. the remaining elements of the row are set as follows:
Figure FDA0002434674770000012
wherein x belongs to [1, b-1), x is an integer, and x belongs to [1, b-1), testx∈ErrList;
(4) Reducing transaction set matrix Ma×b: firstly, ordering a transaction set matrix M, arranging the transaction set matrix M in a descending order according to the number of test cases contained in each transaction, and then reducing the matrix, wherein the specific reduction process is as follows:
(a) enabling vaccy to represent the position where the next transaction should move in the process of transaction set matrix reduction, and enabling sign to represent the position of the first variant transaction item with the same test case number in a plurality of continuous transaction items, wherein the vaccy and the sign are integers, 2 is more than or equal to the vaccy and is less than or equal to a, and 1 is more than or equal to the sign and is less than or equal to a-1; current Pre-processing List MListiWhere sign < i < a, if mi0≦ 1, proceed to step (c), otherwise associate the transaction item with its previous list MList, respectivelyjComparing, wherein sign is less than or equal to j and less than i, if mi0=mj0Then transaction MListiAnd MListjCarrying out the step (b) with the same number of test cases; if mi0≠mj0Increasing the value of vaccy, moving down the current pre-processed transaction item, i.e. making vaccy +1, MListi=MListi+1Repeating step (a);
(b) to transaction MListiAnd MListjPerforming exclusive OR operation on the specified positions, and if the specified position elements of the two transaction items are the same, namely for any k, wherein k is an integer and belongs to [1, b-1 ]), satisfying
Figure FDA0002434674770000026
Then the transaction item MListiAnd MListjConsistency, deletable transaction list MListiAnd order list MListjAdding 1 to the frequency; if MListiNot consistent with any previous transaction item, then the transaction MListiMove to the position with the subscript of vacacy, and increase the value of vacacy, and move down the current pre-processed transaction item, i.e. make vacacy as vacacy +1, MListi=MListi+1Repeating step (a);
(c) if there is a transaction item MListiThe number of test cases contained is less than or equal to 1, i.e. mi0If the value is less than or equal to 1, the transaction item cannot acquire the association relationship among the test cases, and the transaction item and all the subsequent transaction items can be deleted directly, at this time, the value is equal to i, and step (d) is performed;
(d) changing the matrix size to make a equal to vacacy, and assigning the frequency of each transaction item to the first element of the transaction item, namely mi0=mi(b-1)Wherein m isi0For transaction item MListiThe last column of the matrix is deleted, and b is equal to b-1;
(5) acquiring a frequent mode: mining binary matrix Ma×bSet of frequent patterns L ═ L1,L2,...,Li,...,La-1Wherein i is more than or equal to 1 and less than a, LiFor transaction MListiThe intersection lists of all the transactions before the transaction comprise non-empty subsets of each intersection list, and the frequency of each subset is calculated at the same time, and the method specifically comprises the following steps:
(e) transactional MListiMList for all transactions respectively preceding the transactionjTaking intersection of the phase and the phase, wherein j is more than 1 and less than i, if an integer k exists, k belongs to [1, b ], and the condition m is satisfiedik∩mjk1, then MListiAnd MListjThere is an intersection LijAdding all k values satisfying the condition to the intersection LijIn each case obtaining an intersection LijObtaining the list non-empty subset according to step (f);
(f) pair list LijPerforming a bitwise AND operation to obtain all non-empty subsets, L, of the listijNumber of elements r ═ LijI, a binary number
Figure FDA0002434674770000021
Figure FDA0002434674770000022
The mark values are increased by 1 from start, each value of the mark is mapped to a subset list L, the frequency of each subset is calculated according to the step (g), and L is added to the list LiPerforming the following steps;
(g) acquiring transactional MListiAnd MListjIntersection list LijFrequency of the subset l, if
Figure FDA0002434674770000024
And the frequency is count, then the subset l frequency is equal to the original frequency count and the transaction MListjSum of frequencies, i.e. count + mj0(ii) a If it is
Figure FDA0002434674770000025
Then the subset l is frequently transactional MListiAnd MListjSum of frequencies, i.e. count mi0+mj0
(6) According toThe association rule reduces the test case: acquiring a rule of rule ═ rule { rule ] by the frequent pattern generated in the step (5)1,rule2,..,ruleρ,.. }; let the test case reduce to minConfidence, if rule is associatedρIf the confidence conf is greater than or equal to minConfidence, namely, conf is greater than or equal to minConfidence, the test case is a reducible test case.
CN201710216887.1A 2017-04-05 2017-04-05 Test case reduction method based on variation test and association rule Active CN106991051B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710216887.1A CN106991051B (en) 2017-04-05 2017-04-05 Test case reduction method based on variation test and association rule

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710216887.1A CN106991051B (en) 2017-04-05 2017-04-05 Test case reduction method based on variation test and association rule

Publications (2)

Publication Number Publication Date
CN106991051A CN106991051A (en) 2017-07-28
CN106991051B true CN106991051B (en) 2020-06-16

Family

ID=59416183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710216887.1A Active CN106991051B (en) 2017-04-05 2017-04-05 Test case reduction method based on variation test and association rule

Country Status (1)

Country Link
CN (1) CN106991051B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107832228A (en) * 2017-11-29 2018-03-23 北京锐安科技有限公司 A kind of test case reduction method, device, equipment and storage medium
CN109460354B (en) * 2017-12-28 2021-09-24 南京邮电大学 Method for test case reduction based on RDF reasoning
CN110399285B (en) * 2018-04-24 2022-11-15 西安邮电大学 Test case reduction method based on weak mutation analysis
CN109086202B (en) * 2018-07-19 2021-05-14 北京计算机技术及应用研究所 FPGA/IP core code rule checking method based on association rule
CN109490753B (en) * 2018-11-13 2020-12-08 吉林大学 Method for reducing integrated circuit test mode set by combining minimum bump
CN109739746B (en) * 2018-12-12 2022-03-01 江苏师范大学 Variation testing method based on original sentence dominance analysis
CN110084369A (en) * 2019-04-08 2019-08-02 西北工业大学 Mutation testing variant reduction method based on multiple-objection optimization
CN112115039B (en) * 2019-06-21 2023-09-19 百度在线网络技术(北京)有限公司 Test case generation method, device and equipment
CN110687433B (en) * 2019-10-23 2021-11-12 吉林大学 Method for reducing integrated circuit test mode set by combining PMS technology
CN111124516B (en) * 2019-12-22 2021-12-03 北京浪潮数据技术有限公司 Server parameter reduction method and device and computer readable storage medium
CN113705813B (en) * 2021-09-01 2024-05-28 中国工商银行股份有限公司 Mutation rule supplementing method and device based on genetic algorithm
CN114091622A (en) * 2021-12-07 2022-02-25 西安邮电大学 Variant reduction method based on self-organizing mapping neural network
CN117131145B (en) * 2023-08-03 2024-03-26 卡斯柯信号(北京)有限公司 Track map data verification method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009033023A2 (en) * 2007-09-07 2009-03-12 Ntt Docomo, Inc. A method for test suite reduction through system call coverage criterion
CN101464831A (en) * 2009-01-09 2009-06-24 西安邮电学院 Reduction technology for test use cases
CN104268077A (en) * 2014-09-23 2015-01-07 湖州师范学院 Chaos genetic algorithm based test case intensive simple algorithm

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009033023A2 (en) * 2007-09-07 2009-03-12 Ntt Docomo, Inc. A method for test suite reduction through system call coverage criterion
CN101464831A (en) * 2009-01-09 2009-06-24 西安邮电学院 Reduction technology for test use cases
CN104268077A (en) * 2014-09-23 2015-01-07 湖州师范学院 Chaos genetic algorithm based test case intensive simple algorithm

Also Published As

Publication number Publication date
CN106991051A (en) 2017-07-28

Similar Documents

Publication Publication Date Title
CN106991051B (en) Test case reduction method based on variation test and association rule
Ilievski et al. Efficient hyperparameter optimization for deep learning algorithms using deterministic rbf surrogates
Campos et al. Context-independent scatter and tabu search for permutation problems
Hamdani et al. Hierarchical genetic algorithm with new evaluation function and bi-coded representation for the selection of features considering their confidence rate
CN111931801B (en) Dynamic route network learning method based on path diversity and consistency
US20220245510A1 (en) Multi-dimensional model shape transfer
US20070233532A1 (en) Business process analysis apparatus
CN106845519A (en) A kind of sparse Subspace clustering method of distributed implementation
CN109767034B (en) Relay protection constant value optimization method and device, computer equipment and storage medium
CN109074348A (en) For being iterated the equipment and alternative manner of cluster to input data set
Kumagai et al. Combinatorial clustering based on an externally-defined one-hot constraint
Bhambri A CAD system for software effort estimation
CN108761310B (en) Quantum chip test method
JP4143234B2 (en) Document classification apparatus, document classification method, and storage medium
CN104376120B (en) A kind of information retrieval method and system
CN111782904B (en) Unbalanced data set processing method and system based on improved SMOTE algorithm
Mitran et al. Patterns of Convergence and Bound Constraint Violation in Differential Evolution on SBOX-COST Benchmarking Suite
CN113297185A (en) Feature derivation method and device
JP2017107472A (en) Character string search method and device
Wakayama et al. Distributed forests for MapReduce-based machine learning
JP2012043437A (en) Image processing method and image processing device
CN114169542A (en) Integrated learning tree construction method for incomplete data classification
CN107105052A (en) Heuristic web service composition method based on figure planning
JP7037048B2 (en) Search program and search method
Huang et al. Elastic dnn inference with unpredictable exit in edge computing

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