Abstract
Property-based testing can be a highly effective form of lightweight verification, but it relies critically on the method used to generate test cases. If we wish to test properties of compilers and related tools we need a generator for source programs as test cases.
We describe experiments generating functional programs in a core first-order language with algebraic data types. Candidate programs are generated freely over a syntactic representation with positional names. Static conditions for program validity and canonical representatives of large equivalence classes are defined separately. The technique is used to investigate the correctness properties of a program optimisation and two language implementations.
Keywords
- automated testing
- Small Check
- lightweight verification
- compiler correctness
- search-based software engineering
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Abel, A.: Foetus — termination checker for simple functional programs (1998), http://www2.tcs.ifi.lmu.de/~abel/foetus.pdf
Boujarwah, A.S., Saleh, K.: Compiler test case generation methods: a survey and assessment. Information & Software Technology 39, 617–625 (1997)
de Bruijn, N.G.: Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. Indagationes Mathematicae 75(5), 381–392 (1972)
Claessen, K., Hughes, J.: QuickCheck: a lightweight tool for random testing of haskell programs. In: Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming, ICFP 2000, pp. 268–279. ACM (2000)
Dietz, P.F.: The GCL ANSI Common Lisp test suite (2008), http://en.scientificcommons.org/42309664
Jackson, D.: Software Abstractions: Logic, Language and Analysis, Revised edn. MIT Press (2012)
Katayama, S.: Systematic search for lambda expressions. In: Trends in Functional Programming, TFP 2005, vol. 6, pp. 111–126. Intellect Books (2007)
Naylor, M., Runciman, C.: The Reduceron reconfigured. In: Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming, ICFP 2010, pp. 75–86. ACM (2010)
O’Sullivan, B.: The criterion package, v0.5.1.1 (2011), http://hackage.haskell.org/package/criterion
Palka, M.H., Claessen, K., Russo, A., Hughes, J.: Testing an optimising compiler by generating random lambda terms. In: Proceedings of the Sixth IEEE/ACM Workshop on Automation of Software Test, AST 2011, pp. 91–97 (2011)
Partain, W.: The nofib benchmark suite of Haskell programs. In: Functional Programming, Workshops in Computing, Glasgow 1992, pp. 195–202. Springer (1992)
Runciman, C., Naylor, M., Lindblad, F.: SmallCheck and Lazy SmallCheck: automatic exhaustive testing for small values. In: Proceedings of the First ACM SIGPLAN Symposium on Haskell, Haskell 2008, pp. 37–48. ACM (2008)
Sestoft, P.: Deriving a lazy abstract machine. Journal of Functional Programming 7, 231–264 (1997)
Tolmac, A., Chevalier, T.: The GHC Team: An external representation for the GHC Core Language (for GHC 6.10) (2009), http://www.haskell.org/ghc/docs/6.10.4/html/ext-core/core.pdf
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Reich, J.S., Naylor, M., Runciman, C. (2012). Lazy Generation of Canonical Test Programs. In: Gill, A., Hage, J. (eds) Implementation and Application of Functional Languages. IFL 2011. Lecture Notes in Computer Science, vol 7257. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34407-7_5
Download citation
DOI: https://doi.org/10.1007/978-3-642-34407-7_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-34406-0
Online ISBN: 978-3-642-34407-7
eBook Packages: Computer ScienceComputer Science (R0)
