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

Active Publication Date: 2022-04-12
MUDANJIANG NORMAL UNIV
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, in the calculation of the fitness value of the above method, the branch distance is considered. The calculation of the branch distance needs to be calculated for each simple predicate. Assuming that a target path has h nodes, and each node has at least one simple predicate, then the branch distance calculation needs to be calculated. H, and then summed, if each node is a compound predicate, the amount of calculation will increase exponentially; when there is a flag phenomenon in the program (Binkley D.W., Harman M., Lakhotia K..F1agRemover: a testability transformation for transforming loop assigned flags [J].ACM Transactions onSoftware Engineering and Methodology,2009,2(3):110-146.), the fitness value cannot effectively guide the evolution, and thus becomes a random search; more importantly, when the branch corresponding to a certain node predicate If the distance is large, the branch distance to other nodes will be ignored, which greatly affects the real effect of evaluating individuals
In addition, considering the branch distance, layer proximity or individual contribution in the calculation of the fitness value will lead to a large amount of calculation and a long time consumption.
Therefore, the above method cannot achieve fast high path coverage test case generation

Method used

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
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A Fast and High Path Coverage Test Case Generation Method
  • A Fast and High Path Coverage Test Case Generation Method
  • A Fast and High Path Coverage Test Case Generation Method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0029] Embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings.

[0030] basic concept

[0031] For the convenience of introduction, some basic concepts related to the program under test are given first.

[0032] (1) Control flow graph

[0033] The control flow graph is a graphical representation of the control structure of the program under test. It is a directed graph G(N, E, s, e), where N is called the node set of the graph G, corresponding to a certain statement of the program; E is called the edge set of graph G, i , node j ) is called the edge of G, which means from the statement node i to statement node j Control flow exists. The control flow graph of each program also contains a unique entry node s and exit node e, such as figure 2 yes figure 1 The control flow graph corresponding to the triangle classification source program.

[0034] In the control flow graph, a node with an out degree greater tha...

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

PUM

No PUM Login to view more

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.

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

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F11/36
Inventor 范书平马宝英宋妍高颂玥邢玮桐
Owner MUDANJIANG NORMAL UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products