A Novel Test Case Generation Method for Prolog Programs Based on Call Patterns Semantics

A natural way to generate test cases for a Prolog program is to view the call patterns of the procedures in the program as an implicit representation of the control flow graph (CFG) of the program. This paper explores the idea by proposing a call patterns-based test case generation method, where a set of call patterns or computed answers is used to describe the paths in a CFG. With a constraint-based call patterns semantics, this method is formalized. Through the use of a proper constraints solver, we can generate test cases automatically from the sets of constraints. This method can be based on any approximation of the call patterns semantics. So compared with traditional CFG-based test case generation, the method is more flexible and can be easily adapted to meet the requirements of a tester expressed by the approximation of the call patterns semantics we use.

[1]  Patrick Cousot,et al.  Abstract Interpretation and Application to Logic Programs , 1992, J. Log. Program..

[2]  Giorgio Levi,et al.  Accurate Analysis of Prolog with cut , 1996, APPIA-GULP-PRODE.

[3]  Tsong Yueh Chen,et al.  A Choice Relation Framework for Supporting Category-Partition Test Case Generation , 2003, IEEE Trans. Software Eng..

[4]  Marc J. Balcer,et al.  The category-partition method for specifying and generating fuctional tests , 1988, CACM.

[5]  Fevzi Belli,et al.  Implementation-based analysis and testing of Prolog programs , 1993, ISSTA '93.

[6]  Pascal Van Hentenryck,et al.  The Constraint Logic Programming Language CHIP , 1988, FGCS.

[7]  Michael J. Maher,et al.  Constraint Logic Programming: A Survey , 1994, J. Log. Program..

[8]  Manfred Broy,et al.  Formal Methods in Programming and Their Applications , 1993, Lecture Notes in Computer Science.

[9]  Tibor Gyimóthy,et al.  Interactive Diagnosis and Testing of Logic Programs , 2008 .

[10]  Giorgio Levi,et al.  Abstract Debugging of Logic Program , 1994, META.

[11]  Alain Colmerauer,et al.  An introduction to Prolog III , 1989, CACM.

[12]  Patrick Cousot,et al.  Comparing the Galois Connection and Widening/Narrowing Approaches to Abstract Interpretation , 1992, PLILP.

[13]  Peter Greenfield,et al.  Logic Program Testing Based on Abstract Interpretation , 1993, Formal Methods in Programming and Their Applications.

[14]  Gregor von Bochmann,et al.  Control-flow based testing of Prolog programs , 1992, [1992] Proceedings Third International Symposium on Software Reliability Engineering.

[15]  Chris Mellish,et al.  Abstract Interpretation of Prolog Programs , 1986, ICLP.

[16]  Fausto Spoto,et al.  Operational and Goal-Independent Denotational Semantics for Prolog with Cut , 2000, J. Log. Program..

[17]  Giorgio Levi,et al.  Abstract Interpretation of Prolog Programs , 1999, AMAST.

[18]  Pierre Deransart,et al.  Programming Languages Implementation and Logic Programming , 1989, Lecture Notes in Computer Science.

[19]  Giorgio Levi,et al.  Efficient Detection of Incompleteness Errors in the Abstract Debugging of Logic Programs , 1995, AADEBUG.

[20]  Ehud Y. Shapiro,et al.  Algorithmic program diagnosis , 1982, POPL '82.

[21]  Manuel V. Hermenegildo,et al.  Integrated program debugging, verification, and optimization using abstract interpretation (and the Ciao system preprocessor) , 2005, Sci. Comput. Program..