Unlock instant, AI-driven research and patent intelligence for your innovation.

Method and system for automatically generating test cases

A test case and automatic generation technology, applied in software testing/debugging, error detection/correction, instruments, etc., can solve problems such as low operating efficiency, low degree of automation, and non-compliance of test cases, so as to improve operating efficiency and automation high effect

Active Publication Date: 2019-11-22
TSINGHUA UNIV
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0010] However, the above-mentioned three existing automatic test case generation technologies for JVM bytecode have their own shortcomings: the generation method based on the specification depends on the manual written formalized specification, and on the one hand, the requirements for the specification writer are relatively high: it is necessary to have The domain knowledge of the program to be tested must also master the domain-specific language for writing formal specifications; on the other hand, relying on manual writing of specifications cannot achieve complete automation
The generation method based on symbolic execution is expensive, and it cannot ensure that the generated test input of the reference type can be generated in a way that conforms to the calling convention of the program under test
Moreover, the generation method based on symbolic execution, on the one hand, is limited by the problem of path explosion (Path explosion) of symbolic execution itself, the problem of path divergence (Path divergence) and the problem that complex path constraints are difficult to solve, which will lead to low operating efficiency; On the other hand, although symbolic execution is effective in solving the test input of basic data types (such as int / float / bool), when constructing the test input of the structure object type, the object is often constructed by directly modifying the heap memory , it is very likely that the constructed object cannot be generated through the call sequence of the public function in the actual scene, resulting in the generated test cases not conforming to the calling convention of the program under test, which in turn makes the generated test cases difficult to be trusted by developers or testers
[0011] In summary, the existing test case generation methods have limitations such as low automation, low operating efficiency, and the generated test cases do not conform to the calling convention of the program under test.

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
  • Method and system for automatically generating test cases
  • Method and system for automatically generating test cases
  • Method and system for automatically generating test cases

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0033] like figure 1 As shown, an embodiment of the present invention provides a method for automatically generating test cases, including:

[0034] S1, based on the symbolic execution of the functions to be tested under different classes to be tested in the program to be tested, a test case seed whose variable parameter type is a basic data type...

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 embodiment of the invention provides an automatic generation method and system for a test case. The method comprises the following steps that: on the basis of a symbol, executing and generating atest case seed, and on the basis of heuristic search, carrying out mutation on the test case seed to obtain a first mutation test case; independently executing the test case seed and the first mutation test case, independently obtaining corresponding execution path information, and determining a mutation influence result; and according to the influence result, carrying out next mutation on the test case seed or the first mutation test case, and repeating the above processes until a preset condition is met. Artificial participation is not required, and an automation degree is high. Symbol execution and the heuristic search are combined to improve the operation efficiency of a whole method, in addition, a feedback mechanism is adopted, and the mutation influence result is used for guiding the test case seed or the first mutation test case to carry out next mutation. The method is favorable for generating the test case of a short function sequence, and is also suitable for generating thetest case of a long function sequence.

Description

technical field [0001] Embodiments of the present invention relate to the technical field of computer software testing, and more specifically, to a method and system for automatically generating test cases. Background technique [0002] At present, software has spread across major fields such as industrial production, national defense, scientific research, transportation, communication, medical care, and aerospace, and has also penetrated into people's daily lives. Software quality not only affects people's quality of life, but also affects the safe and stable development of the economy. Therefore, testing software quality is very important. Software testing is an effective and feasible means to detect software quality. As the software scale gradually increases and the complexity becomes higher and higher, the possibility of software problems also increases accordingly, and the challenges for software testing are also further enhanced. [0003] In order to achieve the sof...

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/3684
Inventor 姜宇杨镒箫任谦李天池顾明孙家广
Owner TSINGHUA UNIV