Skip to main content

Advances in Lazy SmallCheck

  • Conference paper
  • First Online:
Implementation and Application of Functional Languages (IFL 2012)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 8241))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 72.00
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Like all other properties used as examples in this paper, this property does not hold; our goal is to find a counterexample.

  2. 2.

    Source code available at http://github.com/UoYCS-plasma/LazySmallCheck2012.

References

  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. 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. 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. 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)

    Article  Google Scholar 

  5. 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

  6. Hinze, R.: Generalizing generalized tries. J. Funct. Program. 10(04), 327–351 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  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. Jackson, D.: Software Abstractions: Logic, Language and Analysis. MIT Press, Cambridge (2012). Revised edn

    Google Scholar 

  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. 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. 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. McBride, C., Paterson, R.: Applicative programming with effects. J. Funct. Program. 18(1), 1–13 (2008)

    Article  MATH  Google Scholar 

  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. 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. 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 

Download references

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

Authors

Corresponding author

Correspondence to Jason S. Reich .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics