A Coq Framework For Verified Property-Based Testing ( Extended Abstract )

We introduce a novel methodology for formally verified property-based testing and implement it as a framework on top of the QuickChick testing plugin for Coq.1 Our verification framework is aimed at proving the correctness of executable testing code with respect to a high-level specification, which captures the conjecture under test in a more direct way. To this end, we provide a systematic way for reasoning about the set of outcomes a random data generator can produce with non-zero probability. We have used our methodology to prove the correctness of most QuickChick combinators, with respect to the axiomatic semantics of a small number of primitive ones. We have also applied our methodology on a red-black tree example and made good progress on a more complex noninterference one. These encouraging preliminary results indicate that this verification methodology is modular, scalable, and requires minimal changes to existing code.

[1]  Chris Okasaki,et al.  Red-black trees in a functional setting , 1999, Journal of Functional Programming.

[2]  Peter Dybjer,et al.  Combining Testing and Proving in Dependent Type Theory , 2003, TPHOLs.

[3]  Tobias Nipkow,et al.  Random testing in Isabelle/HOL , 2004, Proceedings of the Second International Conference on Software Engineering and Formal Methods, 2004. SEFM 2004..

[4]  John Hughes,et al.  Testing telecoms software with quviq QuickCheck , 2006, ERLANG '06.

[5]  Qian Yang,et al.  A survey of coverage based testing tools , 2006, AST '06.

[6]  John Hughes,et al.  QuickCheck Testing for Fun and Profit , 2007, PADL.

[7]  Colin Runciman,et al.  Haskell program coverage , 2007, Haskell '07.

[8]  Enrico Tassi,et al.  A Small Scale Reflection Extension for the Coq system , 2008 .

[9]  Assia Mahboubi,et al.  An introduction to small scale reflection in Coq , 2010, J. Formaliz. Reason..

[10]  K. Claessen,et al.  QuickCheck: a lightweight tool for random testing of Haskell programs , 2000, SIGP.

[11]  Mark Harman,et al.  An Analysis and Survey of the Development of Mutation Testing , 2011, IEEE Transactions on Software Engineering.

[12]  Andrew W. Appel Efficient Verified Red-Black Trees , 2011 .

[13]  Konstantinos Sagonas,et al.  A PropEr integration of types and function specifications with property-based testing , 2011, Erlang Workshop.

[14]  Lukas Bulwahn,et al.  Smart Testing of Functional Programs in Isabelle , 2012, LPAR.

[15]  Lukas Bulwahn,et al.  The New Quickcheck for Isabelle - Random, Exhaustive and Symbolic Testing under One Roof , 2012, CPP.

[16]  Alex Groce,et al.  MuCheck: an extensible tool for mutation testing of haskell programs , 2014, ISSTA 2014.

[17]  Vítor Santos Costa,et al.  PrologCheck - Property-Based Testing in Prolog , 2014, FLOPS.

[18]  B. Pierce,et al.  QuickChick: Property-based testing for Coq , 2014 .

[19]  Mohammad Amin Alipour,et al.  Mutation Testing of Functional Programming Languages , 2014 .

[20]  Benjamin C. Pierce,et al.  Micro-Policies A Framework for Verified, Hardware-Assisted Security Monitors , 2014 .

[21]  Benjamin C. Pierce,et al.  Testing noninterference, quickly , 2016, Journal of Functional Programming.