CN103902457A - Method for generating test data covering parallel program paths based on coevolution - Google Patents

Method for generating test data covering parallel program paths based on coevolution Download PDF

Info

Publication number
CN103902457A
CN103902457A CN201410155745.5A CN201410155745A CN103902457A CN 103902457 A CN103902457 A CN 103902457A CN 201410155745 A CN201410155745 A CN 201410155745A CN 103902457 A CN103902457 A CN 103902457A
Authority
CN
China
Prior art keywords
individuality
path
test data
evolution
population
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.)
Pending
Application number
CN201410155745.5A
Other languages
Chinese (zh)
Inventor
巩敦卫
田甜
姚香娟
秦备
吴川
张功杰
钟超群
陈永伟
王金鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China University of Mining and Technology CUMT
Original Assignee
China University of Mining and Technology CUMT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China University of Mining and Technology CUMT filed Critical China University of Mining and Technology CUMT
Priority to CN201410155745.5A priority Critical patent/CN103902457A/en
Publication of CN103902457A publication Critical patent/CN103902457A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method for generating test data covering parallel program paths based on coevolution, and aims to provide a method for automatically and efficiently generating test data covering parallel program objective paths. The method includes the following specific steps that firstly, a mathematical model of a test data generation problem is built, and a problem for generating the test data covering the parallel program paths is modeled into a single-object optimization problem; secondly, a coevolution genetic algorithm is designed to solve the model. According to the method, groups are divided into a plurality of sub groups and a cooperative team group according to the correlation of course paths and program input components. Each sub group is used for independently optimizing a part of input components relevant to one certain course path. After the sub groups are evolved into a certain period, excellent individuals of the sub groups are combined to form an initial individual of the cooperative team group so as to be used for optimizing complete program input. After the cooperative group is evolved into a certain period, the excellent individuals are returned to the sub groups. Through alternate coevolution of the cooperative team group and the sub groups, the expected test data are generated.

Description

