Constraint-based Test Generation for Pointer-based Data Structures

In this paper, we propose an approach for automated test case generation based on techniques from Constraint Programming. We show how an imperative language can be extended with constraint variables and its operational semantics with constraints. By running a program in this extended language, we obtain constraints on the initial environment and heap. Solving these constrains, we obtain concrete test cases for the program. Our technique can handle primitive data such as integers, as well as arbitrary pointer-based data structures allocated on the heap. Standard CP search strategies can be used to express preferences on the generated test cases and to obtain the desired degree of coverage.

[1]  David L. Spooner,et al.  Automatic Generation of Floating-Point Test Data , 1976, IEEE Transactions on Software Engineering.

[2]  James C. King,et al.  Symbolic execution and program testing , 1976, CACM.

[3]  Lori A. Clarke,et al.  A System to Generate Test Data and Symbolically Execute Programs , 1976, IEEE Transactions on Software Engineering.

[4]  Carlos Urias Munoz,et al.  Automatic Generation of Random Self-Checking Test Cases , 1983, IBM Syst. J..

[5]  Simeon C. Ntafos,et al.  An Evaluation of Random Testing , 1984, IEEE Transactions on Software Engineering.

[6]  Cem Kaner,et al.  Testing Computer Software , 1988 .

[7]  Bogdan Korel,et al.  Automated Software Test Data Generation , 1990, IEEE Trans. Software Eng..

[8]  Bogdan Korel,et al.  The chaining approach for software test data generation , 1996, TSEM.

[9]  Yashwant K. Malaiya,et al.  Automatic test generation using checkpoint encoding and antirandom testing , 1997, Proceedings The Eighth International Symposium on Software Reliability Engineering.

[10]  Hong Zhu,et al.  Software unit test coverage and adequacy , 1997, ACM Comput. Surv..

[11]  Mary Lou Soffa,et al.  Automated test data generation using an iterative relaxation method , 1998, SIGSOFT '98/FSE-6.

[12]  Thom W. Frühwirth,et al.  Theory and Practice of Constraint Handling Rules , 1998, J. Log. Program..

[13]  John A. Clark,et al.  The Way Forward for Unifying Dynamic Test Case Generation: The Optimisation-based Approach , 1998 .

[14]  Roy P. Pargas,et al.  Test-Data Generation Using Genetic Algorithms , 1999, Softw. Test. Verification Reliab..

[15]  Roy P. Pargas,et al.  Test‐data generation using genetic algorithms , 1999 .

[16]  Yves Deville,et al.  Automatic test data generation for programs with integer and float variables , 2001, Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001).

[17]  Sarfraz Khurshid,et al.  Generalized Symbolic Execution for Model Checking and Testing , 2003, TACAS.

[18]  Sarfraz Khurshid,et al.  Test input generation with java PathFinder , 2004, ISSTA '04.

[19]  Herbert Kuchen,et al.  A symbolic Java virtual machine for test case generation , 2004, IASTED Conf. on Software Engineering.

[20]  Michael R. Lowry,et al.  Combining test case generation and runtime verification , 2005, Theor. Comput. Sci..

[21]  Herbert Kuchen,et al.  Systematic generation of glass-box test cases for functional logic programs , 2007, PPDP '07.

[22]  Wim Vanhoof,et al.  Automatic Generation of Test Inputs for Mercury , 2008, LOPSTR.