CN102323906A - MC/DC test data automatic generation method based on genetic algorithm - Google Patents
MC/DC test data automatic generation method based on genetic algorithm Download PDFInfo
- Publication number
- CN102323906A CN102323906A CN201110265194A CN201110265194A CN102323906A CN 102323906 A CN102323906 A CN 102323906A CN 201110265194 A CN201110265194 A CN 201110265194A CN 201110265194 A CN201110265194 A CN 201110265194A CN 102323906 A CN102323906 A CN 102323906A
- Authority
- CN
- China
- Prior art keywords
- test data
- node
- dependence
- fitness function
- fitness
- 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.)
- Granted
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 237
- 238000000034 method Methods 0.000 title claims abstract description 67
- 230000002068 genetic effect Effects 0.000 title claims abstract description 45
- 238000004458 analytical method Methods 0.000 claims abstract description 46
- 238000011156 evaluation Methods 0.000 claims abstract description 8
- 230000035772 mutation Effects 0.000 claims abstract description 7
- 230000014509 gene expression Effects 0.000 claims description 34
- 230000008569 process Effects 0.000 claims description 33
- 210000000349 chromosome Anatomy 0.000 claims description 28
- 230000003044 adaptive effect Effects 0.000 claims description 15
- 238000013459 approach Methods 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 claims description 12
- 238000013461 design Methods 0.000 claims description 12
- 238000010353 genetic engineering Methods 0.000 claims description 11
- 238000012163 sequencing technique Methods 0.000 claims description 11
- 230000014759 maintenance of location Effects 0.000 claims description 10
- 241001269238 Data Species 0.000 claims description 9
- 108090000623 proteins and genes Proteins 0.000 claims description 8
- 230000001174 ascending effect Effects 0.000 claims description 6
- 230000006978 adaptation Effects 0.000 claims description 5
- 230000008859 change Effects 0.000 claims description 4
- 230000002028 premature Effects 0.000 claims description 4
- 238000012545 processing Methods 0.000 claims description 4
- 239000012141 concentrate Substances 0.000 claims description 3
- 230000001419 dependent effect Effects 0.000 claims description 3
- 239000012634 fragment Substances 0.000 claims description 3
- 239000007943 implant Substances 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 3
- 230000003068 static effect Effects 0.000 claims description 3
- 238000002156 mixing Methods 0.000 claims description 2
- 230000002950 deficient Effects 0.000 abstract description 3
- 238000010276 construction Methods 0.000 abstract 1
- 238000005457 optimization Methods 0.000 abstract 1
- 230000015572 biosynthetic process Effects 0.000 description 4
- 238000012512 characterization method Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000003786 synthesis reaction Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000012937 correction Methods 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 241000283726 Bison Species 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000002759 chromosomal effect Effects 0.000 description 1
- 230000009194 climbing Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000002921 genetic algorithm search Methods 0.000 description 1
- 230000008303 genetic mechanism Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012804 iterative process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000011002 quantification Methods 0.000 description 1
- 230000000452 restraining effect Effects 0.000 description 1
- 239000000523 sample Substances 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 230000004083 survival effect Effects 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a MC/DC (Modified Condition Decision Coverage) test data automatic generation method based on a genetic algorithm, comprising the following steps of: statically analyzing a tested program to generate a control flow graph, a data flow graph, an abstract syntax tree and an abstract analysis tree; generating a MC/DC test case expected result set; executing code instrumentation on the tested program; constructing a fitness function; randomly generating the test data, and checking whether the test data satisfies an expected execution path; and obtaining proper test data through genetic operations, such as selection, crossing, mutation and the like of the genetic algorithm. In the method, for construction of the fitness function, optimization of approximate-level fitness evaluation by a method of obtaining a control node directly or indirectly influencing defective node traversing through data dependency is proposed according to the thought of a chaining method and based on the conventional fitness function. The method has greater practical value for testing a system with complex logical relations.
Description
Technical field
The invention belongs to the software testing technology field, be specifically related to a kind of MC/DC automatic generation of test data, particularly satisfy the automatic generation of test data that MC/DC covers (correction conditions is judged covering) in the engineering test based on genetic algorithm.
Background technology
The automatic generation technique of test data is meant through specific algorithm constructs test input data automatically according to the stipulations or the program structure of software; Its purpose be to alleviate the tester a large amount of work that must pay; Reduce the great number cost of manual test, improve the confidence level of test process simultaneously.Genetic algorithm is that a kind of biological evolution process of simulating is found the solution the self-adaptation artificial intelligence technology of extreme-value problem with mechanism, when solving large space, high complexity issue such as non-linear, has special advantages.
Dynamically the thought of executive routine generation test data is proposed by Miller and Spooner at first, and scholar has afterwards done a large amount of further research.1992, Xanthakis at first was applied to test case with genetic algorithm and generates, and its adopts coding techniques that D is mapped to gene space G, and confirmed the direction of search through the natural selection of the genetic manipulation such as selection, intersection, variation and the survival of the fittest.Intersect with mutation operation be the new information of population introducing, thereby more help finding globally optimal solution, avoided algorithm in the past often to be absorbed in the problem of local extremum easily, can generate the test data that satisfies all branch's decision criterias.At home; 1996 to 1998; Pod is big, Gao Zhongyi etc. delivered many pieces of papers, discusses genetic algorithm is applied to the automatic generation based on the Ada software configuration test data of path covering, and draws genetic algorithm generates test data than climbing method and random approach the high conclusion of efficient.Calendar year 2001, Wang Hao etc. have provided formal expression and test data generation system prototype based on this algorithm of genetic algorithm.2003, Jing Zhiyuan from the angle analysis of mathematics with improved algorithm application such as MGA and hereditary K averages in the automatic generation of test case.2006, Cheng Ye was used for path coverage test data at academic dissertation with genetic algorithm and generates automatically, and has developed corresponding tool model.2008, Lv Shanshan used neural network and genetic algorithm to generate the test data based on input domain in her academic dissertation.Generally speaking, the domestic and international research scholar adopts the improvement algorithm of genetic algorithm or genetic algorithm to generate test data as core algorithm more now.But above-mentioned all is to select the simple relatively statement of logical organization to cover or branch's covering generation test case, and it can't be widely used in the practical project field.
Summary of the invention
To the problem that exists in the prior art, the present invention proposes a kind of MC/DC automatic generation of test data based on genetic algorithm.Only rely on internodal control dependence in the control flow graph to traditional fitness function in the genetic algorithm; Do not consider the defective of the data dependence relation that tested program is inner; Propose to use cascade synthesis thought to collect the Control Node that directly perhaps relies on remote effect problem node traversal through data; And traditional fitness function that itself and characterization control dependence are good at combines; Construct a new fitness function, overcome traditional fitness function because of ignoring the problem that guidance information lacks, search is degenerated that the inner data dependence relation of program causes with this.Design has realized the automatic generation of test data that satisfies the MC/DC criterion based on genetic algorithm on this basis.The MC/DC criterion is stressed the ability of single variable for the true and false influence of last expression formula; Require each condition all will independently influence the result of predicated expressions, have great practical value when logical relation complicacy and the higher software systems of security requirement are tested.
The present invention proposes a kind of MC/DC automatic generation of test data based on genetic algorithm, specifically comprises following step:
Step 1: tested program is carried out static analysis, produce control flow graph, DFD, abstract syntax tree and abstract analysis tree.
Step 2: generate MC/DC test case expected results collection.
Step 2.1: the node of from abstract analysis tree, offering, these condition nodes have constituted the leaf of abstract analysis tree, and each leaf is exactly a variable, the number of the leaf variable of representing with N to extract.
Step 2.2: make up truth table,, have 2 to N leaf variable
NPlant permutation and combination.
Step 2.3: fill truth table with numeral 0 and 1.
Step 2.4: be directed against each row in the truth table:
Step 2.5.1: each leaf variable of the Boolean correspondence in the truth table current line being distributed to the abstract analysis tree;
Step 2.4.2: the Boolean of each condition node of bottom-up evaluation, up to the top of abstract analysis tree, the Boolean of the condition node on the top of the abstract analysis of final gained tree is exactly the output end value of this decision statement;
Step 2.4.3: the output row of filling truth table with the output end value.
Step 2.5: to each leaf variable, seek its test case, and the MC/DC test case of adding each leaf variable to is concentrated:
Step 2.5.1: the MC/DC test use cases of setting up a pair of sky for each leaf variable;
Step 2.5.2: in truth table, seek other leaf variate-values and fix, two row that have only target leaf variable to change;
The output end value of step 2.5.3: two among comparison step 2.5.2 row; If the output end value of two row is different; Then this two row is exactly a pair of test case of target leaf variable, adds this two row to set up among the step 2.5.1 MC/DC test case with paired form and concentrates.
Step 2.6: the MC/DC test use cases of each leaf variable is merged, obtain test use cases, and minimize test use cases.
Step 3: tested program is carried out the code pitching pile.
At first travel through abstract syntax tree and find the position of pitching pile, judge whether it is the pitching pile point,, return and continue the traversal abstract syntax tree and find the pitching pile position if not the pitching pile point; If the pitching pile point is then implanted inspect statement, then directly on abstract syntax tree with the syntax tree fragment of the form code implant of subtree, judge whether pitching pile is accomplished, as accomplishing, tested program compilation run then; As do not accomplish, return and continue the position that the traversal abstract syntax tree finds pitching pile, until accomplishing pitching pile.
Step 4: structure fitness function.
Step 4.1: set up control dependence fitness function:
Step 4.1.1:, obtain the control dependence set of each judgement through the control flow graph of tested program; Control relies on and is used for describing the dependence of the execution of a destination node y about its front branch node output, when the path of each bar from destination node y to Egress node e all comprises node z, claims that node z is by the rearmounted control of destination node y; Arbitrary node x, two nodes (y can constitute an individual path between x), when each bar passing through from destination node y to Egress node e (y, when x) individual path all comprises node z, claim branch of the rearmounted control of node z (y, x); A branch as the rearmounted control of node z y; And the not rearmounted Control Node y of node z; Claim that node z control depends on destination node y; The control dependence is to weigh the approximation ratio that current input test data distance arrives at target from the structural relation angle, departs from the internodal key node of condition through target and execution in the control flow graph and calculates.
Step 4.1.2: set up control dependence fitness function:
Control dependence fitness function has comprised the objective function of each branch node in the set of control dependence, sets up control dependence fitness function to be:
Wherein, dependent
DecisionBe the Control Node number in the control dependence set of target; Executed
DecisionsExpression is input with current test data; ControlDepFit
TestdataExpression control dependence fitness function;
If control dependence fitness function value is 0, then test data can arrive target discrimination; If control dependence fitness function value is greater than 0, then test data has departed from destination node somewhere, and the value through control dependence fitness function obtains departing from node diverged
Node
Step 4.2: set up the data dependence relation fitness function:
Definition pn is the problem node; S is the set that is used for storing the dependence of a given node; As the input of obtaining data dependence relation fitness function method, DepSets is used for storing the current node set of collecting that has dependence with pn and S, and PV is used for the variable that the storage problem node uses; S and DepSets are initialized to empty set, and the method for obtaining the dependence fitness function of a node S is:
Step 4.2.1: the control dependence set ControlDep (pn) that obtains problem node pn composes and gives S, and the variable UsedVariables (pn) that pn is used is added among the PV;
Step 4.2.2:, obtain the last definition set lastDefs of pv for each the variable pv among the PV;
(a) for each last definition ld among the lastDefs, obtain the control dependence set ControlDep (ld) of ld, and itself and S are merged, the S that is expanded, the variable UsedVariables (ld) that then ld is used adds among the newly-built PVnew;
(b), obtain the variable UsedVariables (ld) that it uses, and add in the PVnew set of step 4.2.2 (a) foundation for each the Control Node cd among the ControlDep (ld);
Step 4.2.3: for each the variable pv among the PV, iteration is obtained PV dependence collection S (ld), at first obtains first variable among the PV; Obtain its dependence collection S (ld); Return step 4.2.2, obtain the next variable among the PV then, all variablees in accomplishing PV; Finishing iteration, and S (ld) added among the DepSets;
Step 4.2.4: set up the dependence set that is used to define fitness function:
Definition DepFit is for the set of fitness function dependence, for each the subclass s among the DepSets
i:
(a) add s
iIn DepFit;
(b) judge each non-s among the DepSets
iSubclass s
j, with s
iWhether there is the branch interference of then, else,, then merges two sub-set s if do not exist
i, s
j, obtain new subclass S
I, j, and with S
I, jAdd among the DepFit; If have the branch interference of then, else then can not merge, with s
i, s
jAll add among the DepFit;
Step 4.2.5: set up the data dependence relation fitness function:
After setting up data dependence relation set, obtain the data dependence relation fitness function with the method for calculation control dependence fitness function.
Step 4.3: set up branching adaptation degree function:
When test data arrives at target; Measure the test data test case that whether meets the expectation with branch distance; Through the approximation ratio of Branch Computed distance metric test data,, but do not satisfy any MC/DC test case if test data arrives target discrimination apart from the expectation test case; Each test data all is 0 near level so, but branch's distance is not 0; If test is arrived at target and is realized a test case, its branch's distance and all be 0 so near level; Which test data is the size of branch's distance of calculating be used for estimating and more approach the branch testing use-case that meets the expectation.
Step 5: on the basis of MC/DC test case, fitness function formula and execution pitching pile code; Produce test data at random; And the tested program after carrying out pitching pile on these test datas, obtain fitness value, whether check simultaneously satisfies the path that expection is carried out; If satisfy, then get into step 7; Otherwise entering step 6.
Calculate near horizontal fitness function ApproachLevelFitness, if ApproachLevelFitness is 0, then test data arrives target; Then at the target discrimination place; Branch Computed is apart from BranchFitness, if ApproachLevelFitness and BranchFitness are 0, then test data reaches the MC/DC test target; Otherwise; The fitness function value of test data equals ApproachLevelFitness+normalized (BranchFitness), and normalized (BranchFitness) representes that concrete computation process is to the standardization of branch apart from BranchFitness:
Step 5.1: the method according to step 2 generates MC/DC test case expected results collection.
Step 5.2: the method according to step 4.1 and step 4.2 obtains the dependence set, comprises that control relies on collection and data rely on collection.
Step 5.3:, generate test data T at random to each target discrimination
aWith test data T
b
Step 5.4:,, calculate test data T respectively according to the dependence set according to the computing method in the step 4.1
aWith test data T
bControl rely on fitness function and data dependence fitness function.
Step 5.5:, calculate test data T respectively according to the computing method in the step 4.3
aWith test data T
bBranch's distance;
Step 5.6: the standardization BranchFitness (T that carries out branch's distance
a)
Normalised, computing formula is:
Wherein, BranchFitness (T
a) expression test data T
aBranch's distance, BranchFitness (T
b) expression test data T
bBranch's distance.
Step 5.7: total fitness function value Fitness (T) is:
Fitness(T)=ApproachLevelFitness(T)+BranchFitness(T)
normalized
Wherein, the approaching horizontal fitness function of ApproachLevelFitness (T) expression test data T; BranchFitness (T)
NormalizedThe standardized value of branch's distance of expression test data T.
Step 5.8: which more approaches to reach the judgement target according to these two test datas of total fitness function value comparison.
Step 5.9:
If ApproachLevelFitness and BranchFitness are 0, then test data reaches the MC/DC test target, gets into step 7, otherwise, get into step 6.
Step 6: according to the fitness value that obtains, genetic manipulations such as the selection of use genetic algorithm, intersection, variation generate new test data, and return step 5, calculate the fitness value of newly-generated test data.
Step 6.1: select coding strategy, convert parameter sets X and territory into bit string structure space s.
Adopt the integer and the mode of the full mold mixing chromosome of encoding, the parameter of problem directly converts the gene on the chromosome into, and the number of parameter converts chromosome length into, and each values of parameters interval is mapped as the span of each gene, and detailed process is following:
If the problem of finding the solution comprises n input variable X
1, X
2..., X
n, at first, with the codomain of equivalence class division and boundary value analysis method processing parameter, wherein Y
i(the expression of 1≤i≤n) parameter X
i(set of the Finite Discrete point that 1≤i≤n) can value, | Y
i| represent the size of set, set up the mapping relations in problem solution space and chromosome space, chromosome is expressed as:
X=(X
1,X
2,...,X
n)→C=(C
1,C
2,...,C
n) (2)
Wherein, C is separating in the chromosome Space Solution space, and X is separating of problem space;
Step 6.2: design and selection genetic manipulation comprise the population size, selection, intersection, variation method, and definite crossover probability p
cWith the variation Probability p
mEtc. genetic parameter.
Step 6.2.1: carry out sequencing selection strategy and elite's retention strategy:
The detailed process of carrying out the sequencing selection strategy is:
(a) according to the size of adaptive value, all individualities in the descending sort population;
(b) estimate by design allocation table, according to the adaptive value size, ascending order is distributed each individual probable value;
(c) each individual by heredity to follow-on probability by the probable value decision that distributes in the step (b), again based on these probable values, the chromosome that is eliminated and is replicated with the selection of roulette back-and-forth method; Through one take turns the ordering selection strategy after, can obtain a new population, on this new population basis, carry out elite's retention strategy more then, detailed process is:
(a) based on the size of fitness function value from being to obtain optimized individual and the poorest individuality the current population through the new population that obtains behind the sequencing selection strategy;
(b), then replace the optimized individual that occurs before this with the optimized individual of current colony if the fitness of the optimized individual of current population is higher than the fitness of the optimized individual of the appearance that obtains before this;
(c) keep the optimized individual state of appearance so far constant, the heredity that it is complete is in population of future generation.
Step 6.2.2: interlace operation and mutation operation:
Adopt adaptive crossover probability p
cWith the variation Probability p
m, come adjustment crossover probability p automatically according to average adaptive value of colony and current colony optimum individual adaptive value
cWith the variation Probability p
mf
MaxThe fitness of representing optimum individual in certain generation population, F
AvgThe average fitness of representing this colony in generation, the fitness of optimum individual and this in generation colony the difference DELTA=f of average fitness
Max-F
Avg, then when Δ more little, the fitness difference between the expression population individuality is more little, it is bigger to explain that population reaches the possibility of local optimum at this moment, the possibility of premature convergence is also big more; When Δ is big more, represent that the fitness difference between the individuality is big more, crossover probability p
cWith the variation Probability p
mDecide p by Δ
cAnd p
mComputing formula be:
p
c=k
1/Δ(3)
p
m=k
2/Δ(4)
Wherein, k
1And k
2Be respectively crossover probability adjustment coefficient and variation probability adjustment coefficient.
Step 6.3: random initializtion generates population P.
Step 6.4: calculate the decoded fitness value of individual bit string among the population P.
Step 6.5: according to hereditary strategy, each genetic manipulation that designs in the step 6.2 is acted on population, after selection, intersection and variation, formed population of new generation.
Step 6.6: with the new chromosome that produces is that test data is returned step 5, calculates its fitness value, judges whether its performance satisfies index; Perhaps whether accomplished predetermined iterations; As if not satisfying and not accomplishing iterations, then get into step 6.1, genetic algorithm begins from encoding operation; The population of new generation is selected to duplicate, intersect and make a variation again, constantly iteration; Then directly get into step 7 if satisfy index or accomplished iterations.
Step 7: end of run obtains suitable test data.
The advantage that the present invention has is:
1, the present invention proposes a kind of MC/DC automatic generation of test data based on genetic algorithm; Only rely on internodal control dependence in the control flow graph to traditional fitness function in the genetic algorithm; Do not consider the defective of the data dependence relation that tested program is inner; Propose to use cascade synthesis thought to collect the Control Node that directly perhaps relies on remote effect problem node traversal through data; And traditional fitness function that itself and characterization control dependence are good at combines; Construct a new fitness function, overcome traditional fitness function because of ignoring the problem that guidance information lacks, search is degenerated that the inner data dependence relation of program causes with this.
2, the present invention proposes a kind of MC/DC automatic generation of test data based on genetic algorithm; Realized the automatic generation of test data that satisfies the MC/DC criterion, had great practical value when logical relation complicacy and the higher software systems of security requirement are tested based on genetic algorithm.
Description of drawings
Fig. 1: the process flow diagram that the present invention proposes based on the MC/DC automatic generation of test data of genetic algorithm;
Fig. 2: the generative process process flow diagram of abstract syntax tree among the present invention;
Fig. 3: the generative process process flow diagram of abstract analysis tree among the present invention;
Fig. 4: MC/DC test case expected results collection product process figure among the present invention;
Fig. 5: code pitching pile process flow diagram among the present invention;
Fig. 6: set up the applied a certain usability of program fragments of control dependence fitness function among the present invention;
Fig. 7: genetic algorithm basic flow sheet among the present invention.
Embodiment
Below in conjunction with accompanying drawing the present invention is elaborated.
The present invention proposes a kind of MC/DC automatic generation of test data based on genetic algorithm; This comprises the key contents such as structure, genetic Algorithm Design of generation, code pitching pile, the fitness function of generation, the MC/DC test case expected results collection of generation, the abstract analysis tree of abstract syntax tree; Idiographic flow is as shown in Figure 1, specifically comprises following step:
Step 1: tested program is carried out static analysis, produce information such as control flow graph, DFD, abstract syntax tree and abstract analysis tree; Tested program is meant the software code that will carry out test.
(like testing tool Testbed) carries out lexical analysis, grammatical analysis and semantic analysis to tested program by analytical tool, generates abstract syntax tree.Abstract syntax tree is the other a kind of expression of program compiler at the source program that obtains later on through grammatical analysis.Corresponding one of each syntax rule is handled function accordingly, and hangs on the abstract syntax tree as a node of abstract syntax tree, and external interface is provided, and it can be prepared for next step code pitching pile work.
The generative process of abstract syntax tree is as shown in Figure 2, at first the tested program code is carried out lexical analysis and grammatical analysis.Lexical analysis provides abstract syntax tree needed symbol node, like constant and name; Grammatical analysis then provides the abstract syntax tree that contains the intermediate node of representing corresponding syntactic structure; Then the tested program code is carried out semantic analysis, the processing to name, symbol etc. is carried out changes syntax tree into a kind of canonical form that comprises expression type information and symbol table, and they are connected into tree structure, finally obtains abstract syntax tree.In the code analysis process, accomplish the process of setting up of the abstract syntax tree of tested program code by means of instrument Flex and Bison.
Through the abstract syntax tree that visit has been set up, collect the decision statement subtree, simultaneously, represent relational expression with capitalization, newly-generated subtree is called as the abstract analysis tree.Each is judged all has the abstract analysis of its logical organization of expression tree.Analytical tool is generating abstract analysis tree back generation control flow graph and DFD automatically.
The tested program fragment is " if (x>y&&x>z||x>y+z) "; The abstract syntax tree that Fig. 2 generates for the tested program fragment; The abstract analysis tree that Fig. 3 representes from abstract syntax tree, to extract, wherein, AND and OR are the condition node, A, B, C are called the leaf that abstract analysis is set.
Step 2: generate MC/DC test case expected results collection;
The abstract analysis tree has constituted the input that generates MC/DC test case expected results collection.Each node in the abstract analysis tree all can be assigned with a Boolean and a Boolean variable evaluation, discerns the Boolean that whether calculated this node with the Boolean variable evaluation.With tested program fragment " if (x>y&&x>z||x>y+z) " is example, introduces the generative process of MC/DC test case expected results collection, like Fig. 4.Concrete steps are following:
Step 2.1: the node of from the abstract analysis tree, offering, these condition nodes have constituted the leaf of abstract analysis tree.Each leaf is exactly a variable, the number of the leaf variable of representing with N to extract; Like Fig. 5, (x>y&&x>z||x>y+z) the leaf variable is 3 to usability of program fragments if, i.e. N=3.
Step 2.2: make up truth table,, have 2 to N leaf variable
NPlant permutation and combination; Like Fig. 5, the truth table of tested program fragment " if (x>y&&x>z || x>y+z) " has 8 kinds of array modes.
Step 2.3: fill truth table with numeral 0 and 1;
Step 2.4: be directed against each row in the truth table:
Step 2.4.1: each leaf variable of the Boolean correspondence in the truth table current line being distributed to the abstract analysis tree; In Fig. 5, fourth line A=0 in the truth table, B=1, C=1 distribute to the leaf variable of abstract analysis tree respectively with it.
Step 2.4.2: the Boolean of each condition node of bottom-up evaluation, up to the top of abstract analysis tree.The Boolean of the condition node on the top of the abstract analysis tree of final gained is exactly the output end value of this decision statement; Like Fig. 5, fifth line A=0 in the truth table, B=1, C=1, then A&&B is true, and A&&B||C is true, and therefore, finally being output as that this row is judged is true.
(3) output with output end value filling truth table is listed as.
Through above step, accomplish the foundation of the truth table of a certain given decision statement (tested program).Begin to extract test case then.Consider the characteristics of MC/DC,, need to seek two row that can embody leaf variable independent effect result of determination to each leaf variable.
Step 2.5: to each leaf variable, seek its test case, and the MC/DC test case of adding each leaf variable to is concentrated:
Step 2.5.1: the MC/DC test use cases of setting up a pair of sky for each leaf variable;
Step 2.5.2: in truth table, seek other leaf variate-values and fix, two row that have only target leaf variable to change; Like Fig. 5; When target leaf variable is A, get two fixing row of leaf variable B and C variate-value, desirable the third line and the 7th row; Wherein leaf variable B and C fix, and have only target leaf variables A to change;
The output end value (the output end value by each condition node is voluntarily formed) of step 2.5.3: two among comparison step 2.5.2 row; If the output end value of two row is different; Then this two row is exactly a pair of test case of target leaf variable; And this test case is effectively, because they have shown the influence of target leaf variable, adds this two row to set up in the step (1) MC/DC test case with paired form and concentrates.
Like Fig. 4, when target variable was A, the third line was (010), the 7th behavior (110); Can know that by truth table the third line is output as 0, the seven row and is output as 1; Compare the output valve of these two row, inequality, then (010) and (110) is exactly a pair of test case of variables A; And this test case is effectively, and paired form is added the test case of leaf variables A to and concentrated.Other leaf variablees are as target leaf variable, and the method for seeking its test case is identical as the finding method of target leaf variable with above-mentioned leaf variables A, and the MC/DC test case of adding each leaf variable to is concentrated.
Step 2.6: the MC/DC test use cases of each leaf variable is merged, obtain test use cases, and minimize test use cases.This test use cases just be to use genetic algorithm search the target set of uses case that will realize.
Like Fig. 4, the test use cases of leaf variables A, B, C is respectively (010,110), (100,110); (000,001,010,011; 100,101), minimize this test use cases, obtain (010; 100,110,101), this group test use cases satisfies the MC/DC test use cases covering requirement of each leaf variable.
Step 3: tested program is carried out the code pitching pile;
The program pitching pile is one of step of the automatic generative process of test data.In test process, obtaining and write down all of test result data accomplished through the program pitching pile.Main process is on the basis that keeps the original logic integrality of tested program, to insert inspect statement, when tested program is moved, and the operation characteristic data of the execution capture program through inspect statement.Analyze these characteristics, can obtain the multidate informations such as logic covering of program, and accomplish the calculating of individual fitness thus.Its detailed process such as Fig. 5, abstract syntax tree (AST) at first travels through the position that abstract syntax tree (AST) finds pitching pile after generating, and judges whether it is the pitching pile point, if not the pitching pile point, returns continuation traversal abstract syntax tree and finds the pitching pile position; If the pitching pile point is then implanted inspect statement (probe), then directly on abstract syntax tree with the syntax tree fragment of the form code implant of subtree, judge whether pitching pile is accomplished, as accomplishing, tested program compilation run then; As do not accomplish, return and continue the position that traversal abstract syntax tree (AST) finds pitching pile, until accomplishing pitching pile.
Step 4: structure fitness function;
Fitness function is unique interface of genetic algorithm and practical problems, is individual good and bad a kind of quantification reflection in the population, and its structure directly influences the efficient of problem solving.Traditional fitness function f (x) is made up of two parts:
f(x)=approachlevel+branchdistance
What the approachlevel of first embodied is the control dependence, is commonly called near level.Second portion branchdistance is called as branch's distance; It has overcome only uses the limitation that adapts to evaluation near level, and distance satisfies target or satisfies the approximation ratio that departs from branch on the basis of current input test data apart from having weighed in branch.
On this practical problems of generation of MC/DC test data, target of the present invention is finally to find the test data of the MC/DC that satisfies intended target.The present invention makes full use of the advantage of cascade synthesis aspect the characterization test data dependence relation; Use cascade synthesis thought to collect directly the perhaps Control Node of pass test data dependence remote effect conditions of problems node traversal; And traditional fitness function that itself and characterization control dependence are good at combines; Construct new fitness function, overcome traditional fitness function because of ignoring the problem that guidance information lacks, search is degenerated that the inner data dependence relation of program causes with this.
Specifically, the structure fitness function designs three aspects of fitness function from setting up control dependence fitness function, data dependence relation fitness and 3 factors of branching adaptation degree.
Step 4.1: set up control dependence fitness function
Step 4.1.1:, obtain the control dependence set of each judgement through the control flow graph of tested program; Control relies on and is used for describing the dependence of the execution of a destination node y about its front branch node output, when the path of each bar from destination node y to Egress node e all comprises node z, claims that node z is by the rearmounted control of destination node y; If x is an arbitrary node, two nodes (y can constitute an individual path between x), when each bar from destination node y to Egress node e pass through branch (y, when path x) all comprises node z, claim branch of the rearmounted control of node z (y, x); When the branch of the rearmounted control of node z y, and the not rearmounted control of z y, claim that then node z control depends on destination node y.The control dependence is to weigh the approximation ratio that current input test data distance arrives at target from the structural relation angle, and it is to depart from the internodal key node of condition through target and execution in the control flow graph to calculate.
Control flow graph like certain tested program fragment is as shown in Figure 6.As can be seen from the figure; The judgement that the judgement of the 16th row depends on the 12nd row is got true judgement with the 13rd row and is got vacation; Think that thus the target discrimination of 16 row depends on the control stream through 12,13 row, these nodes are called as critical branch, and stream flows to or wide because they determine control.Therefore, the control dependence collection that the 16th row is judged comprises the judgement of the 12nd, 13 row, that is to say, for reaching destination node, must carry out these branch nodes successively, and the output of these nodes must be specific.Can controlled dependence collection ControlDep (16)={ 12 ,-13}, positive number represent that needs carry out true branch, and negative number representation need be carried out false ramification.
Step 4.1.2: set up control dependence fitness function.
After setting up the set of control dependence, which test case the search judgement has carried out maximum Control Node numbers, and for example among Fig. 6, a test data that departs from 13 row more approaches target than a test data that departs from 12 row.At this moment just need an evaluation function to be used for judging that which test data can make execution stream more approach target, so just set up control dependence fitness function.
Control dependence fitness function has comprised the objective function of each branch node in the set of control dependence.Setting up control dependence fitness function is shown below.
Wherein, dependent
DecisionBe the Control Node number in the control dependence set of target; Executed
DecisionsExpression is input with current test data; ControlDepFit
TestdataExpression control dependence fitness function.
If control dependence fitness function value is 0, explain that then test data can arrive target discrimination; If control dependence fitness function value is greater than 0; Just explain that test data has departed from destination node somewhere; Can be through the value of control dependence fitness function, accurately obtaining is that which Control Node before target discrimination departs from away, claims that this point is for departing from node diverged
NodeWith Fig. 6 is example, and certain input data makes to carry out to flow at 12 row and departs from, and it is 2-0=2 that control dependence fitness function value is then arranged; If but carry out true branch at 12 row, and depart from 13 row, control dependence fitness function value so and just be 2-1=1.Like this, based on test data separately with respect to target discrimination near level, just can distinguish it, and with search for boot to the most approaching test data.
Step 4.2: set up the data dependence relation fitness function
Calculating on the dependence of the present invention focusing on through inserting the guiding that control dependence and data dependence relation improve to be provided to search by near horizontal fitness.This expansion near level has been comprised data dependence relation, with the search for boot of search to region of search more likely.The present invention is intended to overcome the problem of using the guiding that exists when between flag variable or code predicate strong data dependence relation being arranged to lack peaceful faceted search in the predicate.
It is following to obtain data dependence relation fitness function method step:
Definition pn is the problem node, and S is the set that is used for storing the dependence of a given node, with pn and S as the input of obtaining data dependence relation fitness function method.DepSets is used for storing the current node set of collecting that has dependence, and PV is used for the variable that the storage problem node uses.S and DepSets are initialized to empty set.The method of dependence fitness function of obtaining a node S is following:
Step 4.2.1: the control dependence set ControlDep (pn) that obtains problem node pn composes and gives S, and the variable UsedVariables (pn) that pn is used is added among the PV;
Step 4.2.2:, obtain the last definition set lastDefs of pv for each the variable pv among the PV;
(a) for each last definition ld among the lastDefs, obtain the control dependence set ControlDep (ld) of ld, and itself and S are merged, the S that is expanded, the variable UsedVariables (ld) that then ld is used adds among the newly-built PVnew;
(b), obtain the variable UsedVariables (Id) that it uses, and add in the PVnew set of setting up in the step (a) for each the Control Node cd among the ControlDep (ld).
Step 4.2.3: for each the variable pv among the PV, iteration is obtained PV dependence collection S (ld).At first obtain first variable among the PV, obtain its dependence collection S (ld), return step 4.2.2, obtain the next variable among the PV then, all variablees in accomplishing PV, finishing iteration, and S (ld) added among the DepSets.
Step 4.2.4: set up a dependence set that is used to define fitness function:
Definition DepFit is for the set of fitness function dependence, for each the subclass s among the DepSets
i:
(a) add s
iIn DepFit;
(b) judge each non-s among the DepSets
iSubclass s
j, with s
iThe branch interference that whether has then, else is not if exist then merge two sub-set s
i, s
j, obtain new subclass S
I, j, and with S
I, jAdd among the DepFit; If have the branch interference of then, else then can not merge, with s
i, s
jAll add among the DepFit.
Step 4.2.5: set up the data dependence relation fitness function
After setting up data dependence relation set, obtain the data dependence relation fitness function with the method for calculation control dependence fitness function, its computing method are identical with the method for calculation control dependence fitness function.
Step 4.3: Branch Computed distance
When test data arrives at target, measure test data with branch's distance and whether satisfy test case, promptly through the approximation ratio of Branch Computed distance metric test data apart from the expectation test case.If test data arrives target discrimination, but does not satisfy any MC/DC test case, each test data all is 0 near level so, but branch's distance is not 0; If test is arrived at target and is realized a test case, its branch's distance and all be 0 so near level; Which test data is the size of branch's distance of calculating be used for estimating and more approach the branch testing use-case that meets the expectation.
The branch of a judgement is calculated apart from the structure that is based on this judgement:
(1) if contain the a==b expression formula in the structure of judging, when a==b is a true time, the computing formula of branch's distance is abs (a-b); Is the computing formula of branch's distance a==b when a==b is a fictitious time? K:0;
(2) if contain a ≠ b expression formula in the structure of judging, when a ≠ b is a true time, the computing formula of branch's distance be a!=b? K:0; When a ≠ b is a fictitious time, the computing formula of branch's distance be a!=b? Abs (a-b): 0;
Is (3) when a<b is a true time, the computing formula of branch's distance a<b if contain a<b expression formula in the structure of judging? 0:a-b+k; Is the computing formula of branch's distance a<b when a<b is a fictitious time? A-b+k:0;
Is (4) when a<=b is a true time, the computing formula of branch's distance a<=b if contain a<=b expression formula in the structure of judging? 0:a-b; Is the computing formula of branch's distance a<=b when a<=b is a fictitious time? A-b+k:0;
Is (5) when a>b is a true time, the computing formula of branch's distance a>b if contain a>b expression formula in the structure of judging? 0:a-b; Is the computing formula of branch's distance a>b when a>b is a fictitious time? A-b+k:0;
Is (6) when a>=b is a true time, the computing formula of branch's distance a>=b if contain a>=b expression formula in the structure of judging? 0:a-b; Is the computing formula of branch's distance a>=b when a>=b is a fictitious time? A-b+k:0;
(7) if contain the a||b expression formula in the structure of judging, when a||b is a true time, the computing formula of branch's distance is min [fit (a), fit (b)]; When a||b is a fictitious time, the computing formula of branch's distance is fit (a)+fit (b);
(8) if contain the a&&b expression formula in the structure of judging, when a&&b is a true time, the computing formula of branch's distance is fit (a)+fit (b); When a&&b is a fictitious time, the computing formula of branch's distance is max [fit (a), fit (b)];
When attempting reaching test case, need relatively approach to accomplish the approximation ratio of the test data of test case, rather than test data itself, so branch apart from often be one on the occasion of.When attempting reaching test case, relatively approach to accomplish the approximation ratio of the test data of test case, rather than test data itself.Therefore, the functional value of a negative adaptation increases any valuable information can for search, so return the absolute value of a functional value.Total branch distance adds up for branch's distance of each condition in judging.
Step 5: on the basis of effective MC/DC test case, fitness function formula and execution pitching pile code; Produce test data at random; And the tested program after carrying out pitching pile on these test datas; Obtain fitness value, whether check simultaneously satisfies the destination path (referring to promptly whether test data arrives target) that expection is carried out; If then get into step 7; Otherwise entering step 6;
Calculate near horizontal fitness function ApproachLevelFitness, if ApproachLevelFitness is 0, then test data arrives target; At the target discrimination place, Branch Computed is apart from BranchFitness then.If ApproachLevelFitness and BranchFitness are 0, then test data reaches the MC/DC test target.Otherwise the fitness function value of test data equals ApproachLevelFitness+normalized (BranchFitness), and normalized (BranchFitness) representes that its value is between 0 to 1 to the standardization of branch apart from BranchFitness.Concrete computation process comprises following step:
Step 5.1: the method according to step 2 generates MC/DC test case expected results collection;
Step 5.2: the method according to step 4.1 and step 4.2 obtains the dependence set, comprises that control relies on collection and data rely on collection;
Step 5.3:, generate 2 test data T at random to each target discrimination
aAnd T
b
Step 5.4: according to the computing method in the step 4.1, according to the dependence set, the control of calculating 2 test datas respectively relies on fitness function and data dependence fitness function;
Step 5.5:, calculate branch's distance of 2 test datas respectively according to the computing method in the step 4.3;
Step 5.6: the standardization BranchFitness (T that carries out branch's distance
a)
Normalised, computing formula is:
BranchFitness (T
a) expression test data T
aBranch's distance, BranchFitness (T
b) expression test data T
bBranch's distance;
Step 5.7: total fitness function value Fitness (T) is:
Fitness(T)=ApproachLevelFitness(T)+BranchFitness(T)
normalized
Wherein, the approaching horizontal fitness function of ApproachLevelFitness (T) expression test data T; BranchFitness (T)
NormalizedThe standardized value of branch's distance of expression test data T.
Step 5.8: which more approaches to reach the judgement target according to these two test datas of total fitness function value comparison.
Step 5.9:
If ApproachLevelFitness and BranchFitness are 0, then test data reaches the MC/DC test target, gets into step 7, otherwise, get into step 6;
Whether also should judge whether to get into step 6 or seven step after this step to a step 5.9 should be arranged? Like this could be consistent with top statement!
Be that example is introduced obtaining of fitness function value still below with the tested program fragment among Fig. 6.Hypothetical target is the 16th row.Early stage is movable:
(2) the MC/DC test case of extraction the 16th row target discrimination from MC/DC test case generation module: { (010), (110), (100), (011.For example, our plan reaches test case (010).
Calculate:
When supposing operation now, test data generating is that parameter x, y, z are exported two groups of test datas: (12 ,-2,3) and (1,2,0).Whether satisfied for differentiating perhaps near satisfying test case (010), assess the fitness function of each test data respectively.
(1)T1=(12,-2,3)
Target is to pass the false ramification that 4 row are judged, therefore has:
ApproachLevelFitness(T1,16)=Count({2,3,-4,8,12,-13}-{2,3,4})
=Count({-4,8,12,-13})=4
BranchFitness(T1,-4)=(Fit(x>0)+Fit(x>0)+Fit(x>0))T1=0+2+0=2
(2)T2=(1,2,0)
Target is to pass the false ramification that the 13rd row is judged, provides the false ramification formula.We select k=0.1.
BranchFitness(T2,-13)=(Fit(z=0))
T2=k=0.1
(3) branching adaptation standardization:
(4) comparison of test data:
Fitness(T,d)=ApproachLevelFitness(T,d)+BranchFitness(T)
normalized
Fitness(T1,16)=4+0.9=4.9
Fitness(T2,16)=1+0.045=1.045
Obtain T2 by contrast and more approach to reach the judgement target.
Step 6: according to the fitness value that obtains, genetic manipulations such as the selection of use genetic algorithm, intersection, variation generate new test data, and return step 5, calculate the fitness value of newly-generated test data.
The term of biological evolution with the term corresponding relation of software test case generative process is in the genetic algorithm: chromosome: each test data in the genetic algorithm, and the chromosome that has characteristic is also claimed individuality; Population: the set of the test data that generates at random; Evolve: use genetic algorithm to generate new test data process from old test data iteration; Coding: with chromosome is the process of the character that can operate of computing machine by certain rule encoding.
Genetic algorithm is to estimate foundation with the parameter space of space encoder replacement problem with the fitness function, serves as the basis of evolving with coding colony; So that the genetic manipulation of individual in population bit string is realized selecting and genetic mechanism; Set up an iterative process, specifically comprise following step, as shown in Figure 7.
Step 6.1: select coding strategy, convert parameter sets X and territory into bit string structure space s;
In test data generation problem automatically, chromosomal each gene of genetic algorithm possibly belong to different test data types.Therefore, the mode that adopts integer and full mold to mix the in the present invention chromosome of encoding, the parameter of problem directly converts the gene on the chromosome into, and the number of parameter converts chromosome length into, and each values of parameters interval is mapped as the span of each gene.This just shows that also separating of chromosome and problem has identical space.Detailed process is following:
If the problem of finding the solution comprises n input variable X
1, X
2..., X
n, at first, with the codomain of equivalence class division and boundary value analysis method processing parameter, wherein Y
i(the expression of 1≤i≤n) parameter X
i(set of the Finite Discrete point that 1≤i≤n) can value, | Y
i| the size of expression set.Set up the mapping relations in problem solution space and chromosome space, chromosome is expressed as:
X=(X
1,X
2,...,X
n)→C=(C
1,C
2,...,C
n)(2)
Wherein, C is separating in the chromosome Space Solution space, and X is separating of problem space.
Step 6.2: design and selection genetic manipulation comprise the population size, selection, intersection, variation method, and definite crossover probability p
cWith the variation Probability p
mEtc. genetic parameter;
Step 6.2.1: carry out sequencing selection strategy and elite's retention strategy:
Elite's retention strategy can guarantee to intersect, mutation operation can not destroy resulting up to now best individuality, effectively improves speed of convergence, and it is the strong prerequisite that guarantees genetic algorithm converges property.On the other hand, though its result of calculation is better, generally be difficult to obtain optimum solution.The mode that the present invention adopts sequencing selection and elite's retention strategy to combine is duplicated population, before taking elite's retention strategy, adopts the sequencing selection strategy earlier, is used to select that suitable individuality intersects, mutation operation.
The detailed process of wherein carrying out the sequencing selection strategy is: based on the size of fitness function value, by all individualities in ascending order or the descending population, then individual selected probability distributes on the basis of ascending order or descending sort, is specially:
(a) based on the size of adaptive value, descending or ascending order are arranged all individualities in the population;
(b) estimate by design allocation table, based on the adaptive value size, ascending order is distributed each individual probable value, and promptly in table, each individual fitness value is by big extremely little, and probable value is by little extremely big;
(c) each individual by heredity to follow-on probability by the probable value decision that distributes in the step (b), again based on these probable values, the chromosome that is eliminated and is replicated with the selection of roulette back-and-forth method.
Through one take turns the ordering selection strategy after, can obtain a new population, on this new population basis, carry out elite's retention strategy more then.
The detailed process of carrying out elite's retention strategy is:
(a) according to the size of fitness function value from through obtaining optimized individual and the poorest individuality the new population (being called " current population ") that obtains behind the sequencing selection strategy;
(b), then replace the optimized individual that occurs before this with the optimized individual of current colony if the fitness of the optimized individual of current population is higher than the fitness of the optimized individual of the appearance that obtains before this;
(c) keep the optimized individual state of appearance so far constant, the heredity that it is complete is in population of future generation.
Through these two kinds of strategies population is duplicated, form final population.
Step 6.2.2: interlace operation and mutation operation
Based on Srinivas thought, adopt adaptive crossover probability p
cWith the variation Probability p
m, come adjustment crossover probability p automatically according to average adaptive value of colony and current colony optimum individual adaptive value
cWith the variation Probability p
m
f
MaxThe fitness of representing optimum individual in certain generation population, F
AvgThe average fitness of representing this colony in generation, the fitness of optimum individual and this in generation colony the difference DELTA=f of average fitness
Max-F
Avg, then when Δ more little, the fitness difference between the expression population individuality is more little, it is bigger to explain that population reaches the possibility of local optimum at this moment, the possibility of premature convergence is also big more; When Δ is big more, represent that the fitness difference between the individuality is big more.Therefore, crossover probability p
cWith the variation Probability p
mCan decide by Δ.For making p
cAnd p
mIn the process of evolving, can when population is tending towards restraining, improve p according to its value of actual conditions adjustment of population
cAnd p
m, increase the frequency of intersecting and making a variation, destroy current stability, make genetic algorithm have stronger detectivity, overcome premature convergence; Otherwise, when the population individuality is dispersed, reduce and intersect and variation frequency, increase development ability, make individuality be tending towards convergence.p
cAnd p
mComputing formula be:
p
c=k
1/Δ(3)
p
m=k
2/Δ(4)
Wherein, k
1And k
2Be respectively crossover probability adjustment coefficient and variation probability adjustment coefficient.For avoiding k
1And k
2Value is improper, has designed to intersect and variation correction probability: as crossover probability p
cProofread and correct the k of the value of going up greater than crossover probability
C1The time, with k
C1Value give p
c, as crossover probability p
cProofread and correct value k down less than crossover probability
C2The time, with k
C2Value give p
c, when the variation Probability p
mGreater than being worth k on the variation probability correlation
M1The time, with k
M1Value give p
m, when the variation Probability p
mLess than being worth k on the variation probability correlation
M2The time, with k
M2Value give p
n
Step 6.3. random initializtion generates population P;
Step 6.4. calculates the decoded fitness value of individual bit string among the population P;
Step 6.5. acts on population according to hereditary strategy with each genetic manipulation that designs in the step 6.2, after selection, intersection and variation, has formed population of new generation;
Step 6.6. returns step 5 with the new chromosome (being test data) that produces, and calculates its fitness value, judges whether its performance satisfies index; Perhaps whether accomplished predetermined iterations; As if not satisfying and not accomplishing iterations, then get into step 6.1, genetic algorithm begins from encoding operation; The population of new generation is selected to duplicate, intersect and make a variation again, constantly iteration; Then directly get into step 7 if satisfy index or accomplished iterations.
Step 7: end of run obtains suitable test data.
Claims (1)
1. MC/DC automatic generation of test data based on genetic algorithm is characterized in that: comprise following step:
Step 1: tested program is carried out static analysis, produce control flow graph, DFD, abstract syntax tree and abstract analysis tree;
Step 2: generate MC/DC test case expected results collection;
Step 2.1: the node of from abstract analysis tree, offering, these condition nodes have constituted the leaf of abstract analysis tree, and each leaf is exactly a variable, the number of the leaf variable of representing with N to extract;
Step 2.2: make up truth table,, have 2 to N leaf variable
NPlant permutation and combination;
Step 2.3: fill truth table with numeral 0 and 1;
Step 2.4: be directed against each row in the truth table:
Step 2.4.1: each leaf variable of the Boolean correspondence in the truth table current line being distributed to the abstract analysis tree;
Step 2.4.2: the Boolean of each condition node of bottom-up evaluation, up to the top of abstract analysis tree, the Boolean of the condition node on the top of the abstract analysis of final gained tree is exactly the output end value of this decision statement;
Step 2.4.3: the output row of filling truth table with the output end value;
Step 2.5: to each leaf variable, seek its test case, and the MC/DC test case of adding each leaf variable to is concentrated:
Step 2.5.1: the MC/DC test use cases of setting up a pair of sky for each leaf variable;
Step 2.5.2: in truth table, seek other leaf variate-values and fix, two row that have only target leaf variable to change;
The output end value of step 2.5.3: two among comparison step 2.5.2 row; If the output end value of two row is different; Then this two row is exactly a pair of test case of target leaf variable, adds this two row to set up among the step 2.5.1 MC/DC test case with paired form and concentrates;
Step 2.6: the MC/DC test use cases of each leaf variable is merged, obtain test use cases, and minimize test use cases;
Step 3: tested program is carried out the code pitching pile;
At first travel through abstract syntax tree and find the position of pitching pile, judge whether it is the pitching pile point,, return and continue the traversal abstract syntax tree and find the pitching pile position if not the pitching pile point; If the pitching pile point is then implanted inspect statement, then directly on abstract syntax tree with the syntax tree fragment of the form code implant of subtree, judge whether pitching pile is accomplished, as accomplishing, tested program compilation run then; As do not accomplish, return and continue the position that the traversal abstract syntax tree finds pitching pile, until accomplishing pitching pile;
Step 4: structure fitness function;
Step 4.1: set up control dependence fitness function:
Step 4.1.1:, obtain the control dependence set of each judgement through the control flow graph of tested program; Control relies on and is used for describing the dependence of the execution of a destination node y about its front branch node output, when the path of each bar from destination node y to Egress node e all comprises node z, claims that node z is by the rearmounted control of destination node y; Arbitrary node x, two nodes (y can constitute an individual path between x), when each bar passing through from destination node y to Egress node e (y, when x) individual path all comprises node z, claim branch of the rearmounted control of node z (y, x); A branch as the rearmounted control of node z y; And the not rearmounted Control Node y of node z; Claim that node z control depends on destination node y; The control dependence is to weigh the approximation ratio that current input test data distance arrives at target from the structural relation angle, departs from the internodal key node of condition through target and execution in the control flow graph and calculates;
Step 4.1.2: set up control dependence fitness function:
Control dependence fitness function has comprised the objective function of each branch node in the set of control dependence, sets up control dependence fitness function to be:
Wherein, dependent
DecisionBe the Control Node number in the control dependence set of target; Executed
DecisionsExpression is input with current test data; ControlDepFit
TestdataExpression control dependence fitness function;
If control dependence fitness function value is 0, then test data can arrive target discrimination; If control dependence fitness function value is greater than 0, then test data has departed from destination node somewhere, and the value through control dependence fitness function obtains departing from node diverged
Node
Step 4.2: set up the data dependence relation fitness function:
Definition pn is the problem node; S is the set that is used for storing the dependence of a given node; As the input of obtaining data dependence relation fitness function method, DepSets is used for storing the current node set of collecting that has dependence with pn and S, and PV is used for the variable that the storage problem node uses; S and DepSets are initialized to empty set, and the method for obtaining the dependence fitness function of a node S is:
Step 4.2.1: the control dependence set ControlDep (pn) that obtains problem node pn composes and gives S, and the variable UsedVariables (pn) that pn is used is added among the PV;
Step 4.2.2:, obtain the last definition set lastDefe of pv for each the variable pv among the PV;
(a) for each last definition ld among the lastDefs, obtain the control dependence set ControlDep (ld) of ld, and itself and S are merged, the S that is expanded, the variable UsedVariables (ld) that then ld is used adds among the newly-built PVnew;
(b), obtain the variable UsedVariables (ld) that it uses, and add in the PVnew set of step 4.2.2 (a) foundation for each the Control Node cd among the ControlDep (ld);
Step 4.2.3: for each the variable pv among the PV, iteration is obtained PV dependence collection S (ld), at first obtains first variable among the PV; Obtain its dependence collection S (ld); Return step 4.2.2, obtain the next variable among the PV then, all variablees in accomplishing PV; Finishing iteration, and S (ld) added among the DepSets;
Step 4.2.4: set up the dependence set that is used to define fitness function:
Definition DepFit is for the set of fitness function dependence, for each the subclass s among the DepSets
i:
(a) add s
iIn DepFit;
(b) judge each non-s among the DepSets
iSubclass s
j, with s
iWhether there is the branch interference of then, else,, then merges two sub-set s if do not exist
i, s
j, obtain new subclass S
I, j, and with S
I, jAdd among the DepFit; If have the branch interference of then, else then can not merge, with s
i, s
jAll add among the DepFit;
Step 4.2.5: set up the data dependence relation fitness function:
After setting up data dependence relation set, obtain the data dependence relation fitness function with the method for calculation control dependence fitness function;
Step 4.3: set up branching adaptation degree function:
When test data arrives at target; Measure the test data test case that whether meets the expectation with branch distance; Through the approximation ratio of Branch Computed distance metric test data,, but do not satisfy any MC/DC test case if test data arrives target discrimination apart from the expectation test case; Each test data all is 0 near level so, but branch's distance is not 0; If test is arrived at target and is realized a test case, its branch's distance and all be 0 so near level; Which test data is the size of branch's distance of calculating be used for estimating and more approach the branch testing use-case that meets the expectation;
Step 5: on the basis of MC/DC test case, fitness function formula and execution pitching pile code; Produce test data at random; And the tested program after carrying out pitching pile on these test datas, obtain fitness value, whether check simultaneously satisfies the path that expection is carried out; If satisfy, then get into step 7; Otherwise entering step 6;
Calculate near horizontal fitness function ApproachLevelFitness, if ApproachLevelFitness is 0, then test data arrives target; Then at the target discrimination place; Branch Computed is apart from BranchFitness, if ApproachLevelFitness and BranchFitness are 0, then test data reaches the MC/DC test target; Otherwise; The fitness function value of test data equals ApproachLevelFitness+normalized (BranchFitness), and normalized (BranchFitness) representes that concrete computation process is to the standardization of branch apart from BranchFitness:
Step 5.1: the method according to step 2 generates MC/DC test case expected results collection;
Step 5.2: the method according to step 4.1 and step 4.2 obtains the dependence set, comprises that control relies on collection and data rely on collection;
Step 5.3:, generate test data T at random to each target discrimination
aWith test data T
b
Step 5.4:,, calculate test data T respectively according to the dependence set according to the computing method in the step 4.1
aWith test data T
bControl rely on fitness function and data dependence fitness function;
Step 5.5:, calculate test data T respectively according to the computing method in the step 4.3
aWith test data T
bBranch's distance;
Step 5.6: the standardization BranchFitness (T that carries out branch's distance
a)
Normalised, computing formula is:
Wherein, BranchFitness (T
a) expression test data T
aBranch's distance, BranchFitness (T
b) expression test data T
bBranch's distance;
Step 5.7: total fitness function value Fitness (T) is:
Fitness(T)=ApproachLevelFitness(T)+BranchFitness(T)
normalized
Wherein, the approaching horizontal fitness function of ApproachLevelFitness (T) expression test data T; BranchFitness (T)
NormalizedThe standardized value of branch's distance of expression test data T;
Step 5.8: which more approaches to reach the judgement target according to these two test datas of total fitness function value comparison;
Step 5.9:
If ApproachLevelFitness and BranchFitness are 0, then test data reaches the MC/DC test target, gets into step 7, otherwise, get into step 6;
Step 6: according to the fitness value that obtains, genetic manipulations such as the selection of use genetic algorithm, intersection, variation generate new test data, and return step 5, calculate the fitness value of newly-generated test data;
Step 6.1: select coding strategy, convert parameter sets X and territory into bit string structure space s;
Adopt the integer and the mode of the full mold mixing chromosome of encoding, the parameter of problem directly converts the gene on the chromosome into, and the number of parameter converts chromosome length into, and each values of parameters interval is mapped as the span of each gene, and detailed process is following:
If the problem of finding the solution comprises n input variable X
1, X
2..., X
n, at first, with the codomain of equivalence class division and boundary value analysis method processing parameter, wherein Y
i(the expression of 1≤i≤n) parameter X
i(set of the Finite Discrete point that 1≤i≤n) can value, | Y
i| represent the size of set, set up the mapping relations in problem solution space and chromosome space, chromosome is expressed as:
X=(X
1,X
2,...,X
n)→C=(C
1,C
2,...,C
n)(2)
Wherein, C is separating in the chromosome Space Solution space, and X is separating of problem space;
Step 6.2: design and selection genetic manipulation comprise the population size, selection, intersection, variation method, and definite crossover probability p
cWith the variation Probability p
mEtc. genetic parameter;
Step 6.2.1: carry out sequencing selection strategy and elite's retention strategy:
The detailed process of carrying out the sequencing selection strategy is:
(a) according to the size of adaptive value, all individualities in the descending sort population;
(b) estimate by design allocation table, according to the adaptive value size, ascending order is distributed each individual probable value;
(c) each individual by heredity to follow-on probability by the probable value decision that distributes in the step (b), again based on these probable values, the chromosome that is eliminated and is replicated with the selection of roulette back-and-forth method; Through one take turns the ordering selection strategy after, can obtain a new population, on this new population basis, carry out elite's retention strategy more then, detailed process is:
(a) based on the size of fitness function value from being to obtain optimized individual and the poorest individuality the current population through the new population that obtains behind the sequencing selection strategy;
(b), then replace the optimized individual that occurs before this with the optimized individual of current colony if the fitness of the optimized individual of current population is higher than the fitness of the optimized individual of the appearance that obtains before this;
(c) keep the optimized individual state of appearance so far constant, the heredity that it is complete is in population of future generation;
Step 6.2.2: interlace operation and mutation operation
Adopt adaptive crossover probability p
cWith the variation Probability p
m, come adjustment crossover probability p automatically according to average adaptive value of colony and current colony optimum individual adaptive value
cWith the variation Probability p
mf
MaxThe fitness of representing optimum individual in certain generation population, F
AvgThe average fitness of representing this colony in generation, the fitness of optimum individual and this in generation colony the difference DELTA=f of average fitness
Max-f
Avg, then when Δ more little, the fitness difference between the expression population individuality is more little, it is bigger to explain that population reaches the possibility of local optimum at this moment, the possibility of premature convergence is also big more; When Δ is big more, represent that the fitness difference between the individuality is big more, crossover probability p
cWith the variation Probability p
mDecide p by Δ
cAnd p
mComputing formula be:
p
c=k
1/Δ(3)
p
m=k
2/Δ(4)
Wherein, k
1And k
2Be respectively crossover probability adjustment coefficient and variation probability adjustment coefficient;
Step 6.3: random initializtion generates population P;
Step 6.4: calculate the decoded fitness value of individual bit string among the population P;
Step 6.5: according to hereditary strategy, each genetic manipulation that designs in the step 6.2 is acted on population, after selection, intersection and variation, formed population of new generation;
Step 6.6: with the new chromosome that produces is that test data is returned step 5, calculates its fitness value, judges whether its performance satisfies index; Perhaps whether accomplished predetermined iterations; As if not satisfying and not accomplishing iterations, then get into step 6.1, genetic algorithm begins from encoding operation; The population of new generation is selected to duplicate, intersect and make a variation again, constantly iteration; Then directly get into step 7 if satisfy index or accomplished iterations;
Step 7: end of run obtains suitable test data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110265194.4A CN102323906B (en) | 2011-09-08 | 2011-09-08 | MC/DC test data automatic generation method based on genetic algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110265194.4A CN102323906B (en) | 2011-09-08 | 2011-09-08 | MC/DC test data automatic generation method based on genetic algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102323906A true CN102323906A (en) | 2012-01-18 |
CN102323906B CN102323906B (en) | 2014-01-08 |
Family
ID=45451651
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110265194.4A Expired - Fee Related CN102323906B (en) | 2011-09-08 | 2011-09-08 | MC/DC test data automatic generation method based on genetic algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102323906B (en) |
Cited By (46)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102622558A (en) * | 2012-03-01 | 2012-08-01 | 北京邮电大学 | Excavating device and excavating method of binary system program loopholes |
CN102708047A (en) * | 2012-04-23 | 2012-10-03 | 福建师范大学 | Data flow test case generating method |
CN103218297A (en) * | 2013-05-15 | 2013-07-24 | 百度在线网络技术(北京)有限公司 | Screening method and device of test data |
CN103246597A (en) * | 2012-02-07 | 2013-08-14 | 腾讯科技(深圳)有限公司 | Parameter testing method and device |
CN103559129A (en) * | 2013-10-31 | 2014-02-05 | 中国矿业大学 | Statistical regression test data generation method based on genetic algorithm |
CN103593287A (en) * | 2013-10-30 | 2014-02-19 | 北京信息控制研究所 | Genetic-algorithm-based method for automatically generating data stream test cases |
CN103729297A (en) * | 2013-12-31 | 2014-04-16 | 北京理工大学 | Test case generation method based on hierarchic genetic algorithm |
CN103810104A (en) * | 2014-03-04 | 2014-05-21 | 中国人民解放军63863部队 | Method and system for optimizing software test case |
CN104142819A (en) * | 2013-07-10 | 2014-11-12 | 腾讯科技(深圳)有限公司 | File processing method and device |
WO2014180107A1 (en) * | 2013-05-08 | 2014-11-13 | 南京大学 | Test-based static analysis false positive elimination method |
CN104536877A (en) * | 2014-11-28 | 2015-04-22 | 江苏苏测软件检测技术有限公司 | Mixed strategy based test data generation method |
JP2015142934A (en) * | 2014-01-31 | 2015-08-06 | Jfeスチール株式会社 | Slab organization method including profiled steel sheet and slab organization device |
CN105260317A (en) * | 2015-11-19 | 2016-01-20 | 上海斐讯数据通信技术有限公司 | Test case selection method |
CN105607989A (en) * | 2014-11-18 | 2016-05-25 | 阿里巴巴集团控股有限公司 | Sampling method and system of software test data |
CN107103213A (en) * | 2017-03-23 | 2017-08-29 | 中国航天系统科学与工程研究院 | A kind of software code based on genetic algorithm obscures operation system of selection |
CN107229565A (en) * | 2017-05-31 | 2017-10-03 | 北京京东尚科信息技术有限公司 | Method of testing and device |
US9792204B2 (en) | 2016-02-02 | 2017-10-17 | General Electric Company | System and method for coverage-based automated test case augmentation for design models |
CN107748721A (en) * | 2017-11-27 | 2018-03-02 | 中国航空无线电电子研究所 | A kind of test use cases automatic generation method |
CN108171413A (en) * | 2017-12-26 | 2018-06-15 | 杭州电子科技大学 | A kind of chemical industrial park emergency resources method for optimizing configuration |
CN108304625A (en) * | 2018-01-15 | 2018-07-20 | 北京航空航天大学 | Artificial intelligence program person writes the genetic programming decision-making technique of digital aircraft code |
CN108399127A (en) * | 2018-02-09 | 2018-08-14 | 中国矿业大学 | A kind of integrated method for creating test sequence of class |
CN108536606A (en) * | 2018-04-22 | 2018-09-14 | 北京化工大学 | A kind of EFSM test methods based on complex dependence relationship coverage criterion |
CN108647146A (en) * | 2018-05-11 | 2018-10-12 | 北京信息科技大学 | The method for generating test case of combined covering is judged based on correction conditions |
CN108710575A (en) * | 2018-05-23 | 2018-10-26 | 华南理工大学 | Unit test method based on automatic generation of path coverage test case |
CN108716953A (en) * | 2018-06-15 | 2018-10-30 | 哈尔滨工程大学 | A kind of contactless sea surface temperature measuring device field performance appraisal procedure of boat-carrying |
CN109376075A (en) * | 2018-09-19 | 2019-02-22 | 北京奇安信科技有限公司 | A kind of processing method and processing device generating the optimal Test coverage path of test object |
CN109669436A (en) * | 2018-12-06 | 2019-04-23 | 广州小鹏汽车科技有限公司 | A kind of method for generating test case and device of the functional requirement based on electric car |
CN109902007A (en) * | 2019-02-21 | 2019-06-18 | 南京信息工程大学 | It is a kind of based on the method for generating test case for polishing color model |
CN109901987A (en) * | 2017-12-11 | 2019-06-18 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus generating test data |
CN109918304A (en) * | 2019-03-06 | 2019-06-21 | 牡丹江师范学院 | A kind of quickly high path coverage method for generating test case |
CN109977030A (en) * | 2019-04-26 | 2019-07-05 | 北京信息科技大学 | A kind of test method and equipment of depth random forest program |
CN110879778A (en) * | 2019-10-14 | 2020-03-13 | 杭州电子科技大学 | Novel dynamic feedback and improved patch evaluation software automatic restoration method |
GB2577102A (en) * | 2018-09-14 | 2020-03-18 | Advanced Risc Mach Ltd | Generation of code coverage information during testing of a code sequence |
CN111144540A (en) * | 2019-12-05 | 2020-05-12 | 国网山东省电力公司电力科学研究院 | Generation method of anti-electricity-stealing simulation data set |
CN111221741A (en) * | 2020-01-17 | 2020-06-02 | 北京工业大学 | Method for automatically generating abnormal unit test based on genetic algorithm and log analysis |
CN112216341A (en) * | 2020-09-16 | 2021-01-12 | 中国人民解放军国防科技大学 | Group behavior logic optimization method and computer readable storage medium |
CN112463629A (en) * | 2020-12-11 | 2021-03-09 | 北京航空航天大学 | Method for adjusting software configuration items of autonomous unmanned system based on genetic evolution |
CN113672503A (en) * | 2021-08-03 | 2021-11-19 | 中移(杭州)信息技术有限公司 | Test case generation method, system, terminal device and storage medium |
CN113778876A (en) * | 2021-09-09 | 2021-12-10 | 南京大学 | Method and device for generating program variation of source code level |
CN114282261A (en) * | 2021-12-10 | 2022-04-05 | 天津大学 | Fine-grained privacy policy and mobile application behavior consistency checking method |
CN115617700A (en) * | 2022-12-19 | 2023-01-17 | 华东交通大学 | Test case design and generation method and system based on relational analysis |
CN116383070A (en) * | 2023-04-07 | 2023-07-04 | 南京航空航天大学 | Symbol execution method for high MC/DC |
CN116578498A (en) * | 2023-07-12 | 2023-08-11 | 西南交通大学 | Automatic generation method and system for unit test cases |
CN116775499A (en) * | 2023-08-21 | 2023-09-19 | 中国电信股份有限公司 | Test data generation method, device, computer equipment and storage medium |
US11803462B1 (en) | 2022-04-27 | 2023-10-31 | Agora Lab, Inc. | System and method for automatically generating test cases for testing SDKS |
CN117349837A (en) * | 2023-09-28 | 2024-01-05 | 广西卓梵智能科技有限公司 | IAST-based quick positioning detection method and system for stain data |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002099890A (en) * | 2000-09-26 | 2002-04-05 | Zexel Valeo Climate Control Corp | Automatic forming method of program and automatic forming device of program |
WO2009017231A2 (en) * | 2007-08-02 | 2009-02-05 | Nec Corporation | Pattern examination system, pattern examination device, method, and pattern examination program |
CN101710305A (en) * | 2009-12-14 | 2010-05-19 | 中国科学院计算技术研究所 | Method and system for realizing white box testing of computer software |
CN102073589A (en) * | 2010-12-29 | 2011-05-25 | 北京邮电大学 | Code static analysis-based data race detecting method and system thereof |
-
2011
- 2011-09-08 CN CN201110265194.4A patent/CN102323906B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002099890A (en) * | 2000-09-26 | 2002-04-05 | Zexel Valeo Climate Control Corp | Automatic forming method of program and automatic forming device of program |
WO2009017231A2 (en) * | 2007-08-02 | 2009-02-05 | Nec Corporation | Pattern examination system, pattern examination device, method, and pattern examination program |
CN101710305A (en) * | 2009-12-14 | 2010-05-19 | 中国科学院计算技术研究所 | Method and system for realizing white box testing of computer software |
CN102073589A (en) * | 2010-12-29 | 2011-05-25 | 北京邮电大学 | Code static analysis-based data race detecting method and system thereof |
Non-Patent Citations (2)
Title |
---|
汪浩等: "《遗传算法及其在软件测试数据生成中的应用研究》", 《计算机工程与应用》 * |
荚伟等: "《遗传算法在软件测试数据生成中的应用》", 《北京航空航天大学学报》 * |
Cited By (76)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103246597B (en) * | 2012-02-07 | 2017-03-15 | 腾讯科技(深圳)有限公司 | A kind of method of testing of parameter and equipment |
CN103246597A (en) * | 2012-02-07 | 2013-08-14 | 腾讯科技(深圳)有限公司 | Parameter testing method and device |
CN102622558A (en) * | 2012-03-01 | 2012-08-01 | 北京邮电大学 | Excavating device and excavating method of binary system program loopholes |
CN102622558B (en) * | 2012-03-01 | 2014-10-08 | 北京邮电大学 | Excavating device and excavating method of binary system program loopholes |
CN102708047A (en) * | 2012-04-23 | 2012-10-03 | 福建师范大学 | Data flow test case generating method |
CN102708047B (en) * | 2012-04-23 | 2014-12-10 | 福建师范大学 | Data flow test case generating method |
WO2014180107A1 (en) * | 2013-05-08 | 2014-11-13 | 南京大学 | Test-based static analysis false positive elimination method |
CN103218297B (en) * | 2013-05-15 | 2018-05-04 | 百度在线网络技术(北京)有限公司 | The screening technique and device of test data |
CN103218297A (en) * | 2013-05-15 | 2013-07-24 | 百度在线网络技术(北京)有限公司 | Screening method and device of test data |
CN104142819A (en) * | 2013-07-10 | 2014-11-12 | 腾讯科技(深圳)有限公司 | File processing method and device |
CN104142819B (en) * | 2013-07-10 | 2016-08-24 | 腾讯科技(深圳)有限公司 | A kind of document handling method and device |
CN103593287B (en) * | 2013-10-30 | 2016-08-17 | 北京信息控制研究所 | A kind of data links case automatic generating method based on genetic algorithm |
CN103593287A (en) * | 2013-10-30 | 2014-02-19 | 北京信息控制研究所 | Genetic-algorithm-based method for automatically generating data stream test cases |
CN103559129A (en) * | 2013-10-31 | 2014-02-05 | 中国矿业大学 | Statistical regression test data generation method based on genetic algorithm |
CN103559129B (en) * | 2013-10-31 | 2016-08-17 | 中国矿业大学 | Statistical regression test data generating method based on genetic algorithm |
CN103729297A (en) * | 2013-12-31 | 2014-04-16 | 北京理工大学 | Test case generation method based on hierarchic genetic algorithm |
JP2015142934A (en) * | 2014-01-31 | 2015-08-06 | Jfeスチール株式会社 | Slab organization method including profiled steel sheet and slab organization device |
CN103810104B (en) * | 2014-03-04 | 2017-08-25 | 中国人民解放军63863部队 | A kind of software test case optimization method and system |
CN103810104A (en) * | 2014-03-04 | 2014-05-21 | 中国人民解放军63863部队 | Method and system for optimizing software test case |
CN105607989A (en) * | 2014-11-18 | 2016-05-25 | 阿里巴巴集团控股有限公司 | Sampling method and system of software test data |
CN104536877A (en) * | 2014-11-28 | 2015-04-22 | 江苏苏测软件检测技术有限公司 | Mixed strategy based test data generation method |
CN104536877B (en) * | 2014-11-28 | 2017-09-12 | 江苏苏测软件检测技术有限公司 | A kind of test data generating method based on mixed strategy |
CN105260317A (en) * | 2015-11-19 | 2016-01-20 | 上海斐讯数据通信技术有限公司 | Test case selection method |
CN105260317B (en) * | 2015-11-19 | 2017-10-13 | 上海斐讯数据通信技术有限公司 | A kind of choosing method of test case |
US9792204B2 (en) | 2016-02-02 | 2017-10-17 | General Electric Company | System and method for coverage-based automated test case augmentation for design models |
CN107103213A (en) * | 2017-03-23 | 2017-08-29 | 中国航天系统科学与工程研究院 | A kind of software code based on genetic algorithm obscures operation system of selection |
CN107229565A (en) * | 2017-05-31 | 2017-10-03 | 北京京东尚科信息技术有限公司 | Method of testing and device |
CN107229565B (en) * | 2017-05-31 | 2020-05-01 | 北京京东尚科信息技术有限公司 | Test method and device |
CN107748721A (en) * | 2017-11-27 | 2018-03-02 | 中国航空无线电电子研究所 | A kind of test use cases automatic generation method |
CN109901987A (en) * | 2017-12-11 | 2019-06-18 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus generating test data |
CN108171413A (en) * | 2017-12-26 | 2018-06-15 | 杭州电子科技大学 | A kind of chemical industrial park emergency resources method for optimizing configuration |
CN108171413B (en) * | 2017-12-26 | 2021-08-10 | 杭州电子科技大学 | Chemical industry park emergency resource allocation optimization method |
CN108304625A (en) * | 2018-01-15 | 2018-07-20 | 北京航空航天大学 | Artificial intelligence program person writes the genetic programming decision-making technique of digital aircraft code |
CN108304625B (en) * | 2018-01-15 | 2021-10-08 | 北京航空航天大学 | Genetic programming decision-making method for writing digital aircraft code by artificial intelligence programmer |
CN108399127A (en) * | 2018-02-09 | 2018-08-14 | 中国矿业大学 | A kind of integrated method for creating test sequence of class |
CN108399127B (en) * | 2018-02-09 | 2020-06-23 | 中国矿业大学 | Class integration test sequence generation method |
CN108536606A (en) * | 2018-04-22 | 2018-09-14 | 北京化工大学 | A kind of EFSM test methods based on complex dependence relationship coverage criterion |
CN108536606B (en) * | 2018-04-22 | 2021-01-19 | 北京化工大学 | EFSM test method based on composite dependency coverage criterion |
CN108647146A (en) * | 2018-05-11 | 2018-10-12 | 北京信息科技大学 | The method for generating test case of combined covering is judged based on correction conditions |
CN108647146B (en) * | 2018-05-11 | 2021-06-08 | 北京信息科技大学 | Test case generation method for judging combination coverage based on correction condition |
US11720477B2 (en) | 2018-05-23 | 2023-08-08 | South China University Of Technology | Unit testing method based on automatic generation of path coverage test cases |
WO2019223247A1 (en) * | 2018-05-23 | 2019-11-28 | 华南理工大学 | Unit testing method based on automatic generation of path coverage test use cases |
CN108710575A (en) * | 2018-05-23 | 2018-10-26 | 华南理工大学 | Unit test method based on automatic generation of path coverage test case |
CN108716953A (en) * | 2018-06-15 | 2018-10-30 | 哈尔滨工程大学 | A kind of contactless sea surface temperature measuring device field performance appraisal procedure of boat-carrying |
GB2577102A (en) * | 2018-09-14 | 2020-03-18 | Advanced Risc Mach Ltd | Generation of code coverage information during testing of a code sequence |
WO2020053545A1 (en) * | 2018-09-14 | 2020-03-19 | Arm Limited | Generation of code coverage information during testing of a code sequence |
US11822462B2 (en) | 2018-09-14 | 2023-11-21 | Arm Limited | Generation of code coverage information during testing of a code sequence |
GB2577102B (en) * | 2018-09-14 | 2021-03-03 | Advanced Risc Mach Ltd | Generation of code coverage information during testing of a code sequence |
CN109376075A (en) * | 2018-09-19 | 2019-02-22 | 北京奇安信科技有限公司 | A kind of processing method and processing device generating the optimal Test coverage path of test object |
CN109669436A (en) * | 2018-12-06 | 2019-04-23 | 广州小鹏汽车科技有限公司 | A kind of method for generating test case and device of the functional requirement based on electric car |
CN109669436B (en) * | 2018-12-06 | 2021-04-13 | 广州小鹏汽车科技有限公司 | Test case generation method and device based on functional requirements of electric automobile |
CN109902007A (en) * | 2019-02-21 | 2019-06-18 | 南京信息工程大学 | It is a kind of based on the method for generating test case for polishing color model |
CN109902007B (en) * | 2019-02-21 | 2022-04-29 | 南京信息工程大学 | Test case generation method based on point dyeing model |
CN109918304A (en) * | 2019-03-06 | 2019-06-21 | 牡丹江师范学院 | A kind of quickly high path coverage method for generating test case |
CN109918304B (en) * | 2019-03-06 | 2022-04-12 | 牡丹江师范学院 | Rapid high-path coverage test case generation method |
CN109977030A (en) * | 2019-04-26 | 2019-07-05 | 北京信息科技大学 | A kind of test method and equipment of depth random forest program |
CN109977030B (en) * | 2019-04-26 | 2022-04-19 | 北京信息科技大学 | Method and device for testing deep random forest program |
CN110879778B (en) * | 2019-10-14 | 2023-09-26 | 杭州电子科技大学 | Novel dynamic feedback and improved patch evaluation software automatic repair method |
CN110879778A (en) * | 2019-10-14 | 2020-03-13 | 杭州电子科技大学 | Novel dynamic feedback and improved patch evaluation software automatic restoration method |
CN111144540A (en) * | 2019-12-05 | 2020-05-12 | 国网山东省电力公司电力科学研究院 | Generation method of anti-electricity-stealing simulation data set |
CN111221741A (en) * | 2020-01-17 | 2020-06-02 | 北京工业大学 | Method for automatically generating abnormal unit test based on genetic algorithm and log analysis |
CN111221741B (en) * | 2020-01-17 | 2023-10-10 | 北京工业大学 | Method for automatically generating abnormal unit test based on genetic algorithm and log analysis |
CN112216341A (en) * | 2020-09-16 | 2021-01-12 | 中国人民解放军国防科技大学 | Group behavior logic optimization method and computer readable storage medium |
CN112463629A (en) * | 2020-12-11 | 2021-03-09 | 北京航空航天大学 | Method for adjusting software configuration items of autonomous unmanned system based on genetic evolution |
CN113672503A (en) * | 2021-08-03 | 2021-11-19 | 中移(杭州)信息技术有限公司 | Test case generation method, system, terminal device and storage medium |
CN113778876A (en) * | 2021-09-09 | 2021-12-10 | 南京大学 | Method and device for generating program variation of source code level |
CN114282261A (en) * | 2021-12-10 | 2022-04-05 | 天津大学 | Fine-grained privacy policy and mobile application behavior consistency checking method |
US11803462B1 (en) | 2022-04-27 | 2023-10-31 | Agora Lab, Inc. | System and method for automatically generating test cases for testing SDKS |
CN115617700A (en) * | 2022-12-19 | 2023-01-17 | 华东交通大学 | Test case design and generation method and system based on relational analysis |
CN116383070A (en) * | 2023-04-07 | 2023-07-04 | 南京航空航天大学 | Symbol execution method for high MC/DC |
CN116383070B (en) * | 2023-04-07 | 2023-12-05 | 南京航空航天大学 | Symbol execution method for high MC/DC |
CN116578498A (en) * | 2023-07-12 | 2023-08-11 | 西南交通大学 | Automatic generation method and system for unit test cases |
CN116578498B (en) * | 2023-07-12 | 2023-09-29 | 西南交通大学 | Automatic generation method and system for unit test cases |
CN116775499A (en) * | 2023-08-21 | 2023-09-19 | 中国电信股份有限公司 | Test data generation method, device, computer equipment and storage medium |
CN117349837A (en) * | 2023-09-28 | 2024-01-05 | 广西卓梵智能科技有限公司 | IAST-based quick positioning detection method and system for stain data |
CN117349837B (en) * | 2023-09-28 | 2024-06-18 | 广西卓梵智能科技有限公司 | IAST-based quick positioning detection method and system for stain data |
Also Published As
Publication number | Publication date |
---|---|
CN102323906B (en) | 2014-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102323906B (en) | MC/DC test data automatic generation method based on genetic algorithm | |
Cremer et al. | From optimization-based machine learning to interpretable security rules for operation | |
Vladislavleva et al. | Predicting the energy output of wind farms based on weather data: Important variables and their correlation | |
CN108376116B (en) | Test case generation method based on improved particle swarm optimization | |
Meier et al. | Sampling design for network model calibration using genetic algorithms | |
CN102331966A (en) | Software test data evolution generation system facing path | |
Chen et al. | Dimension reduction of decision variables for multireservoir operation: A spectral optimization model | |
CN114969953B (en) | Optimized shield underpass tunnel design method and equipment based on Catboost-NSGA-III | |
CN101617328A (en) | The automatic configuration method and the device that in problem solving environment, are used for meta-heuristic algorithms | |
Xu et al. | Comparison of three global optimization algorithms for calibration of the Xinanjiang model parameters | |
CN110751176A (en) | Lake water quality prediction method based on decision tree algorithm | |
CN109412161A (en) | A kind of Probabilistic Load calculation method and system | |
CN101458779A (en) | Curve and surface fairing method based on inheritance arithmetic | |
Guariso et al. | Performance of implicit stochastic approaches to the synthesis of multireservoir operating rules | |
CN117477544A (en) | LSTM ultra-short-term photovoltaic power prediction method and system integrating time mode features | |
Paluszczyszyn | Advanced modelling and simulation of water distribution systems with discontinuous control elements | |
Chen et al. | Towards automated cost analysis, benchmarking and estimating in construction: A machine learning approach | |
CN105022798A (en) | Categorical data mining method of discrete Bayesian network on the basis of prediction relationship | |
Sharma et al. | Prediction of cost and emission from Indian coal-fired power plants with CO 2 capture and storage using artificial intelligence techniques | |
CN111026661B (en) | Comprehensive testing method and system for software usability | |
Rao et al. | Optimization of machinery noise in a bauxite mine using Genetic Algorithm | |
Langer | Fast algorithms for decomposable graphs | |
Riaño-Briceño et al. | Co-simulation for the design of controllers in urban drainage systems | |
Rychtyckyj et al. | Assessing the performance of cultural algorithms for semantic network re-engineering | |
Yang et al. | BOAI: Fast alternating decision tree induction based on bottom-up evaluation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20140108 |