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

Automatic Unit Test Execution Method Based on Test Case Automatic Generation Algorithm

A test case, automatic generation technology, applied in software testing/debugging, calculation, error detection/correction, etc., to simplify the test difficulty and test time, and reduce the cost of human resources and time.

Active Publication Date: 2022-03-29
SOUTH CHINA UNIV OF TECH
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Most dynamic testing methods are based on statement coverage or branch coverage, which is far less effective in detecting code bugs than path coverage methods

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
  • Automatic Unit Test Execution Method Based on Test Case Automatic Generation Algorithm
  • Automatic Unit Test Execution Method Based on Test Case Automatic Generation Algorithm
  • Automatic Unit Test Execution Method Based on Test Case Automatic Generation Algorithm

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0105] In this embodiment, the unit test automatic execution method based on the test case automatic generation algorithm comprises the following steps:

[0106] The first step is to input the source program to be tested, such as figure 2 As shown, perform file preprocessing

[0107] In the second step, the unit test automatic execution method based on the test case automatic generation algorithm conducts a global lexical analysis on the source program and establishes a path diagram for generating test codes, such as image 3 shown.

[0108] The third step is to insert the analysis code, convert the code in the judgment statement and insert the relevant global code. After inserting the code, the code file structure is as follows (the following code is for reference only):

[0109]

[0110]

[0111]

[0112]

[0113]

[0114]

[0115] The fourth step is to call the existing g++ and gcc environment to compile and execute the file after the code is inserted....

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 unit test automatic execution method based on a test case automatic generation algorithm. The method includes the following steps: firstly, preprocessing the code of the program to be tested and then performing lexical analysis, first establishing a path diagram for generating test code, and outputting the control flow diagram to a file, and then performing Fixed-point code insertion, compiling the file after the code is inserted. Then generate test cases according to the test case automatic generation algorithm, call the user code, traverse each code block of the user code, calculate the fitness algorithm fitness value, obtain the fitness fitness value and generate the path corresponding to the test case, when judging whether the path is fully covered or not Run timeout and exit. The invention is suitable for unit testing in the software development process, can automatically generate test cases through computer programs for code testing and automatically generate test reports, greatly reducing human resource costs and time costs.

Description

technical field [0001] The invention relates to the field of software testing of computer software engineering, in particular to an integrated method of automatic generation algorithm of test case based on path coverage and automatic execution of unit test. Background technique [0002] With the explosive growth of the number of software applications and the continuous development of the software industry, high-quality software has become a common demand of the industry and users, and high-quality software is always inseparable from a large number of tests. The IEEE Computer Society gives a clear definition of software testing in IEEE Std829-1983: the quality of software is measured by means of manual testing or automatic testing, and it is used to check whether the actual operation results of the software under test are comparable to the junior high school when the software was designed. Consistent. Since the traditional way of testing the software under test by manually g...

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/36
CPCG06F11/3684G06F11/3688
Inventor 黄翰连木明朱浩锋植浩聪谌小虎刘方青杨忠明汪疆平
Owner SOUTH CHINA UNIV OF TECH
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