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

Genetic-algorithm-based method for automatically generating data stream test cases

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

Active Publication Date: 2014-02-19
中国航天系统科学与工程研究院
View PDF3 Cites 21 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
  • Genetic-algorithm-based method for automatically generating data stream test cases
  • Genetic-algorithm-based method for automatically generating data stream test cases
  • Genetic-algorithm-based method for automatically generating data stream test cases

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0038] like 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 assig...

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 stream test cases. At present, in genetic-algorithm-based technologies of automatically generating data stream test cases, crossover and mutation points of a genetic algorithm are selected at free positions of individual genes randomly, good genes are produced, and meanwhile the possibility that existing good genes are damaged also exists; whether the maximum adaptation degree of each individual in an offspring population is greater than the maximum adaptation degree of each individual in a parent population or not, the offspring population continues to inherit, and an iteration process is prolonged. According to the genetic-algorithm-based method for automatically generating the data stream test cases, a specific branch which does not satisfy a target path is found when an adaptation function is calculated, structural information of the branch is used for constraining a range of crossover operation and mutation operation of the genetic algorithm, and meanwhile offspring with the adaptation degrees being greater than those of parents are abandoned by comparing the maximum adaptation degree of each individual in the offspring population with the maximum adaptation degree of each individual in the parent population; thus, transferring of the good genes is guaranteed, the number of iterations is reduced, and computational efficiency is improved.

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