Concurrent program path coverage test data creation method based on coevolution
Technical field
The present invention relates to computer software testing field, designed the generation method of a kind of concurrent program path coverage test data, can be used for generating in parallel program testing the test data in coverage goal path.
Background technology
The development of parallel computing, makes increasing problem in science adopt concurrent program to solve, as image processing, weather forecast, molecular dynamics simulation etc.In many parallel program development modes, use Message Passing Environment to expand existing serial program, when can reducing extra programming burden, improve the efficiency of parallel program development, thereby become the most frequently used parallel program development mode.Typical Message Passing Environment has: message passing interface, parallel virtual machine, CM information are transmitted storehouse, and Express etc.Wherein, first two is common software, and has good compatibility.Along with the fast development of network technology and improving constantly of uniprocessor performance, message passing interface and parallel virtual machine also become most popular message passing library.Compared with serial program, concurrent program is more complicated, and reliability requirement is higher.This means, very necessary to the test of concurrent program.
Krammer etc., in concurrent program operational process, check whether application programming interfaces correctly use.The dynamic surveillance instrument Umpire of Vetter etc. exploitation MPI, for detection of the deadlock in operational process, unmatched set operation, and the defect such as resource exhaustion.Godefroid proposes the method for testing detecting based on model, controls thread scheduling and searches for all possible program behavior, and still, along with the increase of program scale, the mutual number exponential increase of concurrent program, causes Space Explosion problem.For this problem, Flanagan etc. propose dynamic partial order reduction method.On this basis, Vakkalanka etc. are the instruments of inspection ISP of exploitation concurrent program further, and all processes of this instrument are carried out under the control of a mutual scheduler, can find that the local assertion of concurrent program breaks rules, and by partial order Reduction algorithm, detect all deadlocks of concurrent program.
Totally it seems, the existing achievement in research about parallel program testing, the problem that spininess produces concurrent execution, the communication sequence of test concurrent program, to find deadlock, resource contention, and whether application program correctly uses etc.Under the correct prerequisite of communication, while there is not the problem such as deadlock and resource contention, how to carry out software test, to improve the confidence level of concurrent software, be the problem of needing solution badly.
The core of carrying out software test is to generate effective test data.Dan Jinhui etc. think, many software test problems can be summed up as path coverage test data Generating Problems.Therefore, path covers becomes one of the most frequently used testing adequacy criterion.Existing path coverage test Data Generation Technology comprises, the disclosed relaxative iteration method of Chinese patent instructions CN1402133 (announcement on March 12nd, 2003), the disclosed path coverage test data creation method based on genetic algorithm of Chinese patent instructions CN102331966A (announcement on January 15th, 2012), and the path coverage test data evolution generation method of the disclosed facing defects of Chinese patent instructions CN102141958A (announcement on August 3rd, 2011).Ahmed, Bueno, Xie Xiaoyuan, and McMinn etc. is also respectively for one and many objectives path, has proposed the multiple automatic generation of test data based on genetic algorithm.Although existing a lot of achievement in research about test data Generating Problems,, existing test data generating method is mainly towards serial program.Different from serial program, the multiple task parallelisms of concurrent program are carried out, and by communication the cooperate science that solves or engineering problem, this makes existing method be difficult to be applied to concurrent program.
For validity problem how to evaluate parallel program testing data, Souza etc., based on controlling and communication stream, propose sending node, receiving node, whole node, send the coverage criterions such as limit, and whole limits; Based on data and message transmission stream, definition, definition-transmission, calculating, predicate, transmission, transmission-calculating are proposed, and the coverage criterion such as transmission-predicate.Further, Souza etc., in harness basis, consider other features such as collective communication, unblock communication of tested program, have proposed new coverage criterion.But, do not provide the effective ways that test data generates.
Through consulting pertinent literature, also do not exist one to be applicable to the test data generating method that concurrent program path covers at present.
Summary of the invention
The present invention proposes a kind of concurrent program path coverage test data creation method based on coevolution.First, set up the mathematical model of test data Generating Problems; Then, design a kind of new Co-evolutionary Genetic Algorithm, solve above-mentioned Optimized model, efficiently to generate the test data of expectation.
Technical matters to be solved by this invention: overcome the deficiencies in the prior art, the design concept of concurrent program is combined with coevolution concept, according to the correlativity of input variable and process path, a kind of new Cooperative Evolutionary is proposed, the test data that effectively generates concurrent program, improves testing efficiency.
Technical solution of the present invention: a kind of concurrent program path coverage test data creation method based on coevolution, is characterized in that following steps:
The foundation of step 1. mathematical model
For determining the concurrent program of carrying out, consider following path covering problem: an objective path of given tested program, in the input space, find at least one data, while making taking these data as input execution tested program, the path of passing through is destination path.For this path coverage test data Generating Problems is converted into optimization problem, setting up of objective function is very key.
Adopt the similarity of passing through path and destination path of a certain input data as objective function, the condition that should possess to embody satisfactory test data.Therefore, according to the similarity of paths of concurrent program, provide corresponding objective function, based on this, set up the mathematical model of problem.Due to the multi-process executed in parallel of concurrent program, a concurrent program path comprises many process paths, and the similarity between concurrent program two paths, need to consider the similarity between many process paths.
The similarity of passing through path and destination path taking maximization test data is as target, and the mathematical model that the present invention sets up concurrent program path coverage test data Generating Problems is as follows:
max f ( x → ) s . t . x → ∈ D
Wherein,
Figure BDA0000492464370000031
the decision vector being formed by the input variable of program,
Figure BDA0000492464370000032
for embodying the objective function of two objective similarity of paths, the input space that D is program, also referred to as decision space.
The design of step 2. optimization method
In general, the design of parallel algorithm be divided into cut apart, four steps such as communication, combination and mapping.Wherein, cut apart a complicated calculation task is divided into some simple calculation tasks, be divided into territory and decompose and Function Decomposition.Most concurrent programs adopt territory to decompose, and input data to be processed need are divided.By certain task of cutting apart generation, generally can not completely independently carry out, need to use the data of other tasks, produce thus communication requirement.Based on the mentality of designing of parallel algorithm, can know, each process of concurrent program is responsible for processing section or whole input data.Based on this, in order effectively to utilize the advantage of Co-evolutionary Genetic Algorithm, huge communication overhead simultaneously that avoid again traditional Cooperative Evolutionary to bring, the present invention adopts multiple sub-populations and a consortium group coevolution.Every sub-population independently evolved, to optimize a part of decision-making component.When evolving to after some cycles, the defect individual of each sub-population combines by certain method, forms consortium group's initial population, for the complete decision vector of optimizer.When consortium group evolves to after some cycles, return to defect individual to sub-population.Evolve by this two classes population cycle alternation, the model in step 1 is optimized.
Step 3. is used Co-evolutionary Genetic Algorithm to generate test data
The present invention utilizes multiple sub-populations and a consortium group's alternately coevolution, generates the test data of expecting.First, generate at random multiple initial sub-populations, decoded population at individual is inputted to data as process, carry out respectively multiple program process, evaluate individual quality by fitness function, use genetic operator to generate new population.In the time arriving appointment evolution cycle, sub-population suspends evolves, and selects defect individual composition consortium group.Then, by the input data using decoded individuality as whole concurrent program group, carry out concurrent program, consortium is mined massively and is used and step like sub-groupy phase, implements to evolve.In the time arriving appointment evolution cycle, consortium group divides advantage individuality, sends in corresponding sub-population.Now, consortium group suspends evolution, and sub-population starts the evolution of next cycle, repeat above-mentioned steps, by sub-population and consortium group's alternately coevolution, to evolve and obtain optimum solution by consortium group, decoded optimum solution is the test data in coverage goal path.
Compared with existing technology, main contributions of the present invention is following 3 aspects: (1), according to the multi-process executed in parallel of concurrent program, has set up the mathematical model of test data Generating Problems; (2) propose a kind of Co-evolutionary Genetic Algorithm and solved above-mentioned model, not only solved parallel program testing data Generating Problems, and expanded the application of Cooperative Evolutionary; (3) method of proposition is applied in multiple typical parallel program testings, result shows, the inventive method can generate the test data of overlay path efficiently.
Brief description of the drawings
Fig. 1 overview flow chart of the present invention.
Fig. 2 coevolution framework.
The false code that Fig. 3 consortium group forms.
The false code of Fig. 4 Evolution of Population.
The false code that Fig. 5 consortium group evolves.
The source code of Fig. 6 example procedure process 0.
The source code of Fig. 7 example procedure process 1 and 2.
The source code of Fig. 8 example procedure process 3.
Embodiment
Figure 1 shows that overview flow chart of the present invention.In connection with accompanying drawing and example, technical scheme of the present invention is known to complete explanation below.
The foundation of step 1. mathematical model
1.1 key concept
Note concurrent program S={S 0, S 1..., S m-1, wherein, S i(i=0,1 ..., m-1) represent i process, m is process number.If the input vector of S wherein, x j(j=1,2 ..., n s) be j input component, its span is so,
Figure BDA0000492464370000043
codomain (being the input space of program) be
Figure BDA0000492464370000044
input vector
Figure BDA0000492464370000045
for decision vector, corresponding, claim x j(j=1,2 ..., n s) be j decision-making component.
Definition one: node is considered i the process S of S i, claim that its basic performance element is node.The statement that node comprises or all carry out, or do not carry out.Node can be the Rule of judgment of a branch statement, can be also the cycling condition of a loop statement, can also be one or more continuous statement, and a piece of news sends or receive statement.
Definition two: path is with input
Figure BDA0000492464370000046
carry out S={S 0, S 1..., S m-1time, pass through the sequence node of S.Specifically, pass through S isequence node, form process S ipath, be designated as p i.Sequence p ithe node number comprising, is called path p ilength, be designated as | p i|.So, the path p that passes through S is made up of m process path, is designated as p=p 0p 1... p m-1.Correspondingly, note destination path is p *=p * 0p * 1... p * m-1.
At destination path p *=p * 0p * 1... p * m-1in, with process S icorresponding target process path p * i, comprise part (or all) decision-making component, claim these components and process p * irelevant.All and path p * irelevant decision-making component, composition decision-making divides duration set, is designated as
Figure BDA0000492464370000051
easily know,
Figure BDA0000492464370000052
path p iand the corresponding relation between decision-making component is designated as decision-making corresponding to different process paths divide between duration set, may have overlapping, at p *in, there is process path p * iand p * j, make
Figure BDA0000492464370000054
1.2 mathematical model
Given destination path p *=p * 0p * 1... p * m-1, note
Figure BDA0000492464370000055
the path of passing through is p=p 0p 1... p m-1, process S ipath p iwith p * isimilarity, be designated as s (p * i, p i), can be expressed as:
s ( p * i , p i ) = | p * i ∩ p i | max { | p * i | , | p i | } - - - ( 1 )
In formula, | p * i∩ p i| represent p iwith p * iconsecutive identical nodes from front to back.For all processes of S, path p and p *similarity be:
s ( p * , p ) = 1 m Σ i = 0 m - 1 s ( p * i , p i ) - - - ( 2 )
So,
Figure BDA0000492464370000058
can be expressed as:
f ( x → ) = 1 m Σ i = 0 m - 1 s ( p * i , p i ) - - - ( 3 )
From formula (1) and (3), (1)
Figure BDA00004924643700000510
comprise m ingredient, and
Figure BDA00004924643700000511
(2) only has (p as s * 0, p 0), s (p * 1, p 1) ..., s (p * m-1, p m-1) while all getting maximal value,
Figure BDA00004924643700000512
just get maximal value, now be coverage goal path p *test data.Based on this, the present invention sets up the mathematical model of path coverage test data Generating Problems:
max f ( x → ) s . t . x → ∈ D - - - ( 4 )
The design of step 2. optimization method
The coevolution framework that the present invention proposes as shown in Figure 2.Every individual sub-population and consortium group use different fitness function cooperative alternatives to evolve.
2.1 fitness function
First, consider to evaluate the fitness function of sub-Evolution of Population individuality.Population i passes through target process path p for generating * itest data.S ibe input as
Figure BDA00004924643700000515
do not causing under the prerequisite of obscuring note
Figure BDA00004924643700000516
coding be still
Figure BDA00004924643700000517
in addition note,
Figure BDA00004924643700000518
pass through S ipath be p i.Easily know p iwith p * isimilarity s (p * i, p i) larger, so,
Figure BDA0000492464370000061
more close to the corresponding p of the test data of expecting * icomponent, thereby
Figure BDA0000492464370000062
quality higher; Especially, if s is (p * i, p i)=1, so, p ibe target process path p * ithereby, be the corresponding p of test data of expectation * icomponent.Convolution (1), weighs the fitness function of performance, is designated as
Figure BDA0000492464370000065
can be expressed as:
F i ( x → i ) = | p * i ∩ p i | max { | p * i | , | p i | } - - - ( 5 )
From formula (5), in order to evaluate the evolution individuality of population i
Figure BDA0000492464370000067
performance, only need the S passing through ipath p iwith destination path p *corresponding S ipath p * i, with other populations, and consortium group's evolution is individual irrelevant.That is to say,
Figure BDA0000492464370000069
adaptive value calculate, do not rely on the information that other populations provide.The fitness function of this and traditional Co-evolutionary Genetic Algorithm has essential distinction.
Then, consider to evaluate the consortium group individual fitness function of evolving.Consortium group's evolution individuality, is combined by certain mode by the representative individuality of each sub-population.After the individual decoding of evolution of this population, be the input of concurrent program, the combination of paths that process is passed through by respective component in its path of passing through forms.For the input of concurrent program
Figure BDA00004924643700000610
do not causing under the prerequisite of obscuring, remembering that corresponding consortium group's evolution individuality is
Figure BDA00004924643700000611
in addition suppose,
Figure BDA00004924643700000612
respective component pass through S ipath be p i, so,
Figure BDA00004924643700000613
the path of the concurrent program passing through can be expressed as p=p 0p 1... p m-1.Easily know p and p *similarity s (p *, p) larger, so,
Figure BDA00004924643700000614
get over close to the test data of expecting, thereby
Figure BDA00004924643700000615
quality higher; Especially, if s is (p *, p)=1, so, p is destination path, thereby
Figure BDA00004924643700000616
be the test data of expectation.Convolution (2), weighs the fitness function of performance, is designated as
Figure BDA00004924643700000618
can be expressed as:
F ( x → ) = 1 m Σ i = 0 m - 1 s ( p * i , p i ) - - - ( 6 )
Formula (1), (2), (5), and (6) illustrate, performance and each sub-population represent that individual performance is closely related.If the representative individuality that population i provides can not pass through p * i, so, the consortium group's who forms thus evolution individuality also can not pass through p *; The representative individuality that only has all sub-populations to provide passes through p *the path of corresponding process, the consortium group's of formation evolution individuality just may pass through p *.Represent individuality owing to only relying on each sub-population to provide, the probability that forms the test data of expecting is very little, therefore, on the representative individual primary providing, the algebraically that evolution consortium group is certain, raising generates the probability of the test data of expectation.
2.2 consortium groups' formation
Basic thought: based on the defect individual of sub-population, composition is initial consortium as far as possible effectively.Each is represented to individual and every other representative individuality combines, and forms multiple candidate's consortiums.And screening conditions are set are: in consortium, at least comprise a complete representative individuality.According to this condition, in the candidate group producing, select suitable consortium.In addition, can use other stricter conditions, further improve initial consortium group's quality.
Individuality in consortium group initial population is combined by certain mode by the defect individual of each sub-population.After the certain algebraically of sub-Evolution of Population, i population, is designated as M i, i=0,1 ..., m-1, according to individual adaptive value, selects some performances preferably individual, as the representative individuality of this sub-population.Illustrate at Section 1.1, likely overlapping between input component corresponding to different process paths, in order to ensure that consortium group has well behaved initial population, divide duration set according to the decision-making of every sub-Evolution of Population, to representing that individuality carries out reasonable combination.The code that consortium group forms as shown in Figure 3.
For the representative individuality of every sub-population, the concrete steps that form consortium group are as follows: first, and the difference set of asking the decision-making of decision variable and sub-Evolution of Population to divide duration set, the 2nd row of corresponding false code; Then, from the representative individuality of other sub-populations, extract the value relevant to difference set component, expansion is divided the representative individuality of the corresponding sub-population of duration set by poor decision-making, thereby produces consortium group's evolution individuality, the 3rd to 6 row of corresponding false code; In addition,, in order to produce new evolution individuality, ask the decision-making component intersection of sets collection of two sub-Evolution of Populations, and from the representative individuality of other sub-populations, extract the value relevant to common factor component, replace the analog value of the evolution individuality having produced, the 7th to 12 row of corresponding false code; If it is individual that the evolution individuality producing is different from already present evolution, and in evolution individuality, at least comprise 1 complete representative individuality, so, this evolution individuality is joined in consortium group to the 13rd to 19 row of corresponding false code.
Step 3. is used Co-evolutionary Genetic Algorithm to generate test data
3.1 genetic algorithm parameter settings and termination service condition thereof
For an objective path of tested program, the present invention uses Co-evolutionary Genetic Algorithm to generate test data.For this reason, need to preset heredity and control parameter, and the end condition of algorithm operation.
Heredity is controlled parameter and is arranged as follows: the individual binary coding that adopts of evolving, genetic manipulation is roulette selection, single-point intersects, and single-point variation, and crossover and mutation probability is respectively 0.9 and 0.3, the sub-Evolution of Population cycle is 2, and consortium group's evolution cycle is 5.
The end condition of algorithm operation: (1) consortium all living creatures has become the test data in coverage goal path; (2) arrive predefined maximum evolutionary generation.If meet one of above-mentioned condition, algorithm stops operation.
3.2 Co-evolutionary Genetic Algorithm concrete steps
As shown in Figure 1, the Co-evolutionary Genetic Algorithm that the present invention proposes comprises 2 class populations, except multiple sub-population M 1, M 2..., M m-1outside, also have consortium group GM, and the mode of evolution difference of inhomogeneity population.Provide respectively the false code of each class Evolution of Population below.
The false code of sub-Evolution of Population as shown in Figure 4.Sub-population M ionly optimize the decision-making component relevant with a certain process subpath.Every generation during evolution, using the decoded individual input as this process of evolving, carry out this process acquisition and pass through path, pass through path and target process path by individuality, obtain individual fitness (4-6 is capable) according to formula (5).In the time arriving the evolution cycle of specifying, M iaccording to fitness, select the defect individual composition of some to represent individual collections EM isend to consortium group GM, and wait receives the defect individual (dominant individuals) (9-11 is capable) that consortium group returns, if the individuality receiving, for empty, has represented to have found the test data of expecting, evolve and stop (12-13 is capable).Otherwise, implement genetic manipulation and generate progeny population continuation evolution (15-17 is capable).
The false code that consortium group evolves as shown in Figure 5.Consortium group GM receives after the representative individuality that each sub-population sends, and according to the method for 2.2 joints, they is combined to form to the initial evolution individual (1-2 is capable) of this population.In every generation of period demand is evolved, the individual input as whole concurrent program of decoding evolution, obtain passing through path by carrying out whole program, pass through path and destination path by individuality, obtaining individual fitness (5-7 is capable) if there is individual fitness according to formula (5) is 1, that is to say, this individuality is the test data of expecting, output is individual, stops evolving, plant the empty information of pocket transmission to son simultaneously, stop the evolution (9-11 is capable) of all populations.Otherwise enforcement genetic manipulation, generates progeny population (14-16 is capable).In the time arriving evolution cycle, according to the decision-making component of every sub-Evolution of Population, advantage individuality is divided, and sent in corresponding sub-population (18-19 is capable).
3.4 instance analysis
Taking example procedure as example, use procedure of the present invention is described.The function of this example procedure is to ask for the highest common factor of 3 integers, comprises altogether 4 processes, process S 0source code as shown in Figure 6, process S 1and S 2source code as shown in Figure 7, process S 3source code as shown in Figure 8.The destination path of choosing is:
p * = n 1 0 n 2 0 n 3 0 n 4 0 n 5 0 n 6 0 n 7 0 n 8 0 n 9 0 n 10 0 n 11 0 n 15 0 n 1 1 n 2 1 n 3 1 n 4 1 n 9 1 n 10 1 n 1 2 n 2 2 n 3 2 n 4 2 n 5 2 n 7 2 b 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 5 2 n 7 2 n 8 2 n 4 2 n 9 2 n 10 2 n 1 3 n 2 3 n 3 3 n 4 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 8 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 6 3 n 8 3 n 9 3 n 5 3 n 10 3 n 11 3
The decision variable of program is
Figure BDA0000492464370000082
divide S through data 1be used for asking for x 1and x 2highest common factor; S 2be used for asking for x 2and x 3highest common factor; Based on S 1and S 2rreturn value, S 3based on S 1and S 2rreturn value, ask for 3 numbers, be also decision variable
Figure BDA0000492464370000091
highest common factor.Therefore, p * 1with x 1and x 2relevant, p * 2with x 2and x 3relevant, p * 3with
Figure BDA0000492464370000092
relevant; S 0although do not solve task,, the path of this process is subject to S 1and S 2the impact of rreturn value, therefore, p * 0also with
Figure BDA0000492464370000093
relevant.In view of the execution route of example procedure is by S 1and S 2determine, therefore, allow population 0 and population 3 for empty.Application the inventive method, generates and covers p *test data time, adopt 2 sub-populations, be respectively population 1 and population 2, population scale is 9, represents that number of individuals is 2, consortium group's scale is 8, outstanding evolution number of individuals is 4.
At decision variable
Figure BDA0000492464370000094
in, the decision-making component that population 1 and population 2 are evolved is respectively with
Figure BDA0000492464370000096
when arriving after evolution cycle, the defect individual composition of population 1 and population 2 represents and is respectively individual collections: EM 1 = { ( a 1 1 , b 1 1 ) , ( a 2 1 , b 2 1 ) } , EM 2 = { ( b 1 2 , c 1 2 ) , ( b 2 2 , c 2 2 ) } . According to representing that individual collections forms consortium group.First, ask with
Figure BDA0000492464370000099
difference set, be { x 3, therefore, from EM 2the individual corresponding x of middle selection 3value, expansion EM 1representative individuality, obtain four of consortium group and evolve individual with
Figure BDA00004924643700000911
then, ask
Figure BDA00004924643700000912
with
Figure BDA00004924643700000913
common factor, be { x 2, therefore, by EM 2in the corresponding x of individuality 2value, replace the analog value of the evolution individuality that produced, obtain new evolution individuality
Figure BDA00004924643700000914
Figure BDA00004924643700000915
with
Figure BDA00004924643700000916
at the individuality of evolving
Figure BDA00004924643700000917
with
Figure BDA00004924643700000918
in, there is not a complete representative individuality, therefore, delete these individualities, only have other eight each and every one bodies can join in consortium group.To EM 2carry out same operation, the evolution of generation is individual individual identical with existing evolution in GM, therefore, deletes these individualities, no longer joins in consortium group.So, consortium group comprises following eight individualities of evolving: GM = { ( a 1 1 , b 1 1 , c 1 2 ) , ( a 1 1 , b 1 2 , c 1 2 ) , ( a 2 1 , b 2 1 , c 1 2 ) , ( a 2 1 , b 2 2 , c 1 2 ) , ( a 1 1 , b 1 1 , c 2 2 ) , ( a 1 1 , b 2 2 , c 2 2 ) , ( a 2 1 , b 2 1 , c 2 2 ) , ( a 2 1 , b 2 2 , c 2 2 ) } .
The contrast of table 1 the inventive method and traditional Co-evolutionary Genetic Algorithm
Figure BDA00004924643700000920
Based on identical population scale, by the inventive method and traditional Co-evolutionary Genetic Algorithm comparison, result is as listed in table 1.Can be found out by table 1, (1), in 30 experiments, the inventive method has all found the test data of expecting at every turn, and still, traditional Co-evolutionary Genetic Algorithm finds the number of times of expecting test data to only have 10; (2) aspect evolution individual evaluation number of times, institute's extracting method has reduced 62% than traditional Co-evolutionary Genetic Algorithm; Aspect consuming time, shorten 72% than traditional Co-evolutionary Genetic Algorithm.This explanation, the inventive method is better than traditional Co-evolutionary Genetic Algorithm, and improvement on consuming time is greater than evolution individual evaluation number of times.This be due to, while adopting institute extracting method to generate test data, each sub-population only need to be carried out a certain process, without carrying out whole concurrent program, has avoided the communication between the each process of concurrent program.

Claims (1)

1. the concurrent program path coverage test data creation method based on coevolution, is characterized in that step is as follows:
Step 1.1: for concurrent program, set up the mathematical model of path coverage test data Generating Problems, it is characterized in that adopting the similarity of passing through path and destination path of a certain input data as objective function, the condition that should possess to embody satisfactory test data, due to the multi-process executed in parallel of concurrent program, article one, concurrent program path comprises many process paths, similarity between concurrent program two paths, need to consider the similarity between many process paths, the similarity of passing through path and destination path taking maximization test data is as target, the mathematical model of setting up concurrent program path coverage test data Generating Problems is as follows:
Wherein,
Figure FDA0000492464360000012
the decision vector being formed by the input variable of program, for embodying the objective function of two concurrent program similarity of paths, the input space that D is program, also referred to as decision space;
Step 1.2: the mathematical model of setting up for step 1.1, design a kind of method for solving based on coevolution, for each population is designed different fitness functions, provide the constituted mode of consortium group individuality, based on this, can be by the alternately coevolution of the two class populations such as sub-population and consortium group, optimized mathematical model, is characterized in that comprising following steps:
Step 1.2.1: design fitness function, for sub-population M i, individuality
Figure FDA0000492464360000014
pass through process path p iwith target process path p * isimilarity s (p * i, pi) larger,
Figure FDA0000492464360000015
more close to the corresponding p of the test data of expecting * icomponent, thereby
Figure FDA0000492464360000016
quality higher, special, if s (p * i, pi)=1, so, p ibe target process path, thereby
Figure FDA0000492464360000017
be the corresponding p of test data of expectation * icomponent.According to the definition of process path similarity, weigh
Figure FDA0000492464360000018
the fitness function Fi of performance
Figure FDA0000492464360000019
be expressed as:
Figure FDA00004924643600000110
For consortium group GM, individuality passes through path p and destination path p *similarity s (p *, it is p) larger,
Figure FDA00004924643600000111
get over close to the test data of expecting, thereby
Figure FDA00004924643600000112
quality higher; Especially, if s is (p *, p)=1, so, p is destination path, thereby
Figure FDA00004924643600000113
be the test data of expectation, by the similarity of the multiple process paths of comprehensive consideration, weigh
Figure FDA00004924643600000114
the fitness function of performance
Figure FDA00004924643600000115
be expressed as:
Figure FDA00004924643600000116
Step 1.2.2: form consortium group, based on the good individuality that represents of sub-population, composition is initial consortium as far as possible effectively, each is represented to individual and every other representative individuality combines, form multiple candidate's consortiums, and screening conditions are set are: in consortium, at least comprise a complete representative individuality, according to this condition, in the candidate group producing, select suitable consortium, in addition, also can use other stricter conditions, further improve initial consortium group's quality, for the representative individuality of every sub-population, concrete steps are as follows:
First, ask the decision-making of decision variable and sub-Evolution of Population to divide the difference set of duration set; Then, from the representative individuality of other sub-populations, extract the value relevant to difference set component, expansion is divided the representative individuality of the corresponding sub-population of duration set by poor decision-making, thereby produces consortium group's evolution individuality; In addition, in order to produce new evolution individuality, ask the decision-making component intersection of sets collection of two sub-Evolution of Populations, and from the representative individuality of other sub-populations, extract the value relevant to common factor component, replace the analog value of the evolution individuality having produced; If it is individual that the evolution individuality producing is different from already present evolution, and in evolution individuality, at least comprise 1 complete representative individuality, so, this evolution individuality is joined in consortium group;
Step 1.3: adopt Co-evolutionary Genetic Algorithm to generate the test data that covers concurrent program destination path, it is characterized in that providing the implementation of consortium group and sub-population cooperative coevolution, specific as follows:
Sub-population is only optimized the decision-making component relevant with a certain process subpath, every generation during evolution, using the decoded individual input as this process of evolving, carry out this process acquisition and pass through path, consider that individuality passes through path and target process path, obtain individual fitness according to fitness function, in the time arriving the evolution cycle of specifying, sub-population is according to fitness, select the defect individual composition of some to represent that individual collections sends to consortium group, and wait receives the defect individual that consortium group returns, if the individuality receiving is for empty, represent to have found the test data of expecting, evolve and stop, otherwise, implement genetic manipulation and generate progeny population continuation evolution,
Consortium group receives after the representative individuality that each sub-population sends, according to consortium group's constructive method, they are combined, the initial evolution that forms this population is individual, in every generation of period demand is evolved, the individual input as whole concurrent program of decoding evolution, obtain passing through path by carrying out whole program, pass through path and destination path by individuality, obtain individual fitness according to consortium group's fitness function, if having individual fitness is 1, that is to say, this individuality is the test data of expecting, output is individual, stop evolving, plant the empty information of pocket transmission to son simultaneously, stop the evolution of all populations, otherwise enforcement genetic manipulation, generate progeny population, in the time arriving evolution cycle, according to the decision-making component of every sub-Evolution of Population, advantage individuality is divided, and send in corresponding sub-population.
CN201410155745.5A 2014-04-17 2014-04-17 Method for generating test data covering parallel program paths based on coevolution Pending CN103902457A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410155745.5A CN103902457A (en) 2014-04-17 2014-04-17 Method for generating test data covering parallel program paths based on coevolution

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410155745.5A CN103902457A (en) 2014-04-17 2014-04-17 Method for generating test data covering parallel program paths based on coevolution

Publications (1)

Publication Number Publication Date
CN103902457A true CN103902457A (en) 2014-07-02

Family

ID=50993792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410155745.5A Pending CN103902457A (en) 2014-04-17 2014-04-17 Method for generating test data covering parallel program paths based on coevolution

Country Status (1)

Country Link
CN (1) CN103902457A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718368A (en) * 2016-01-15 2016-06-29 西安邮电大学 Software testing data amplification method
CN105808426A (en) * 2016-02-28 2016-07-27 徐州工程学院 Path coverage test data generation method used for weak mutation test
CN105843744A (en) * 2016-04-22 2016-08-10 中国矿业大学 Metamorphic relation priority ranking method for metamorphic testing of parallel programs
CN106095669A (en) * 2016-06-03 2016-11-09 中国矿业大学 Parallel program testing method based on schedule sequences yojan
CN106095672A (en) * 2016-06-07 2016-11-09 北京信息科技大学 Testing adequacy acquisition methods based on function call path criterion
CN108549607A (en) * 2018-04-17 2018-09-18 中国矿业大学 Message-passing parallel program Multiple path coverage test data coevolution generation method
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
CN110083531A (en) * 2019-04-12 2019-08-02 江西财经大学 It improves the shared multi-goal path coverage test method of individual information and realizes system
CN112817841A (en) * 2021-01-21 2021-05-18 西安交通大学 Method for determining MPI parallel program test data generation based on communication of path coverage

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080301813A1 (en) * 2007-05-31 2008-12-04 Microsoft Corporation Testing Software Applications with Schema-based Fuzzing
CN102141958A (en) * 2011-03-09 2011-08-03 中国矿业大学 Method for evolving and generating path coverage test data facing defects

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080301813A1 (en) * 2007-05-31 2008-12-04 Microsoft Corporation Testing Software Applications with Schema-based Fuzzing
CN102141958A (en) * 2011-03-09 2011-08-03 中国矿业大学 Method for evolving and generating path coverage test data facing defects

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
巩敦卫 等: "基于协同进化遗传算法的消息传递并行程序路径覆盖测试", 《第七届中国测试学术会议论文集》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718368A (en) * 2016-01-15 2016-06-29 西安邮电大学 Software testing data amplification method
CN105808426B (en) * 2016-02-28 2018-10-16 徐州工程学院 A kind of path coverage test data creation method for weak mutation testing
CN105808426A (en) * 2016-02-28 2016-07-27 徐州工程学院 Path coverage test data generation method used for weak mutation test
CN105843744A (en) * 2016-04-22 2016-08-10 中国矿业大学 Metamorphic relation priority ranking method for metamorphic testing of parallel programs
CN105843744B (en) * 2016-04-22 2018-10-16 中国矿业大学 Transformation relation preference grade sort method for concurrent program metamorphic testing
CN106095669A (en) * 2016-06-03 2016-11-09 中国矿业大学 Parallel program testing method based on schedule sequences yojan
CN106095669B (en) * 2016-06-03 2020-09-25 中国矿业大学 Parallel program testing method based on scheduling sequence reduction
CN106095672B (en) * 2016-06-07 2018-10-19 北京信息科技大学 Testing adequacy acquisition methods based on function call path criterion
CN106095672A (en) * 2016-06-07 2016-11-09 北京信息科技大学 Testing adequacy acquisition methods based on function call path criterion
CN108549607A (en) * 2018-04-17 2018-09-18 中国矿业大学 Message-passing parallel program Multiple path coverage test data coevolution generation method
CN108549607B (en) * 2018-04-17 2021-05-18 中国矿业大学 Message transmission parallel program multi-path coverage test data coevolution generation method
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
CN110083531A (en) * 2019-04-12 2019-08-02 江西财经大学 It improves the shared multi-goal path coverage test method of individual information and realizes system
CN110083531B (en) * 2019-04-12 2022-12-27 江西财经大学 Multi-target path coverage test method and implementation system for improving individual information sharing
CN112817841A (en) * 2021-01-21 2021-05-18 西安交通大学 Method for determining MPI parallel program test data generation based on communication of path coverage
CN112817841B (en) * 2021-01-21 2022-12-09 西安交通大学 Method for determining MPI parallel program test data generation based on communication of path coverage

Similar Documents

Publication Publication Date Title
CN103902457A (en) Method for generating test data covering parallel program paths based on coevolution
CN102413029B (en) Method for partitioning communities in complex dynamic network by virtue of multi-objective local search based on decomposition
CN103235974B (en) A kind of method improving massive spatial data treatment effeciency
Mavrotas et al. An improved version of the augmented ε-constraint method (AUGMECON2) for finding the exact pareto set in multi-objective integer programming problems
Juneja et al. Travelling salesman problem optimization using genetic algorithm
CN103116540B (en) Dynamic symbolic execution method based on overall situation super block dominator graph
Huang et al. A discrete shuffled frog-leaping algorithm based on heuristic information for traveling salesman problem
CN108563556A (en) Software defect prediction optimization method based on differential evolution algorithm
CN104239213A (en) Two-stage scheduling method of parallel test tasks facing spacecraft automation test
CN102331966A (en) Software test data evolution generation system facing path
CN105183796A (en) Distributed link prediction method based on clustering
CN106991295B (en) A kind of protein network module method for digging based on multiple-objection optimization
CN106599230A (en) Method and system for evaluating distributed data mining model
CN102594909A (en) Multi-objective community detection method based on spectrum information of common neighbour matrix
CN104881735A (en) System and method of smart power grid big data mining for supporting smart city operation management
CN110110858A (en) A kind of automatic machinery learning method based on intensified learning
US20220398373A1 (en) Multi-stage fpga routing method for optimizing time division multiplexing
CN104200272A (en) Complex network community mining method based on improved genetic algorithm
CN112732577A (en) Evolution generation method for multi-task software test case
Zhang et al. A memetic particle swarm optimization algorithm for community detection in complex networks
CN110659284A (en) Block sequencing method and system based on tree graph structure and data processing terminal
CN103440377B (en) Based on the flight vehicle aerodynamic profile optimization method for designing improving parallel DE algorithm
CN110442143A (en) A kind of unmanned plane situation data clustering method based on combination multiple target dove group's optimization
CN111260491A (en) Method and system for discovering network community structure
Yang et al. Cognitive diagnosis-based personalized exercise group assembly via a multi-objective evolutionary algorithm

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140702