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

MC/DC test data automatic generation method based on genetic algorithm

A technology of test data and genetic algorithm, applied in the field of automatic generation of test data that satisfies MC/DC coverage, can solve the problems of search degradation, lack of guidance information, and failure to consider the data dependencies of the program under test.

Active Publication Date: 2012-01-18
HARBIN ENG UNIV
View PDF4 Cites 68 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Aiming at the defect that the traditional fitness function in the genetic algorithm only relies on the control dependencies between the nodes in the control flow graph, and does not consider the data dependencies inside the program under test, it is proposed to use the link method to collect directly or indirectly affect the traversal of problem nodes through data dependencies. control nodes, and combine it with the traditional fitness function, which is good at representing control dependencies, to construct a new fitness function, so as to overcome the guidance caused by the traditional fitness function ignoring the data dependencies inside the program. The problem of lack of information and search degradation

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
  • MC/DC test data automatic generation method based on genetic algorithm
  • MC/DC test data automatic generation method based on genetic algorithm
  • MC/DC test data automatic generation method based on genetic algorithm

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0096] The present invention will be described in detail below in conjunction with the accompanying drawings.

[0097] The present invention proposes a method for automatically generating MC / DC test data based on a genetic algorithm, which includes generation of an abstract syntax tree, generation of an abstract analysis tree, generation of expected result sets of MC / DC test cases, code insertion, and fitness function The key content such as the structure of the genetic algorithm and the design of the genetic algorithm, the specific process is as follows: figure 1 As shown, it specifically includes the following steps:

[0098] Step 1: Perform static analysis on the program under test to generate information such as control flow graph, data flow graph, abstract syntax tree, and abstract analysis tree; the program under test refers to the software code to be tested.

[0099] With the help of analysis tools (such as the testing tool Testbed), the lexical analysis, syntax analys...

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 MC / DC (Modified Condition Decision Coverage) test data automatic generation method based on a genetic algorithm, comprising the following steps of: statically analyzing a tested program to generate a control flow graph, a data flow graph, an abstract syntax tree and an abstract analysis tree; generating a MC / DC test case expected result set; executing code instrumentation on the tested program; constructing a fitness function; randomly generating the test data, and checking whether the test data satisfies an expected execution path; and obtaining proper test data through genetic operations, such as selection, crossing, mutation and the like of the genetic algorithm. In the method, for construction of the fitness function, optimization of approximate-level fitness evaluation by a method of obtaining a control node directly or indirectly influencing defective node traversing through data dependency is proposed according to the thought of a chaining method and based on the conventional fitness function. The method has greater practical value for testing a system with complex logical relations.

Description

technical field [0001] The invention belongs to the technical field of software testing, in particular to a method for automatically generating MC / DC test data based on a genetic algorithm, in particular to a method for automatically generating test data satisfying MC / DC coverage (correction condition determination coverage) in engineering testing. Background technique [0002] Automatic test data generation technology refers to the automatic construction of test input data through specific algorithms based on software specifications or program structures. Trustworthiness. Genetic algorithm is an adaptive artificial intelligence technology that simulates biological evolution process and mechanism to solve extreme value problems. It has unique advantages in solving high-complexity problems such as large space and nonlinear problems. [0003] The idea of ​​dynamically executing programs to generate test data was first proposed by Miller and Spooner, and later scholars did a l...

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