A Fast and High Path Coverage Test Case Generation Method

A test case generation and high-path technology, which is applied in software testing/debugging, etc., can solve the problems that the adaptation value cannot effectively guide the evolution, the increase of calculation amount, and the calculation amount of the algorithm are large, so as to improve the path coverage rate and reduce the generation time Effect
CN109918304BActive Publication Date: 2022-04-12MUDANJIANG NORMAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MUDANJIANG NORMAL UNIV
Publication Date
2022-04-12

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The present invention provides a method for quickly generating test cases with high path coverage, the method comprising: obtaining the control flow graph of the target program, determining the parent-child relationship in each node in the control flow graph; judging whether each node is a branch node ; Obtain a test case set, use each test case as an individual in the genetic algorithm, and multiple individuals form an initial population; construct a branch traversing matrix; calculate the branch that passes through any branch node in the current generation population according to the constructed branch traversing matrix Deviation degree; calculate the branch deviation degree of all branch nodes in the program, and take the sum of the branch deviation degrees of all branch nodes as the program deviation degree of the individual traversal program in the current generation population; use genetic algorithm, according to the constructed branch traversal matrix And the program deviation is iteratively optimized to obtain the next-generation population and the program deviation of the next-generation population passing through the program under test, until a test case covering the target path is generated or the maximum evolutionary number of the genetic algorithm is reached.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the field of software testing, in particular to the generation of test cases in software testing. Background technique

[0002] Software testing is an important means to ensure the quality of software products, and automatic generation of test data is the focus and difficulty of software testing. In recent years, some scholars have studied the application of evolutionary theory to generate test data that meets the path coverage criteria, and proposed many new methods that use genetic algorithms to automatically generate test data that cover the target path. As we all know, the design of fitness function is the key of genetic algorithm. For example, McMinn (McMinn P. Evolutionary search for test data in the presence of state behavior [D]. University of Sheffield, England, 2005) normalizes the branch distance to [0,1), and gives the normalized branch distance and layer The fitness value function of the proximity, and minimize t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More