Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Rapid high-path coverage rate test case generation method

A test case generation, high-path technology, applied in software testing/debugging and other directions, can solve the problem that the fitness value cannot effectively guide the evolution, the calculation amount increases, and becomes a random search, so as to improve the path coverage and shorten the generation time. Effect

Active Publication Date: 2019-06-21
MUDANJIANG NORMAL UNIV
View PDF3 Cites 2 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
  • Rapid high-path coverage rate test case generation method
  • Rapid high-path coverage rate test case generation method
  • Rapid high-path coverage rate 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, (node 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 great...

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 invention provides a rapid high-path coverage rate test case generation method, which comprises the following steps of: obtaining a control flow graph of a target program, and determining father-child relations in multiple nodes in the flow graph; judging whether each node is a branch node or not; obtaining a test case set, taking each test case as an individual in a genetic algorithm, and forming an initial population by a plurality of individuals; constructing a branch crossing matrix; calculating a branch deviation degree of crossing any one branch node in the current generation population according to the constructed branch crossing matrix; Calculating the branch deviation degrees of all the branch nodes in the program, and taking the sum of the branch deviation degrees of all thebranch nodes as the program deviation degree of the individual traversing program in the current generation of population; and performing iterative optimization according to the constructed branch crossing matrix and the program deviation degree by using a genetic algorithm, and obtaining the next generation of population and the program deviation degree of the next generation of population crossing the tested program until a test case covering the target path is generated or the maximum evolution algebra 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
IPC IPC(8): G06F11/36
Inventor 范书平马宝英宋妍高颂玥邢玮桐
Owner MUDANJIANG NORMAL UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products