skip to main content
10.1145/3205368.3205371acmotherconferencesArticle/Chapter ViewAbstractPublication PagesiflConference Proceedingsconference-collections
research-article

Extrapolate: generalizing counterexamples of functional test properties

Published:30 August 2017Publication History

ABSTRACT

This paper presents a new tool called Extrapolate that automatically generalizes counterexamples found by property-based testing in Haskell. Example applications show that generalized counterexamples can inform the programmer more fully and more immediately what characterises failures. Extrapolate is able to produce more general results than similar tools. Although it is intrinsically unsound, as reported generalizations are based on testing, it works well for examples drawn from previous published work in this area.

References

  1. Thomas Arts, John Hughes, Joakim Johansson, and Ulf Wiger. 2006. Testing telecoms software with QuviQ QuickCheck. In Erlang '06. ACM, 2--10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Rudy Braquehais. 2015--2017. LeanCheck. https://github.com/rudymatela/leancheck. (2015--2017).Google ScholarGoogle Scholar
  3. Rudy Braquehais. 2016--2017. LeanCheck's Documentation. https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html. (2016--2017).Google ScholarGoogle Scholar
  4. Rudy Braquehais and Colin Runciman. 2016. FitSpec: refining property sets for functional testing. In Haskell'16. ACM, 1--12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Rudy Braquehais and Colin Runciman. 2017. Speculate: discovering conditional equations and inequalities about black-box functions by reasoning from test results. In Haskell'17. ACM, 40--51. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. R. Mike Cameron-Jones and J. Ross Quinlan. 1994. Efficient Top-down Induction of Logic Programs. SIGART Bulletin 5, 1 (Jan 1994), 33--42. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Olaf Chitil, Maarten Faddegon, and Colin Runciman. 2016. A Lightweight Hat: Simple Type-Preserving Instrumentation for Self-Tracing Lazy Functional Programs. In IFL 2016. ACM, 1--14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Olaf Chitil, Colin Runciman, and Malcolm Wallace. 2001. Freja, Hat and Hood --- A Comparative Evaluation of Three Systems for Tracing and Debugging Lazy Functional Programs. In IFL 2000. Springer, 176--193. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jan Christiansen and Sebastian Fischer. 2008. EasyCheck -- Test Data for Free. In Functional and Logic Programming. Springer, 322--336. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Koen Claessen. 2012. Shrinking and Showing Functions. In Haskell'12. ACM, 73--80. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Koen Claessen and John Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In ICFP'00. ACM, 268--279. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Koen Claessen and John Hughes. 2002. Testing Monadic Code with QuickCheck. In Haskell '02. ACM, 65--77. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Koen Claessen, Colin Runciman, Olaf Chitil, John Hughes, and Malcolm Wallace. 2003. Testing and Tracing Lazy Functional Programs Using QuickCheck and Hat. In AFP'03. Springer, 59--99.Google ScholarGoogle Scholar
  14. Koen Claessen, Nicholas Smallbone, and John Hughes. 2010. QuickSpec: Guessing Formal Specifications Using Testing. In TAP 2010. Springer, 6--21. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Jonas Duregård, Patrik Jansson, and Meng Wang. 2012. Feat: functional enumeration of algebraic types. In Haskell '12. ACM, 61--72.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Andy Gill. 2001. Debugging Haskell by Observing Intermediate Data Structures. Electronic Notes in Theoretical Computer Science 41, 1 (2001), 1. Also in Haskell'00.Google ScholarGoogle ScholarCross RefCross Ref
  17. Martin Hofmann and Emanuel Kitzelmann. 2010. I/O Guided Detection of List Catamorphisms: Towards Problem Specific Use of Program Templates in IP. In PEPM'10. ACM, 93--100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Martin Hofmann, Emanuel Kitzelmann, and Ute Schmid. 2010. Porting Igor II from Maude to Haskell. In Approaches and Applications of Inductive Programming (AAIP'09). Revised Papers. Springer, 140--158.Google ScholarGoogle Scholar
  19. Susumu Katayama. 2004. Power of Brute-Force Search in Strongly-Typed Inductive Functional Programming Automation. In PRICAI 2004: Trends in Artificial Intelligence (LNAI 3157). Springer, 75--84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Susumu Katayama. 2005. Systematic search for lambda expressions. In TFP 2005.Google ScholarGoogle Scholar
  21. Susumu Katayama. 2010. Recent Improvements of MagicHaskeller. In AAIP 2009. Revised Papers (LNCS 5812). Springer, 174--193.Google ScholarGoogle Scholar
  22. Susumu Katayama. 2012. An Analytical Inductive Functional Programming System That Avoids Unintended Programs. In PEPM '12. ACM, 43--52. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Emanuel Kitzelmann. 2007. Data-driven induction of recursive functions from input/output-examples. In Approaches and Applications of Inductive Programming (AAIP'07). 15--26.Google ScholarGoogle Scholar
  24. Emanuel Kitzelmann. 2010. Inductive Programming: A Survey of Program Synthesis Techniques. In AAIP'09. Springer, 50--73.Google ScholarGoogle Scholar
  25. Pieter Koopman, Artem Alimarine, Jan Tretmans, and Rinus Plasmeijer. 2003. GAST: Generic Automated Software Testing. In IFL 2003, LNCS 2670. Springer, 84--100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Stephen Muggleton. 1995. Inverse entailment and PROGOL. New Generation Computing 13, 3 (Dec 1995), 245--286.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Henrik Nilsson. 1998. Declarative Debugging for Lazy Functional Languages. Ph.D. Dissertation.Google ScholarGoogle Scholar
  28. Henrik Nilsson and Jan Sparud. 1997. The Evaluation Dependence Tree as a Basis for Lazy Functional Debugging. Automated Software Engineering 4, 2 (Apr 1997), 121--150. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Manolis Papadakis and Konstantinos Sagonas. 2011. A PropEr integration of types and function specifications with property-based testing. In Erlang '11. ACM, 39--50. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Lee Pike. 2014. SmartCheck: Automatic and Efficient Counterexample Reduction and Generalization. In Haskell'14. ACM, 59--70. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. J. R. Quinlan and R. M. Cameron-Jones. 1993. FOIL: A midterm report. In ECML-93: European Conference on Machine Learning. Springer, 1--20. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Jason S. Reich, Matthew Naylor, and Colin Runciman. 2013. Advances in Lazy SmallCheck. In IFL'13. Springer, 53--70.Google ScholarGoogle Scholar
  33. Colin Runciman, Matthew Naylor, and Fredrik Lindblad. 2008. SmallCheck and Lazy SmallCheck: Automatic Exhaustive Testing for Small Values. In Haskell'08. ACM, 37--48. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Tim Sheard and Simon Peyton Jones. 2002. Template Meta-programming for Haskell. In Haskell'02. ACM, 1--16. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Nicholas Smallbone, Moa Johansson, Koen Claessen, and Maximilian Algehed. 2017. Quick specifications for the busy programmer. Journal of Functional Programming 27 (2017).Google ScholarGoogle Scholar
  36. Don Stewart and Spencer Sjanssen. 2007. XMonad. In Haskell '07. ACM, 119--119. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Malcolm Wallace, Olaf Chitil, Thorsten Brehm, and Colin Runciman. 2001. Multiple-View Tracing for Haskell: a New Hat. In Haskell'01. ACM, 182--196.Google ScholarGoogle Scholar

Index Terms

  1. Extrapolate: generalizing counterexamples of functional test properties

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Other conferences
      IFL '17: Proceedings of the 29th Symposium on the Implementation and Application of Functional Programming Languages
      August 2017
      126 pages
      ISBN:9781450363433
      DOI:10.1145/3205368

      Copyright © 2017 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 30 August 2017

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed limited

      Acceptance Rates

      IFL '17 Paper Acceptance Rate9of16submissions,56%Overall Acceptance Rate19of36submissions,53%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader