CN112749082B - Test case generation method and system based on DE-TH algorithm - Google Patents

Test case generation method and system based on DE-TH algorithm Download PDF

Info

Publication number
CN112749082B
CN112749082B CN202010394716.XA CN202010394716A CN112749082B CN 112749082 B CN112749082 B CN 112749082B CN 202010394716 A CN202010394716 A CN 202010394716A CN 112749082 B CN112749082 B CN 112749082B
Authority
CN
China
Prior art keywords
hypercube
topological
test
algorithm
dimension
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010394716.XA
Other languages
Chinese (zh)
Other versions
CN112749082A (en
Inventor
苏清华
蔡高成
胡中波
周婷
刘笛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yangtze University
Original Assignee
Yangtze University
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 Yangtze University filed Critical Yangtze University
Priority to CN202010394716.XA priority Critical patent/CN112749082B/en
Publication of CN112749082A publication Critical patent/CN112749082A/en
Application granted granted Critical
Publication of CN112749082B publication Critical patent/CN112749082B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a test case generation method and a test case generation system based on a DE-TH algorithm, wherein the method comprises the following steps: performing static analysis on a tested program, and extracting static structure information of the tested program; generating a new test population based on a differential evolution DE-TH algorithm of a topological hypercube learning strategy and the static structure information; and after the current iteration is finished, decoding the new population into a test case set meeting the tested program. The topological hypercube learning THBL strategy adopted by the embodiment of the invention fully utilizes the information of the current optimal individual, and improves the local exploitation capability of the differential evolution algorithm, thereby effectively balancing the local exploitation capability and the global exploration capability of the differential evolution algorithm. The DE-TH algorithm has stronger covering capability, reduces the probability of uncovering found paths, and reduces the consumption of test cases and time.

Description

Test case generation method and system based on DE-TH algorithm
Technical Field
The invention relates to the technical field of software testing, in particular to a test case generation method and system based on a DE-TH algorithm.
Background
Software testing is one of the important means for ensuring the quality of software. With the development of the technology, the software complexity is higher and higher, and the difficulty and the workload of software testing are higher and higher. At present, automated software testing is considered to be one of effective methods for improving software testing efficiency.
Most studies in this field consider structural tests (white box tests). One of the most important tasks of structural testing is to find a set of test cases in the whole search space to satisfy certain coverage criteria, such as statement coverage, branch coverage, condition combination coverage, path coverage, etc. Wherein path coverage may more efficiently discover software errors. Automatic test case generation (ATCG-PC) oriented to path coverage has been a research hotspot in academia and industry since the introduction.
In recent years, meta-heuristic algorithms have been widely used and studied in solving the ATCG-PC problem. The basic idea of solving the ATCG-PC problem by the meta-heuristic algorithm is to model the ATCG-PC problem into a combinatorial optimization problem, and the optimization aims to generate effective test cases to cover more paths of tested software with the least cost.
The experimental results of the existing documents show that some meta-heuristic algorithms are superior to some traditional test case generation methods in both resource consumption and software fault discovery capability. Although these metaheuristic algorithms show certain advantages in test case generation, some problems still remain. Such as how to transform the meta-heuristic to accommodate the requirements of test case generation and how to handle unknown relationships between test cases and software paths. This unknown relationship means that the test cases generated by the meta-heuristic algorithm may continuously cover the discovered paths, thereby causing unnecessary consumption.
Therefore, there is a need for an efficient test case generation method to solve the above problems.
Disclosure of Invention
The present invention provides a test case generation method and system based on the DE-TH algorithm that overcomes or at least partially solves the above-mentioned problems.
In a first aspect, the present invention provides a test case generation method based on a DE-TH algorithm, including:
carrying out static analysis on a tested program, and extracting static structure information of the tested program;
generating a new test population based on the DE-TH algorithm and the static structure information;
and after the current iteration is finished, decoding the new population into a test case set meeting the tested program.
After the current iteration is completed and the new population is decoded into a test case set meeting the tested program, the method further comprises the following steps:
and inputting the test case set as data of the tested program so as to detect the defects of the tested program.
After the test case set is used as data input of a program under test to detect defects of the program under test, the method further comprises the following steps:
and driving the tested program, recording an output result, and updating the path coverage information and the test suite.
Wherein, after the driving the tested program and recording the output result, and updating the path coverage information and the test suite, the method further comprises:
and if the DE-TH algorithm does not reach the termination condition, calculating a fitness function value of the test case, and updating the current population by using a greedy selection mechanism to generate a next generation population. Otherwise, the algorithm is terminated.
Wherein, the static analysis of the tested program and the extraction of the static structure information of the tested program comprise:
and extracting parameters such as types and ranges of the test data and a path set to be tested in the tested program.
Wherein the generating of the test new population based on the DE-TH algorithm and the static structure information comprises:
initializing a population based on the static structure information;
based on a difference strategy, realizing individual mutation of the population;
carrying out two-term crossing on the parent individuals and the mutant individuals;
based on a topological hypercube learning strategy, current optimal individual information is fully utilized for iteration;
generating a new test population.
According to a second aspect of the present invention, there is provided a test case generation system based on the DE-TH algorithm, comprising:
the static analysis module is used for carrying out static analysis on the tested program and extracting the static structure information of the tested program;
the DE-TH algorithm module is used for generating a new test population based on the DE-TH algorithm and the static structure information;
and the test case generation module is used for decoding the new population into a test case set meeting the tested program after the current iteration is finished.
According to a third aspect of the present invention, there is provided a computer program product comprising program code for executing a test case generation method based on the DE-TH algorithm as described above.
According to a fourth aspect of the invention, there is provided a non-transitory computer readable storage medium for storing the computer program as described above.
The invention provides a test case generation method and system based on a DE-TH algorithm. The Topological hypercube-based learning (THBL) strategy fully utilizes the information of the current optimal individual, and improves the local mining capability of the differential evolution algorithm, thereby effectively balancing the local mining capability and the global exploration capability of the differential evolution algorithm. The differential evolution (DE-TH) algorithm based on the topological hypercube learning strategy has stronger covering capability, reduces the probability of covering discovered paths, and reduces the consumption of test cases and time.
Drawings
FIG. 1 is a schematic flow chart of a test case generation method based on the DE-TH algorithm according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a test case automatic generation flow based on the DE-TH algorithm according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an operational process of the THBL policy provided by an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a test case generation system based on the DE-TH algorithm according to an embodiment of the present invention;
fig. 5 illustrates a schematic structural diagram of an electronic device.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
Fig. 1 is a schematic flowchart of a test case generation method based on the DE-TH algorithm according to an embodiment of the present invention, as shown in fig. 1, including:
101. carrying out static analysis on a tested program, and extracting static structure information of the tested program;
102. generating a test new population based on the DE-TH algorithm and the static structure information;
103. and after the current iteration is finished, decoding the new population into a test case set meeting the tested program.
It can be understood that the embodiment of the present invention automatically generates test cases based on a DE-TH (Differential evolution based on a topological hypercube learning strategy) algorithm, and aims to generate some effective test cases with as little cost as possible to cover more paths of the tested software.
Specifically, in step 101, the embodiment of the present invention performs static analysis on the program under test, and extracts the relevant static structure information.
Further, in step 102, a new population is generated using the DE-TH algorithm. And determining basic parameters of the DE-TH algorithm according to the related parameters extracted in the step1, wherein the basic parameters comprise the size of a search space, the size of a population scale and the like. And then carrying out sensitivity analysis on the scaling factor, the cross probability and the search step length control parameter k of the DE-TH algorithm to determine the most appropriate values of the scaling factor, the cross probability and the search step length control parameter k. And finally, executing a DE-TH algorithm to generate a test new population. I.e., after initializing the population, mutation, crossover, THBL strategies are performed to generate a new population. Wherein, when a certain condition is satisfied (the random number between one [0,1] is smaller than that between the other [0,1 ]), the THBL strategy is executed.
Finally, in step 103, after the iteration is completed, a new test case set can be generated.
The THBL strategy adopted by the embodiment of the invention fully utilizes the information of the current optimal individual, and improves the local mining capability of the differential evolution algorithm, thereby effectively balancing the local mining capability and the global exploration capability of the differential evolution algorithm. The DE-TH algorithm has stronger covering capability, reduces the probability of uncovering found paths, and reduces the consumption of test cases and time.
On the basis of the above embodiment, the performing static analysis on the program under test and extracting the static structure information of the program under test include:
and extracting parameters such as types and ranges of the test data and a path set to be tested in the tested program.
It can be understood that, in the embodiment of the present invention, the source program is first statically analyzed, and the static structure information of the source program and the path set to be tested in the program under test are extracted. The extracted relevant parameters are used as the parameters of the DE-TH algorithm. Fig. 2 is a flowchart of automatic test case generation based on the DE-TH algorithm according to an embodiment of the present invention, and the process is shown as step1 labeled in fig. 2.
On the basis of the above embodiment, the generating a test new population based on the DE-TH algorithm and the static structure information includes:
initializing a population based on the static structure information;
based on a difference strategy, realizing individual mutation of the population;
carrying out binomial crossing on the parent individuals and the mutant individuals;
based on a topological hypercube learning strategy, current optimal individual information is fully utilized for iteration;
generating a new test population.
As shown in step2 in FIG. 2, the DE-TH algorithm is a key part of the automatic generation of software test cases. Firstly, determining basic parameters of a DE-TH algorithm according to the static structure information extracted in the step1, wherein the basic parameters comprise the size of a search space, the size of a population scale and the like. And taking the maximum value of the path coverage rate reaching 100% or the number of test cases as a termination condition of the algorithm. In addition, sensitivity analysis is carried out on the scaling factor, the cross probability and the search step length control parameter k of the DE-TH algorithm, and the most appropriate value of the scaling factor, the cross probability and the search step length control parameter k is determined. And finally, executing a DE-TH algorithm to generate a new test population, wherein the detailed process is as follows:
first, population initialization is performed, and all dimensions of individuals of an initial population are generated by uniformly distributed random numbers.
Then mutation operations are performed, and individual mutations are realized by using a differential strategy. Randomly selecting 3 different individuals from the parent to generate a mutant individual vi。viCan be expressed as:
vi=xi1+F*(xi2-xi3) i1≠i2≠i3≠i;
where i ═ 1,2, L, N, j ═ 1,2, L, D, N, and D are the size of the population size and the size of the individual dimensions. x is the number ofi1、xi2And xi3Respectively, 3 different individuals randomly selected in the parent, and F denotes a scaling factor.
Then carrying out cross operation, carrying out binomial cross operation on the parent individuals and the mutant individuals to generate test individuals uiThereby keeping the diversity of the population. I.e. when one [0,1]]When the random number between the two is less than or equal to the cross probability or the current dimension index is equal to a randomly generated dimension index, v is usedi,jTo update ui,j(ii) a Otherwise, use xi,jUpdating ui,j. The update process is as follows:
Figure BDA0002487075790000071
in the formula ui,jRepresents the j dimension of the i test individual; v. ofi,jRepresents the j dimension of the i mutant individual; x is the number ofi,jA j-th dimension representing an ith parent individual; CR represents the cross probability; j is a function ofrandRepresenting a randomly generated dimension index in the j-th dimension.
The THBL policy is then executed. The THBL strategy fully utilizes the information of the current optimal individual and has strong local mining capacity. The DE-TH algorithm may be trapped in local optima if the THBL strategy is implemented in every generation of evolution of the DE-TH algorithm. To solve this problem, the present invention implements the THBL strategy only during a partial iteration of the DE-TH algorithm. That is, the THBL policy is executed when a jump condition is satisfied (a random number between one [0,1] is smaller than that between the other [0,1 ]). The method can effectively balance the local mining and global exploration capabilities of the differential evolution algorithm, thereby improving the coverage capability of the DE-TH algorithm. The detailed steps of the THBL strategy are as follows:
for a D-dimension test individual (point) uiThe THBL strategy is based on the current number u in each dimension of the trial individuali,jGenerating opponent numbers
Figure BDA0002487075790000081
Then ui,jAnd
Figure BDA0002487075790000082
control parameter k generation based on one same search step
Figure BDA0002487075790000083
And
Figure BDA0002487075790000084
recording UpjAnd LowjIs the upper and lower limits of the individual in the j-th dimension,
Figure BDA0002487075790000085
and
Figure BDA0002487075790000086
the calculation method of (2) is as follows:
Figure BDA0002487075790000087
Figure BDA0002487075790000088
Figure BDA0002487075790000089
Figure BDA00024870757900000810
in particular, it is possible to use, for example,
Figure BDA00024870757900000811
and
Figure BDA00024870757900000812
is also a pair of opposite numbers.
Next, the THBL strategy will uiWith certain dimensions of
Figure BDA00024870757900000813
And
Figure BDA00024870757900000814
replacement with one of them generates a new point and finally (4)D-1) new points. To this end (4)D-1) both the point and the current point are called topological hypercube points, denoted
Figure BDA00024870757900000815
Set of topological hypercube points is denoted as
Figure BDA00024870757900000816
Then, the current optimal solution x is usedbestThe topological hypercube point with the shortest Manhattan distance
Figure BDA00024870757900000817
To update the current point ui. The process is as follows:
Figure BDA00024870757900000818
here, the
Figure BDA00024870757900000819
In the formula, xbest,jIs the j-th dimension of the current optimal solution;
Figure BDA00024870757900000820
is the j-th dimension of the l-th topological hypercube point.
Fig. 3 is a schematic diagram of an operation process of the THBL policy provided by the embodiment of the present invention. As shown in FIG. 3(a), in the one-dimensional search space, the THBL strategy is the current point uiGenerating (4-1) points, and updating u with the topological hypercube point (square in the figure) with the shortest Manhattan distance to the current optimal individual (triangle in the figure)i. Also, as shown in fig. 3(b) and (c), in a 2-dimensional or 3-dimensional search space, the THBL strategy generates (4) for the current point (the open circle in the figure)D-1) new points (filled circles and squares in the figure) and then update u with the topological hypercube point (square in the figure) with the shortest manhattan distance to the current optimal individual (triangle in the figure)i
On the basis of the above embodiment, after the current iteration is completed and the new population is decoded into a test case set satisfying a program under test, the method further includes:
and taking the test case set as data input of the tested program to detect the defects of the tested program.
As shown in step3 of fig. 2, after the current iteration is completed, the population generated by the DE-TH algorithm is decoded into a test case set satisfying the program under test, and the test case set is used as the data input of the program under test in the test driver module to detect the defect of the program under test.
On the basis of the above embodiment, after the test case suite is used as data input of a program under test to detect a defect of the program under test, the method further includes:
and driving the tested program, recording an output result, and updating the path coverage information and the test suite.
As shown in step4 and step5 of FIG. 2, after the population of the DE-TH algorithm is decoded into test cases, the test cases are transmitted to the tested program of the test driver module. And driving the tested program, recording and analyzing an output result, and updating the path coverage information and the test suite.
On the basis of the above embodiment, after the driving the tested program and recording the output result, and updating the path coverage information and the test suite, the method further includes:
and judging whether the DE-TH algorithm reaches a termination condition.
If the termination condition of the algorithm is not met, the fitness function value of the test case is computed, the current population is updated with a greedy selection mechanism to generate the next generation population, and the process returns to step2, as shown in step6 of FIG. 2. Otherwise, the algorithm is terminated.
The embodiment of the invention also carries out experimental verification, in the experimental part, 8 tested programs widely applied by other researchers are selected as detection objects, and each program considers three different input ranges. And when the maximum value of 100% path coverage or the number of test cases is reached, evaluating the number of test cases of each algorithm to verify the effectiveness of the DE-TH algorithm on the ATCG-PC problem. The experimental result shows that the DE-TH algorithm has stronger competitiveness and superiority in solving the ATCG-PC problem. Namely, the DE-TH algorithm improves the automatic generation efficiency of the test case facing the path coverage and reduces the test cost.
Fig. 4 is a schematic structural diagram of a test case generation system based on the DE-TH algorithm according to an embodiment of the present invention, as shown in fig. 4, including: a static analysis module 401, a DE-TH algorithm module 402, and a test case generation module 403, wherein:
the static analysis module 401 is configured to perform static analysis on a program to be tested, and extract static structure information of the program to be tested;
the DE-TH algorithm module 402 is used for generating a test new population based on the DE-TH algorithm and the static structure information;
the test case generation module 403 is configured to decode the new population into a test case set meeting the program under test after the current iteration is completed.
Fig. 5 illustrates a schematic structural diagram of an electronic device, and as shown in fig. 5, the server may include: a processor (processor)501, a communication Interface (Communications Interface)502, a memory (memory)503 and a bus 504, wherein the processor 501, the communication Interface 502 and the memory 503 are all communicated with each other via the bus 504. The communication interface 504 may be used for information transmission between the server and the smart tv. The processor 501 may call logic instructions in the memory 503 to perform the following method: carrying out static analysis on a tested program, and extracting static structure information of the tested program; generating a new test population based on the DE-TH algorithm and the static structure information; and after the current iteration is finished, decoding the new population into a test case set meeting the tested program.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: carrying out static analysis on a tested program, and extracting static structure information of the tested program; generating a new test population based on the DE-TH algorithm and the static structure information; and after the current iteration is finished, decoding the new population into a test case set meeting the tested program.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the above method embodiments, for example, including: carrying out static analysis on a tested program, and extracting static structure information of the tested program; generating a test new population based on the DE-TH algorithm and the static structure information; and after the current iteration is finished, decoding the new population into a test case set meeting the tested program.
Those of ordinary skill in the art will understand that: all or part of the steps of implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer-readable storage medium, and when executed, executes the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, the method of the present application is only a preferred embodiment and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. A test case generation method of a differential evolution DE-TH algorithm based on a topological hypercube learning strategy is characterized by comprising the following steps:
carrying out static analysis on a tested program, and extracting static structure information of the tested program;
generating a new test population based on a differential evolution DE-TH algorithm of a topological hypercube learning strategy and the static structure information; the method comprises the following steps:
initializing a population based on the static structure information;
based on a difference strategy, realizing individual mutation of the population;
carrying out two-term crossing on the parent individuals and the mutant individuals; wherein, the parent individuals and the mutant individuals are subjected to binomial cross operation to generate test individuals uiSo as to further keep the diversity of the population; when one is [0,1]]When the random number between the two is less than or equal to the cross probability or the current dimension index is equal to a randomly generated dimension index, v is usedi,jTo update ui,j(ii) a Otherwise, use xi,jUpdating ui,j(ii) a The update process is as follows:
Figure FDA0003627960440000011
in the formula ui,jRepresents the j dimension of the i test individual; v. ofi,jRepresents the j dimension of the i mutant individual; x is the number ofi,jRepresenting the ith parentDimension j; CR represents the cross probability; j is a function ofrandRepresenting a randomly generated dimension index in the j-th dimension;
based on a topological hypercube learning strategy, current optimal individual information is fully utilized for iteration; wherein, when a jump condition is satisfied, the topological hypercube learning strategy is executed; for a D-dimension trial individual uiThe topological hypercube learning THBL strategy is based on the current number u in each dimension of the trial individuali,jGenerating an opponent number
Figure FDA0003627960440000012
Then ui,jAnd
Figure FDA0003627960440000013
control parameter k generation based on one same search step
Figure FDA0003627960440000014
And
Figure FDA0003627960440000015
recording UpjAnd LowjIs the upper and lower limits of the individual in the j-th dimension,
Figure FDA0003627960440000016
and
Figure FDA0003627960440000017
the calculation method of (2) is as follows:
Figure FDA0003627960440000021
Figure FDA0003627960440000022
Figure FDA0003627960440000023
Figure FDA0003627960440000024
Figure FDA0003627960440000025
and
Figure FDA0003627960440000026
is a pair of opposite numbers;
next, the topological hypercube learning THBL strategy will uiWith certain dimensions of
Figure FDA0003627960440000027
And
Figure FDA0003627960440000028
replacement with one of them generates a new point and finally (4)D-1) new points; handle this (4)D-1) both the point and the current point are called topological hypercube points, denoted as
Figure FDA0003627960440000029
l=1,2,...,4DThe set of topological hypercube points is noted
Figure FDA00036279604400000210
Then, the current optimal solution x is usedbestThe topological hypercube point with the shortest Manhattan distance
Figure FDA00036279604400000211
To update the current point ui(ii) a The process is as follows:
Figure FDA00036279604400000212
here, the
Figure FDA00036279604400000213
In the formula, xbest,jIs the j-th dimension of the current optimal solution;
Figure FDA00036279604400000214
is the j-th dimension of the l-th topological hypercube point;
generating a new test population;
and after the current iteration is finished, decoding the new population into a test case set meeting the tested program.
2. The method for generating test cases of a differential evolution DE-TH algorithm based on a topological hypercube learning strategy according to claim 1, wherein after the current iteration is completed, the new population is decoded into a test case set satisfying a tested program, and the method further comprises:
and inputting the test case set as data of the tested program so as to detect the defects of the tested program.
3. The method for generating test cases of the differential evolution DE-TH algorithm based on the topological hypercube learning strategy according to claim 2, wherein after the test case set is used as data input of a program under test to detect defects of the program under test, the method further comprises:
and driving the tested program, recording an output result, and updating the path coverage information and the test suite.
4. The method for generating test cases of the differential evolution DE-TH algorithm based on the topological hypercube learning strategy according to claim 3, wherein after the driving of the tested program and the recording of the output result, and the updating of the path coverage information and the test suite, the method further comprises:
and if the differential evolution DE-TH algorithm of the topological hypercube learning strategy does not reach the termination condition, calculating a fitness function value of the test case, updating the current population by using a greedy selection mechanism to generate a next generation population, and otherwise, terminating the algorithm.
5. The method for generating the test case of the differential evolution DE-TH algorithm based on the topological hypercube learning strategy as claimed in claim 1, wherein the step of performing static analysis on the tested program and extracting the static structure information of the tested program comprises the steps of:
the type, range parameters and path set to be tested in the tested program of the test data are extracted.
6. A test case generation system of a differential evolution DE-TH algorithm based on a topological hypercube learning strategy is characterized by comprising the following steps:
the static analysis module is used for carrying out static analysis on the tested program and extracting the static structure information of the tested program;
the DE-TH algorithm module is used for generating a new test population based on a differential evolution DE-TH algorithm of a topological hypercube learning strategy and the static structure information; the DE-TH algorithm module is specifically configured to:
initializing a population based on the static structure information;
based on a difference strategy, realizing individual mutation of the population;
carrying out two-term crossing on the parent individuals and the mutant individuals; wherein, the parent individuals and the mutant individuals are subjected to binomial cross operation to generate test individuals uiSo as to further keep the diversity of the population; when one is [0,1]]When the random number between the two is less than or equal to the cross probability or the current dimension index is equal to a randomly generated dimension index, v is usedi,jTo update ui,j(ii) a Otherwise, use xi,jUpdating ui,j(ii) a The updating process is as follows:
Figure FDA0003627960440000041
in the formula ui,jRepresents the j dimension of the i test individual; v. ofi,jRepresents the j dimension of the i mutant individual; x is the number ofi,jA j-th dimension representing an ith parent individual; CR represents the cross probability; j is a function ofrandRepresenting a randomly generated dimension index in the j-th dimension;
based on a topological hypercube learning strategy, current optimal individual information is fully utilized for iteration; wherein, when a jump condition is satisfied, the topological hypercube learning strategy is executed; for a D-dimension trial individual uiThe topological hypercube learning THBL strategy is based on the current number u in each dimension of the trial individuali,jGenerating opponent numbers
Figure FDA0003627960440000042
Then ui,jAnd
Figure FDA0003627960440000043
control parameter k generation based on one same search step
Figure FDA0003627960440000044
And
Figure FDA0003627960440000045
recording UpjAnd LowjIs the upper and lower limits of the individual in the j-th dimension,
Figure FDA0003627960440000046
and
Figure FDA0003627960440000047
the calculation method of (2) is as follows:
Figure FDA0003627960440000048
Figure FDA0003627960440000049
Figure FDA00036279604400000410
Figure FDA00036279604400000411
Figure FDA00036279604400000412
and
Figure FDA00036279604400000413
is a pair of opposite numbers;
next, the topological hypercube learning THBL strategy will uiWith certain dimensions of
Figure FDA00036279604400000414
And
Figure FDA00036279604400000415
replacement with one of them generates a new point and finally (4)D-1) new points; to this end (4)D-1) both the point and the current point are called topological hypercube points, denoted
Figure FDA0003627960440000051
l=1,2,...,4DThe set of topological hypercube points is noted
Figure FDA0003627960440000052
Then, the current optimal solution x is usedbestThe topological hypercube point with the shortest Manhattan distance
Figure FDA0003627960440000053
To update the current point ui(ii) a The process is as follows:
Figure FDA0003627960440000054
here, the
Figure FDA0003627960440000055
In the formula, xbest,jIs the j-th dimension of the current optimal solution;
Figure FDA0003627960440000056
is the j-th dimension of the l-th topological hypercube point;
generating a new test population;
and the test case generation module is used for decoding the new population into a test case set meeting the tested program after the current iteration is finished.
7. A non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the method of any one of claims 1 to 5.
CN202010394716.XA 2020-05-11 2020-05-11 Test case generation method and system based on DE-TH algorithm Active CN112749082B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010394716.XA CN112749082B (en) 2020-05-11 2020-05-11 Test case generation method and system based on DE-TH algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010394716.XA CN112749082B (en) 2020-05-11 2020-05-11 Test case generation method and system based on DE-TH algorithm

Publications (2)

Publication Number Publication Date
CN112749082A CN112749082A (en) 2021-05-04
CN112749082B true CN112749082B (en) 2022-06-24

Family

ID=75645195

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010394716.XA Active CN112749082B (en) 2020-05-11 2020-05-11 Test case generation method and system based on DE-TH algorithm

Country Status (1)

Country Link
CN (1) CN112749082B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468044B (en) * 2021-05-27 2022-06-24 长江大学 Test case generation method based on improved grey predictive evolution algorithm

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014053177A1 (en) * 2012-10-04 2014-04-10 Rohde & Schwarz Gmbh & Co. Kg A method and a test system for automatically configuring a tester
CN107391385A (en) * 2017-08-28 2017-11-24 北京航空航天大学 A kind of construction method of Generation of software test case technology
CN107590073A (en) * 2017-08-30 2018-01-16 华南理工大学 Automatic example generation method based on path Coverage Software Testing
CN108509335A (en) * 2018-01-31 2018-09-07 浙江理工大学 Software Test Data Generation Method based on genetic algorithm optimization
CN109597758A (en) * 2018-11-07 2019-04-09 电子科技大学 System level testing design optimization method based on PBI
CN111079228A (en) * 2019-12-19 2020-04-28 中国人民解放军国防科技大学 Pneumatic shape optimization method based on flow field prediction

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8898096B2 (en) * 2011-05-31 2014-11-25 Oracle International Corporation Application configuration generation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014053177A1 (en) * 2012-10-04 2014-04-10 Rohde & Schwarz Gmbh & Co. Kg A method and a test system for automatically configuring a tester
CN107391385A (en) * 2017-08-28 2017-11-24 北京航空航天大学 A kind of construction method of Generation of software test case technology
CN107590073A (en) * 2017-08-30 2018-01-16 华南理工大学 Automatic example generation method based on path Coverage Software Testing
CN108509335A (en) * 2018-01-31 2018-09-07 浙江理工大学 Software Test Data Generation Method based on genetic algorithm optimization
CN109597758A (en) * 2018-11-07 2019-04-09 电子科技大学 System level testing design optimization method based on PBI
CN111079228A (en) * 2019-12-19 2020-04-28 中国人民解放军国防科技大学 Pneumatic shape optimization method based on flow field prediction

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Automated Test Case Generation Based on DifferentialEvolution With Relationship Matrix for iFogSim Toolkit;Han Huang等;《https://ieeexplore.ieee.org/abstract/document/8412522》;20180718;全文第1-12页 *
一种基于拉丁超立方体抽样的多目标进化算法;郑金华等;《模式识别与人工智能》;20090415(第02期);第57-67页 *
基于择优学习策略的差分进化算法;刘昊等;《上海交通大学学报》;20170628(第06期);第66-70页 *
基于测试驱动开发的C语言教学研究;伍鹏等;《软件》;20120515(第05期);第109-110页 *

