Abstract
A property-based testing library enables users to perform lightweight verification of software. This paper presents improvements to the Lazy SmallCheck property-based testing library. Users can now test properties that quantify over first-order functional values and nest universal and existential quantifiers in properties. When a property fails, Lazy SmallCheck now accurately expresses the partiality of the counterexample. These improvements are demonstrated through several practical examples.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Like all other properties used as examples in this paper, this property does not hold; our goal is to find a counterexample.
- 2.
Source code available at http://github.com/UoYCS-plasma/LazySmallCheck2012.
References
Claessen, K.: Shrinking and showing functions: (functional pearl). In: Proceedings of the 2012 Symposium on Haskell, pp. 73–80. Haskell ’12, ACM (2012)
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, pp. 268–279. ICFP ’00. ACM (2000)
Danielsson, N.A., Jansson, P.: Chasing bottoms. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 85–109. Springer, Heidelberg (2004)
de Bruijn, N.G.: Lambda calculus notation with nameless dummies: a tool for automatic formula manipulation, with application to the Church-Rosser theorem. Indagationes Math. 34, 381–392 (1972)
Elliott, C.: Elegant memoization with functional memo tries. http://conal.net/blog/posts/elegant-memoization-with-functional-memo-tries (October 2008). Accessed 26 July 2012
Hinze, R.: Generalizing generalized tries. J. Funct. Program. 10(04), 327–351 (2000)
Hughes, J.: The design of a pretty-printing library. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925, pp. 53–96. Springer, Heidelberg (1995)
Jackson, D.: Software Abstractions: Logic, Language and Analysis. MIT Press, Cambridge (2012). Revised edn
Katayama, S.: Systematic search for lambda expressions. In: Trends in Functional Programming, TFP2005, vol. 6, pp. 111–126. Intellect Books (2007)
Koopman, P., Plasmeijer, R.: Synthesis of functions using generic programming. In: Schmid, U., Kitzelmann, E., Plasmeijer, R. (eds.) AAIP 2009. LNCS, vol. 5812, pp. 25–49. Springer, Heidelberg (2010)
Marlow, S.: An extensible dynamically-typed hierarchy of exceptions. In: Proceedings of the 2006 ACM SIGPLAN Workshop on Haskell, pp. 96–106. Haskell ’06. ACM (2006)
McBride, C., Paterson, R.: Applicative programming with effects. J. Funct. Program. 18(1), 1–13 (2008)
Reich, J.S., Naylor, M., Runciman, C.: Lazy generation of canonical test programs. In: Gill, A., Hage, J. (eds.) IFL 2011. LNCS, vol. 7257, pp. 69–84. Springer, Heidelberg (2012)
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, pp. 37–48. Haskell ’08, ACM (2008)
Sheard, T., Peyton Jones, S.: Template metaprogramming for Haskell. In: Proceedings of the 2002 ACM SIGPLAN Workshop on Haskell, pp. 1–16. Haskell ’02. ACM (2002)
Acknowledgements
We would like to acknowledge an e-mail suggestion from Max Bolingbroke pointing to Elliott’s [5] MemoTrie library as a possible starting point for the generation of functional values. We thank Andy Gill, IFL reviewers and Michael Banks for helpful comments and suggestions. This research was supported, in part, by the EPSRC through the Large-Scale Complex IT Systems project, EP/F001096/1.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Reich, J.S., Naylor, M., Runciman, C. (2013). Advances in Lazy SmallCheck. In: Hinze, R. (eds) Implementation and Application of Functional Languages. IFL 2012. Lecture Notes in Computer Science(), vol 8241. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-41582-1_4
Download citation
DOI: https://doi.org/10.1007/978-3-642-41582-1_4
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-41581-4
Online ISBN: 978-3-642-41582-1
eBook Packages: Computer ScienceComputer Science (R0)