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

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

Example Embodiment

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

[0039] (1) For a definition use pair (def, use) in the tested program P, find out the entry node n 1 Start and go through the dominance path dom that defines the use of 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 the entry node n 1 The path composed of the nodes that must pass to define the node def, dom (def, use) represents the path composed of the nodes that must pass from the definition node def to the use node use;

[0042] (2) According to the set genetic algorithm parameters and the value range and accuracy of the input variables, randomly generate the initial population InitPop and assign it to the current population CurrentPop, namely CurrentPop=InitPop, and assign CurrentPop to the parent population Parent...

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 Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products