Skip to main content

Lazy Generation of Canonical Test Programs

  • Conference paper

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

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

Chapter
USD   29.95
Price excludes VAT (Canada)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (Canada)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   72.00
Price excludes VAT (Canada)
  • 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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abel, A.: Foetus — termination checker for simple functional programs (1998), http://www2.tcs.ifi.lmu.de/~abel/foetus.pdf

  2. Boujarwah, A.S., Saleh, K.: Compiler test case generation methods: a survey and assessment. Information & Software Technology 39, 617–625 (1997)

    CrossRef  Google Scholar 

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

    CrossRef  MATH  Google Scholar 

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

    Google Scholar 

  5. Dietz, P.F.: The GCL ANSI Common Lisp test suite (2008), http://en.scientificcommons.org/42309664

  6. Jackson, D.: Software Abstractions: Logic, Language and Analysis, Revised edn. MIT Press (2012)

    Google Scholar 

  7. Katayama, S.: Systematic search for lambda expressions. In: Trends in Functional Programming, TFP 2005, vol. 6, pp. 111–126. Intellect Books (2007)

    Google Scholar 

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

    Google Scholar 

  9. O’Sullivan, B.: The criterion package, v0.5.1.1 (2011), http://hackage.haskell.org/package/criterion

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

    Google Scholar 

  11. Partain, W.: The nofib benchmark suite of Haskell programs. In: Functional Programming, Workshops in Computing, Glasgow 1992, pp. 195–202. Springer (1992)

    Google Scholar 

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

    Google Scholar 

  13. Sestoft, P.: Deriving a lazy abstract machine. Journal of Functional Programming 7, 231–264 (1997)

    CrossRef  MathSciNet  MATH  Google Scholar 

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

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

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