Software test case automatic generating method and system

A technology of automatic generation and software testing, applied in the direction of software testing/debugging, program control devices, etc., can solve the problems of low testing efficiency, time-consuming and high cost, and achieve the effect of improving efficiency, automation and accuracy.

Inactive Publication Date: 2009-05-20
BEIJING UNIV OF POSTS & TELECOMM
View PDF0 Cites 96 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The disadvantages of these two methods of generating test cases are:
[0006] 1) It takes a lot of time to generate use cases, and the test efficiency is low;
[0007] 2) It requires a very professional software tester who is familiar with the software under test;
[0008] 3) The reliability of the test effect is low
[0009] Since the 1990s, the cost of software testing and maintenance has become higher and higher. In my country, it has basically reached 30% to 50% of the total software development cost. In the United States, this figure has reached more than 50%, and some even as high as More than 80%, in this proportion, a considerable part of it is labor costs, and in the process of software testing, artificially generating test cases occupies a large part of the time
[0010] The automatic generation of test cases has always been one of the goals pursued by software testing technology, but this is an extremely complicated problem. Many scientists in the world have made great efforts for this, but the effect is not very satisfactory. In terms of research level, there is still a considerable distance from the actual use

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
  • Software test case automatic generating method and system
  • Software test case automatic generating method and system
  • Software test case automatic generating method and system

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0156] Example 1: Calendar conversion program calconv(source, year, month, date, days). The program is written in C++ and includes three modules, namely the main program, the leap year judgment program GetLeap and the conversion calculation program calconv.

example 2

[0157]Example 2: Draw a sector program: draw a sector from the center, radius, and the angle between the start and end points. The function form is Scir2(row, col, a, b, t1, t2, color, xor).

[0158] Table 1 is the program description, as shown in Table 1.

[0159]

program name

Rows

target

number of blocks

target

variable

number

branch

number

path

number

branch contradiction

Computational paradox

number of paths contradiction

path

Proportion calconv 165 71 5 54 32408 31124 96% Scir2 129 55 6 51 110598 91392 83%

[0160] Table 1

[0161] 1) (Branch coverage test is to cover each branch of the program, and path coverage is to cover each valid path (reachable path) of the program) Branch coverage test (E here is a branch): randomly generate test cases, check The effect of different search regions on test efficiency. Table 2 shows the branch coverage t...

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 method for automatically generating software test cases. The method comprises the following steps of: A. reading to-be-tested software, carrying out lexical analysis, syntax analysis and semantic analysis on a source program of the to-be-tested software and generating an abstract syntax tree and a control flow graph of the to-be-tested software; B. preprocessing the source program of the to-be-tested software by traversing the generated abstract syntax tree, identifying initial input-output variables and compressing the space of a definition domain of the initial input variables; and C. generating a path of program elements of the current to-be-tested software by traversing the control flow graph, carrying out assignment operation, implication operation and backtracking operation on the variables in the path, and generating the test cases. The invention also provides a system for automatically generating software test cases. The method and the system for automatically generating the software test cases can accurately and automatically generate the test cases according to the given program elements of the to-be-tested software and verify the generated test cases, thereby improving the accuracy, efficiency and automation degree of the test cases.

Description

technical field [0001] The invention relates to software testing technology, in particular to a method and system for automatically generating software test cases. Background technique [0002] Software testing technology is developing in depth, and new and efficient software testing methods are constantly emerging. Statistics show that at this stage, about 40% of all software testing expenses are spent on test cases, including generating test data and checking test results. , about 50% is spent on writing and compiling scripts, and about 10% is spent on test script execution and configuration management. [0003] Among many software testing methods, coverage testing is the most commonly used testing method. The so-called coverage testing means that for a given element E, first select a path P containing element E, and then generate a test case C of path P, If the test case C does not exist, another path P' should be selected. If the path P' does not exist, it means that th...

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 Applications(China)
IPC IPC(8): G06F9/44G06F11/36
Inventor 宫云战杨朝红陈俊亮肖庆张威王雅文
Owner BEIJING UNIV OF POSTS & TELECOMM
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