Also Published As

Publication number Publication date
CN112749082A (en) 2021-05-04

Similar Documents

Publication Publication Date Title
JP6954003B2 (en) Determining device and method of convolutional neural network model for database
US8700548B2 (en) Optimization technique using evolutionary algorithms
Zhu et al. EHSO: Evolutionary Hybrid Sampling in overlapping scenarios for imbalanced learning
KR20190117713A (en) Neural Network Architecture Optimization
Schulze-Riegert et al. Multiobjective optimization with application to model validation and uncertainty quantification
CN111047563B (en) Neural network construction method applied to medical ultrasonic image
CN111275172A (en) Feedforward neural network structure searching method based on search space optimization
CN112286824B (en) Test case generation method and system based on binary search iteration and electronic equipment
US11756649B2 (en) System, apparatus, and method for sequence-based enzyme EC number prediction by deep learning
US20200167660A1 (en) Automated heuristic deep learning-based modelling
Garza-Fabre et al. Multi-objectivization, fitness landscape transformation and search performance: A case of study on the hp model for protein structure prediction
CN113468044B (en) Test case generation method based on improved grey predictive evolution algorithm
Lity et al. Optimizing product orders using graph algorithms for improving incremental product-line analysis
CN115858848A (en) Image-text mutual inspection method and device, training method and device, server and medium
CN112749082B (en) Test case generation method and system based on DE-TH algorithm
CN114548296A (en) Graph convolution recommendation method based on self-adaptive framework and related device
CN112783513B (en) Code risk checking method, device and equipment
Chatterjee et al. Adaptive bilevel approximation technique for multiobjective evolutionary optimization
Anand et al. Information flow in parameterized quantum circuits
KR102559605B1 (en) Method and apparatus for function optimization
Bara’a et al. A new evolutionary multi-objective community mining algorithm for signed networks
Bouzarkouna et al. Well placement optimization under uncertainty with CMA-ES using the neighborhood
CN115248780A (en) Interface test case generation method and device
CN113111308B (en) Symbolic regression method and system based on data-driven genetic programming algorithm
CN115458040A (en) Method and device for generating protein, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant