Improvement of the Gupta Method

单锦辉,王戟,齐治昌,吴建平
DOI: https://doi.org/10.3321/j.issn:0254-4164.2002.12.013
2002-01-01
Abstract:Automatic generation of test data for a given path in a program is one of the primary problems in software testing, which can be described informally as: given a program P and a path W in P, let the input space of P be D, compute ②x② in D, such that when P executes on x, path W will be traversed. The difficulty of this problem lies in the fact that how to solve nonlinear constraint is unsolvable in theory. Gupta et al proposed a method, which is referred to as the Gupta Method in this paper, to address the above problem by linearizing the predicate functions with linear arithmetic representations. The Gupta Method has to analyze the static and dynamic data dependencies between the statements on W, and construct predicate slices and input dependency sets.This paper improves the Gupta Method by omitting the constructions of predicate slices and input dependency sets. Furthermore, when the divided differences are used to approximate to the derivatives that are coefficients in linear arithmetic representations, computing linear arithmetic representations is converted to compute predicate residuals completely, which needs to analyze neither static nor dynamic data dependencies between the statements on W. The improved method is more efficient to derive linear constraints.A model language is given to investigate the properties of static and dynamic data dependencies and define the notions in the Gupta Method formally. The predicate slices proposed by Gupta et al are generalized to path-wise static slices, and the soundness of whose construction algorithm is proved then. The soundness of the improvement is proved too.A prototype of path-wise test data generator has been developed, whose fundamental algorithm is the improved Gupta Method. The initial experiments carried out on this prototype with actual program paths have shown that the improved Gupta Method is practical and can be used to generate test data for not only both white-box testing and black-box testing but also assertion-oriented testing and regression testing.
What problem does this paper attempt to address?