FocalTest: A Constraint Programming Approach for Property-Based Testing

Property-based testing is the process of selecting test data from user-specified properties fro testing a program. Current automatic property-based testing techniques adopt direct generate-and-test approaches for this task, consisting in generating first test data and then checking whether a property is satisfied or not. are generated at random and rejected when they do not satisfy selected coverage criteria. In this paper, we propose a technique and tool called FocalTest, which adopt a test-and-generate approach through the usage of constraint reasoning. Our technique utilizes the property to prune the search space during the test data generation process. A particular difficulty is the generation of test data satisfying MC/DC on the precondition of a property, when it contains function calls with pattern matching and high-order functions. Our experimental results show that a non-naive implementation of constraint reasoning on these constructions outperform traditional generation techniques when used to find test data for testing properties.

[1]  Werner Kluge,et al.  Implementation of Functional Languages , 1996, Lecture Notes in Computer Science.

[2]  Koen Claessen,et al.  QuickCheck: a lightweight tool for random testing of Haskell programs , 2011, SIGP.

[3]  Andrea Bondavalli,et al.  Dependable Computing EDCC-4 , 2002, Lecture Notes in Computer Science.

[4]  Arnaud Gotlieb Euclide: A Constraint-Based Testing Framework for Critical C Programs , 2009, 2009 International Conference on Software Testing Verification and Validation.

[5]  Matt Bishop,et al.  Property-based testing: a new approach to testing for assurance , 1997, SOEN.

[6]  Arnaud Gotlieb,et al.  Constraint Reasoning in FocalTest , 2010, ICSOFT.

[7]  Arnaud Gotlieb,et al.  Automatic test data generation using constraint solving techniques , 1998, ISSTA '98.

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

[9]  A. Pretschner Classical search strategies for test case generation with Constraint Logic Programming , 2001 .

[10]  Thomas Johnsson,et al.  Lambda Lifting: Treansforming Programs to Recursive Equations , 1985, FPCA.

[11]  Koushik Sen,et al.  DART: directed automated random testing , 2005, PLDI '05.

[12]  François Pessaux,et al.  Development Life-cycle of Critical Software Under FoCaL , 2009, TTSS.

[13]  Bruno Marre,et al.  PathCrawler: Automatic Generation of Path Tests by Combining Static and Dynamic Analysis , 2005, EDCC.

[14]  Jeremy Dick,et al.  Automating the Generation and Sequencing of Test Cases from Model-Based Specifications , 1993, FME.

[15]  Koushik Sen,et al.  CUTE: a concolic unit testing engine for C , 2005, ESEC/FSE-13.

[16]  Sebastian Fischer,et al.  EasyCheck - Test Data for Free , 2008, FLOPS.

[17]  Sarfraz Khurshid,et al.  Constraint Prioritization for Efficient Analysis of Declarative Models , 2008, FM.

[18]  Thérèse Hardin,et al.  Building certified components within FOCAL , 2004, Trends in Functional Programming.

[19]  Marinus J. Plasmeijer,et al.  Gast: Generic Automated Software Testing , 2002, IFL.

[20]  Herbert Kuchen,et al.  Data-flow testing of declarative programs , 2008, ICFP 2008.

[21]  Jim Woodcock,et al.  FME '93: Industrial-Strength Formal Methods , 1993, Lecture Notes in Computer Science.

[22]  Bruno Legeard,et al.  Generation of functional test sequences from B formal specifications presentation and industrial case-study , 2001, Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001).

[23]  Catherine Dubois,et al.  Functional Testing in the Focal Environment , 2008, TAP.

[24]  Bruno Marre,et al.  Toward Automatic Test Data Set Selection Using Algebraic Specifications and Logic Programming , 1991, ICLP.

[25]  Kaisa Sere,et al.  FM 2008: Formal Methods, 15th International Symposium on Formal Methods, Turku, Finland, May 26-30, 2008, Proceedings , 2008, FM.