Abstract
This paper presents Speculate, a tool that automatically conjectures laws involving conditional equations and inequalities about Haskell functions. Speculate enumerates expressions involving a given collection of Haskell functions, testing to separate those expressions into apparent equivalence classes. Expressions in the same equivalence class are used to conjecture equations. Representative expressions of different equivalence classes are used to conjecture conditional equations and inequalities. Speculate uses lightweight equational reasoning based on term rewriting to discard redundant laws and to avoid needless testing. Several applications demonstrate the effectiveness of Speculate.
- 2017. Haskell’s Data.Dynamic library documentation. https://hackage.haskell. org/package/base/docs/Data-Dynamic.html . (2017).Google Scholar
- Franz Baader and Tobias Nipkow. 1999. Term Rewriting and All That. Cambridge University Press. Google Scholar
Digital Library
- Leo Bachmair, Nachum Dershowitz, and David A. Plaisted. 1989. Completion Without Failure. In Resolution Of Equations In Algebraic Structures. Vol. 2. Academic Press, Boston, 1–30.Google Scholar
- Rudy Braquehais and Colin Runciman. 2016. FitSpec: refining property sets for functional testing. In Haskell’16. ACM, 1–12. Google Scholar
Digital Library
- Lukas Bulwahn. 2012. Smart Testing of Functional Programs in Isabelle. In LPAR 2012 (LNCS 7180). Springer, 153–167. Google Scholar
Digital Library
- Koen Claessen and John Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In ICFP’00. ACM, 268–279. Google Scholar
Digital Library
- Koen Claessen, Moa Johansson, Dan Rosén, and Nicholas Smallbone. 2012. HipSpec: Automating inductive proofs of program properties. In Workshop on Automated Theory eXploration: ATX 2012.Google Scholar
- Koen Claessen, Nicholas Smallbone, and John Hughes. 2010. QuickSpec: Guessing Formal Specifications Using Testing. In TAP 2010. Springer, 6–21. Google Scholar
Digital Library
- John Horton Conway. 1971. Regular algebra and finite machines. Chapman and Hall.Google Scholar
- Jonas Duregård, Patrik Jansson, and Meng Wang. 2012. Feat: functional enumeration of algebraic types. In Haskell’12. ACM, 61–72. Google Scholar
Digital Library
- Michael D. Ernst, Jeff H. Perkins, Philip J. Guo, Stephen Mccamant, Carlos Pacheco, Matthew S. Tschantz, and Chen Xiao. 2006. The Daikon system for dynamic detection of likely invariants. Science of Computer Programming 69, 1 (2006), 35–45. Google Scholar
Digital Library
- Moa Johansson, Dan Rosén, Nicholas Smallbone, and Koen Claessen. 2014. Hipster: Integrating Theory Exploration in a Proof Assistant. Springer.Google Scholar
- Donald Knuth and Peter Bendix. 1983. Simple Word Problems in Universal Algebras. In Automation of Reasoning. Springer, 342–376.Google Scholar
- Dexter Kozen. 1994. A completeness theorem for Kleene algebras and the algebra of regular events. Information and Computation 110, 2 (1994), 366–390. Google Scholar
Digital Library
- Fredrik Lindblad. 2007. Property Directed Generation of First-Order Test Data. In TFP’07. 105–123.Google Scholar
- Jason S. Reich, Matthew Naylor, and Colin Runciman. 2013. Advances in Lazy SmallCheck. In IFL’13. Springer, 53–70.Google Scholar
- 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 Scholar
Digital Library
- Arto Salomaa. 1966. Two complete axiom systems for the algebra of regular events. Journal of the ACM (JACM) 13, 1 (1966), 158–169. Google Scholar
Digital Library
- Tim Sheard and Simon Peyton Jones. 2002. Template Meta-programming for Haskell. In Haskell’02. ACM, 1–16. Google Scholar
Digital Library
- Nicholas Smallbone. 2011. Property-based testing for functional programs. Licentiate Thesis. Chalmers University of Technology.Google Scholar
- Nicholas Smallbone. 2013. Lightweight verification of functional programs. Ph.D. Dissertation. Chalmers University of Technology.Google Scholar
- Nicholas Smallbone and Moa Johansson. 2017. Quick specifications for the busy programmer. (2017). http://www.cse.chalmers.se/~nicsma/papers/quickspec2.pdf Accepted for publication in JFP, Cambridge University Press.Google Scholar
- The GHC Team. 1992–2017. The Glasgow Haskell Compiler. https://www.haskell. org/ghc/ . (1992–2017).Google Scholar
- Michael Walker and Colin Runciman. 2017. Cheap Remarks about Concurrent Programs. (2017). Accepted for presentation at TFP’17.Google Scholar
Index Terms
Speculate: discovering conditional equations and inequalities about black-box functions by reasoning from test results
Recommendations
Speculate: discovering conditional equations and inequalities about black-box functions by reasoning from test results
Haskell 2017: Proceedings of the 10th ACM SIGPLAN International Symposium on HaskellThis paper presents Speculate, a tool that automatically conjectures laws involving conditional equations and inequalities about Haskell functions. Speculate enumerates expressions involving a given collection of Haskell functions, testing to separate ...
Property-driven testing of black-box functions
FormaliSE '22: Proceedings of the IEEE/ACM 10th International Conference on Formal Methods in Software EngineeringTesting is one of the most frequent means of quality assurance for software. Property-based testing aims at generating test suites for checking code against user-defined properties. Test input generation is, however, most often independent of the ...
FitSpec: refining property sets for functional testing
Haskell '16This paper presents FitSpec, a tool providing automated assistance in the task of refining sets of test properties for Haskell functions. FitSpec tests mutant variations of functions under test against a given property set, recording any surviving ...







Comments