Static detection method for inaccessible route in program

A static detection and path technology, applied in software testing/debugging, etc., to achieve low manpower and time costs and improve efficiency

Inactive Publication Date: 2011-05-25
BEIJING UNIV OF POSTS & TELECOMM
View PDF3 Cites 31 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] In view of this, the main purpose of the present invention is to provide a static detection method for unreachable paths in a program, to solve the problem of invalid calculation of unreachable paths in software testing, to improve the efficiency of program static analysis and test case generation

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
  • Static detection method for inaccessible route in program
  • Static detection method for inaccessible route in program
  • Static detection method for inaccessible route in program

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0050] The static detection method of the present invention will be further described in detail below in conjunction with the accompanying drawings and the embodiments of the present invention.

[0051] In order to facilitate the explanation later, the following first briefly introduces concepts such as control flow graph, context state, function abstract, six-tuple model of pointer variable, and widening / narrowing operator in abstract interpretation.

[0052] 1. Control Flow Graph (CFG) is a directed graph that reflects the control flow of program logic. Usually, the control flow graph of a function can be expressed as (N, E, entry, exit), where: N represents a collection of nodes, reflecting the conditional judgment of simple statements and compound statements in the program and the confluence of control flow, etc.; E represents A collection of edges, reflecting the control flow relationship between statements in the program; entry is the fixed and only entry node of the funct...

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 static detection method for an inaccessible route in a program. The method comprises the following steps of: A, performing lexical analysis, syntactical analysis and semantic analysis on the function unit of a program to be tested, and generating the control flow graph of a function; B, acquiring the function abstract of the called function unit through the inter-function analysis of a variable value range in the program to be tested; C, selecting a route p between the entrance node and the exit node of the control flow graph, and adopting the policy of entering a loop body for 0 time or 1 time if the route comprises loop statement nodes; and D, starting from the entrance node of the route p, calculating a context state at every statement node, wherein the route p is the inaccessible route if the situation that the value of a variable is empty in the context state at a certain node exists, and the route p is an accessible route if the situation does not exist. The program static analysis efficiency and the test case generating efficiency can be improved by the method, so that software testing efficiency is improved.

Description

technical field [0001] The invention relates to software testing technology, in particular to a static detection method for unreachable paths in programs. Background technique [0002] In the process of software testing, if the unreachable path in the program can be found as early as possible, it can avoid spending a lot of manpower and material resources to generate test cases for the unreachable path in the dynamic testing phase. Therefore, the detection of unreachable paths in programs is of great significance to the whole process of software development. [0003] At present, using the static analysis method to detect unreachable paths in the program, although it is impossible to detect all unreachable paths, it is possible to determine some unreachable paths by analyzing the variable value range information in the path conditions, and can It is very beneficial to improve the accuracy of the test to verify that the results of the unreachable paths detected in the program...

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 Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products