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

A Genetic Algorithm-Based Method for Automatically Generating Data Flow Test Cases

A test case and genetic algorithm technology, applied in the field of automatic generation of data flow test cases based on genetic algorithm, can solve the problems of no comparison of maximum fitness value of offspring, destruction of good genes, low algorithm efficiency, etc., to improve algorithm efficiency, Ensure the transmission of good genes and improve the effect of efficiency

Active Publication Date: 2016-08-17
中国航天系统科学与工程研究院
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the current automatic generation technology of data flow test cases based on genetic algorithm has the following problems: when the genetic algorithm performs crossover and mutation operations, the crossover and mutation points may be selected at any position in the individual genes, and the crossover and mutation operations produce good genes at the same time. There is also the possibility of destroying the existing good genes; in the iterative process, no comparison is made between the maximum fitness value of the offspring and the individual in the parent population, resulting in that no matter whether the offspring is better than the parent, it will be inherited from generation to generation
These problems lead to many iterations and low algorithm efficiency when generating test cases

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 Genetic Algorithm-Based Method for Automatically Generating Data Flow Test Cases
  • A Genetic Algorithm-Based Method for Automatically Generating Data Flow Test Cases
  • A Genetic Algorithm-Based Method for Automatically Generating Data Flow Test Cases

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0038] Such as figure 1 As shown, the present invention provides a method for automatically generating a data flow test case based on a genetic algorithm, and the steps are as follows:

[0039] (1) Using a pair (def, use) for a definition in the program P under test, find out the 1 Beginning and going through the dominator path dom of the use node use defining the node def def (n 1 , use);

[0040] dom def (n 1 ,use)=dom(n 1 , def)∪ dom(def, use)

[0041] Among them, dom(n 1 , def) means that by the entry node n 1 The path consisting of the nodes that must pass through to define the node def, dom(def, use) means the path composed of the nodes that must pass through from the definition node def to the use node use;

[0042] (2) According to the set genetic algorithm parameters and the value range and precision of the input variables, randomly generate the initial population InitPop, and assign it to the current population CurrentPop, that is, CurrentPop=InitPop, and as...

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 discloses a genetic algorithm-based method for automatically generating data flow test cases. At present, in the automatic generation technology of data stream test cases based on genetic algorithm, the crossover and mutation points of genetic algorithm are randomly selected at any position in the individual gene, which may destroy the existing good genes while producing good genes; Regardless of whether the individual maximum fitness value is greater than the individual maximum fitness value of the parent generation, it continues to be inherited downwards, prolonging the iterative process. The present invention finds a specific branch that does not satisfy the target path when calculating the fitness function, uses the structural information of the branch to constrain the range of crossover and mutation operations of the genetic algorithm, and compares the maximum fitness value of individuals in the offspring and parent populations, Discard those offspring that are lower than the fitness value of the parent, thus ensuring the transmission of good genes, reducing the number of iterations, and improving computational efficiency.

Description

technical field [0001] The invention relates to a test case automatic generation method, in particular to a genetic algorithm-based data flow test case automatic generation method, which belongs to the software structure test technology. Background technique [0002] Data flow testing is a code-based white-box testing technique that uses data flow relationships in programs to guide testers in selecting test cases. That is, certain test cases can be selected to make the program execute according to the definition-use path of a certain variable, and find program errors by checking whether the execution results are in line with expectations. Compared with control flow, software testing based on data flow examines the flow direction of each data, executes programs more deeply, and is more conducive to code testing. [0003] Test case generation is a key link in software testing, and its realization is of great significance to the automation of software testing process. Therefo...

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/36G06N3/12
Inventor 杨桂枝郑平张辉张伟詹海潭高金梁
Owner 中国航天系统科学与工程研究院
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