Automatic Control Flow Based Generation of Stubs for Structural Testing

K.-C. Griche and I. Parissis (France)


Structural testing, test data generation, stubs.


Automatic generation of test cases ensuring statement or branch coverage requires selecting a procedure and a set of test data based on source code analysis. This process considers not only the code of the procedure itself but also the code of all the procedures called. When the number of procedure calls increases, the process becomes inefficient. A practical solution is to replace procedure calls with user-defined stubs. Such stubs have two main drawbacks: First, as the values they return are not necessarily realistic, the covered statements or branches may be unreachable in the real program. Second, they may cause program failures that would not have happened if the real function or procedure was used. As a result, the cost of testing increases, as more failures must be analyzed. We propose a new approach to automatically generate stubs for structural testing as layered hierarchies of approximations. We give an algorithm, based on Feasible Path Analysis, extracting approximations of a procedure and building a hierarchy that allows for efficient test data generation. We implemented this algorithm at the top of the test data generator INKA.

Important Links:

Go Back