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

Test method and system based on software defect mode

A software defect and defect mode technology, applied in software testing/debugging, etc., can solve problems such as software failures, security vulnerabilities, insufficient test accuracy, and false negatives, and achieve short test time, high degree of automation, and reduced errors. reported effect

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

AI Technical Summary

Problems solved by technology

[0006] (2) Pattern-based software testing techniques can often find faults that are difficult to find by other testing techniques
When testing a program that has been tested and put into operation for a long time as illustrated above, a large number of software faults, security loopholes, and security risks are still detected
[0007] Although pattern-based testing methods have many advantages over other testing techniques, some existing pattern-based testing methods still have problems of false positives, false negatives, and insufficient test accuracy.

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
  • Test method and system based on software defect mode
  • Test method and system based on software defect mode
  • Test method and system based on software defect mode

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0126] Example 1: During the traversal of the control flow graph, each state of the defect state machine instance is associated with a precondition, which consists of a series of variables and their value ranges. If the value range of a variable in the precondition of a certain state is empty, it means that the state is an impossible state, that is, an unreachable path has been found. Some testing tools in the past may report defects on unreachable paths However, the DTS system of the present invention can identify the defect on the unreachable path, and will not report it as a defect, thus reducing false positives. As in this example, refer to Figure 5 , a piece of program code under test and the state changes of the corresponding control flow graph node defect state machine are as follows, where n1~n8 are eight nodes:

[0127] int logLevel;

[0128]  …

[0129] PrintWriter log = null;

[0130] if(logLevel>0) log = new PrintWriter(...);

[0131] if(logLevel>3)log.printl...

example 2

[0141] Example 2: As shown in this example, each use case will generate a null pointer reference fault, if the corresponding part of the source code is replaced with the comment code, the null pointer fault will not be generated. In the entry, v represents the case where x is a local variable, and f represents the case after changing x to a member variable. One v means that the fault is reported correctly, two v means that the fault is reported before and after the code replacement, and one of them is a false positive; the f is similar, one f means that the fault is correctly reported, and two fs represent that the code is reported before and after the replacement Faults, one of which is a false positive; blank means no fault was reported. The use case is as follows:

[0142] int intra(int level){int intra4(boolean b){int interl(boolean b){

[0143] Object x=null; Object x=null; Object x=null;

[0144] if(level>0) Object y=null; if(b / *!b* / )

[0145] x...

example 3

[0175] Example 3: In this example, the results of defect testing of Tomcat4.1.24 using different testing tools are shown in Table 2:

[0176]

[0177] Table 2

[0178] As can be seen from Table 2, it is obvious that when using the DTS system test, compared with other existing test tools, the DTS system using the method of the present invention has a high accuracy rate and defect detection rate, and a lower error rate. rate.

[0179]The DTS system that has used the method of the present invention, its advantage also lies in:

[0180] The test time is short. For the same program to be tested, since the test speed of the program static analysis mode itself is faster than that of the program dynamic analysis, that is, the test time is relatively short. Can test multiple types of software defect patterns at the same time, and the test of multiple types of software defect patterns can share a lot of information, such as variable values, which shortens the test time; the DTS sy...

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 testing method based on software defect mode, comprising the steps of: reading source code files of programs to be tested and SDSM description file of a defect state machine, carrying out pre-processing of the programs to be tested, analyzing the SDSM description file; carrying out lexical analysis and grammar analysis of the programs to be tested and constructing abstract syntax tree; generating a control flow graph and a symbol table according to the abstract syntax tree and carrying out the calculating and updating of variable value interval sets according to the control flow graph and the symbol table; carrying out function invoking relation analysis of the programs to be tested and generating a function invoking relation graph; searching the control flow graph by taking the function as unit according to the function invoking relation graph, calculating the state migration of each node defect state machine on the control flow graph, and reporting corresponding checking point when the defect state machine enters the defect state. The invention also discloses a testing system based on software defect mode, which comprises an input module, a defect mode uniformity testing frame and a user interface module and completes the uniform test on the programs to be tested.

Description

technical field [0001] The invention relates to software testing technology, in particular to a testing method and system based on a software defect mode. Background technique [0002] Program static analysis is a research hotspot in current software engineering. One of the main advantages of this type of method is that in software testing, it can quickly and automatically scan a large number of program source codes and find potential faults. There are many static analysis methods, such as: symbolic execution, theorem proving, abstract interpretation, type inference, model checking, detection based on program style and annotations, etc. However, some of these methods are too complicated to implement, making it difficult to test large-scale programs. Although some methods are relatively simple, they will cause too many false positives and are difficult to be practical. Pattern-based software testing technique is also a static analysis method. Unlike formal verification, suc...

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): G06F11/36
Inventor 宫云战陈俊亮杨朝红肖庆王雅文
Owner BEIJING UNIV OF POSTS & TELECOMM
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