Advances in Lazy SmallCheck

  • Jason S. ReichEmail author
  • Matthew Naylor
  • Colin Runciman
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8241)


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.


Automated testing Lazy SmallCheck Functional values Existential quantification Search-based software engineering 



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.


  1. 1.
    Claessen, K.: Shrinking and showing functions: (functional pearl). In: Proceedings of the 2012 Symposium on Haskell, pp. 73–80. Haskell ’12, ACM (2012)Google Scholar
  2. 2.
    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)Google Scholar
  3. 3.
    Danielsson, N.A., Jansson, P.: Chasing bottoms. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 85–109. Springer, Heidelberg (2004)Google Scholar
  4. 4.
    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)CrossRefGoogle Scholar
  5. 5.
    Elliott, C.: Elegant memoization with functional memo tries. (October 2008). Accessed 26 July 2012
  6. 6.
    Hinze, R.: Generalizing generalized tries. J. Funct. Program. 10(04), 327–351 (2000)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    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)Google Scholar
  8. 8.
    Jackson, D.: Software Abstractions: Logic, Language and Analysis. MIT Press, Cambridge (2012). Revised ednGoogle Scholar
  9. 9.
    Katayama, S.: Systematic search for lambda expressions. In: Trends in Functional Programming, TFP2005, vol. 6, pp. 111–126. Intellect Books (2007)Google Scholar
  10. 10.
    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)Google Scholar
  11. 11.
    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)Google Scholar
  12. 12.
    McBride, C., Paterson, R.: Applicative programming with effects. J. Funct. Program. 18(1), 1–13 (2008)CrossRefzbMATHGoogle Scholar
  13. 13.
    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)Google Scholar
  14. 14.
    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)Google Scholar
  15. 15.
    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)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Jason S. Reich
    • 1
    Email author
  • Matthew Naylor
    • 2
  • Colin Runciman
    • 1
  1. 1.Department of Computer ScienceUniversity of YorkYorkUK
  2. 2.Computer LaboratoryUniversity of CambridgeCambridgeUK

Personalised recommendations