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

Method for determining context environmental effect of function call in program path

A technology of function calling and environmental impact, which is applied in the field of automatic testing of software units, can solve the problems that the value cannot meet the path conditions and affect the test coverage, etc., and achieve the effect of improving efficiency and coverage

Active Publication Date: 2012-10-03
BEIJING UNIV OF POSTS & TELECOMM
View PDF1 Cites 16 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Since the called function on the path will modify the value of each variable at the call point, the random output value of the called function may cause the value of each variable to fail to meet the path conditions, resulting in the function under test not being able to execute according to the target coverage path, affecting the coverage of the test Rate

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 for determining context environmental effect of function call in program path
  • Method for determining context environmental effect of function call in program path
  • Method for determining context environmental effect of function call in program path

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

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

[0071] The basic idea of ​​the present invention: by calculating the influence of each function call point in a given path on the context environment, the path-sensitive symbolic interval operation technology is used to determine the context conditions that must be satisfied by each call point of the called function on the path, Finally, a simulated replacement function of the called function is generated according to the condition, which ensures that the program under test is executed according to the target path, thereby achieving the purpose of improving the efficiency and coverage of the unit test.

[0072] figure 1 It is a schematic flowchart of a method for determining the contextual influence of a function call in the program path of the present invention, the method uses a return value, a global ...

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 method for determining a context environmental effect of a function call in a program path. The method comprises the steps: using a return value, a global variable redefined by a called function, a pointer or a referenced parameter as an output variable of the called function; calculating the context condition which must be met by call point output variables in the path of the called function by a path-sensitive and context-sensitive symbolic interval arithmetic technology; and finally generating a simulative replacement function according to the condition, wherein the value of the output variables can be dynamically adjusted by the simulative replacement function according to the condition of the call points and the condition that the program is executed according to a target path is ensured. The method can be used for path-oriented test in an automated unit test and comprises a full path-oriented test, a sub path-oriented test and a target-oriented test and the like. The experiment shows that the method provided by the invention is adopted to ensure that the tested program is executed according to the target path and the unit test efficiency is improved.

Description

technical field [0001] The invention relates to a software unit automatic testing technology, in particular to a method for determining the context environment influence of a function call in a program path. Background technique [0002] When unit testing software, the called function in the function under test usually does not call the original function directly, but generates a replacement function with simple logic, and uses the replacement function to simulate the behavior of the original function. The main reasons are: 1) It can isolate the program under test from the actual program with high execution cost, and improve the efficiency of unit testing; 2) isolate the function under test from the uncontrollable execution environment, so that the test process can go smoothly; 3) in the unit test, the called function Might not be implemented yet. In automated unit testing, the generation of replacement functions will encounter new problems. In the traditional substitution...

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