Abstract
Quick Check is a tool which aids the Haskell programmer in formulating and testing properties of programs. Properties are described as Haskell functions, and can be automatically tested on random input, but it is also possible to define custom test data generators. We present a number of case studies, in which the tool was successfully used, and also point out some pitfalls to avoid. Random testing is especially suitable for functional programs because properties can be stated at a fine grain. When a function is built from separately tested components, then random testing suffices to obtain good coverage of the definition under test.
- 1 S. Antoy and R. Hamlet. Automatically checking an implementation against its formal specification. In Irvine Software Symposium, pages 29-48, March 1992.]]Google Scholar
- 2 Roland Backhouse, Patrik Jansson, Johan Jeuring, and Lambert Meertens. Generic Programming - An Introduction. In Lecture notes in Computer Science, volume 1608, 1999.]]Google Scholar
- 3 P. Bjesse, K. Claessen, M. Sheeran, and S. Singh. Lava: Hardware Design in Haskell. In International Conference onFunctional Programming, Baltimore, 1998. ACM.]] Google ScholarDigital Library
- 4 M. Blum and S. Kannan. Designing programs that check their work. In Proc. 21st Symposium on the Theory of Computing, pages 86-97. ACM, May 1989.]] Google ScholarDigital Library
- 5 M. Blum, M. Luby, and R. Rubinfeld. Self-testing/correcting with applications to numerical problems. In Proc. 22nd Symposium on the Theory of Computing, pages 73-83. ACM, May 1990.]] Google ScholarDigital Library
- 6 A. Celentano, S. C. Reghizzi, P. Della Vigna, and C. Ghezzi. Compiler testing using a sentence generator. Software Practice &Experience, 10:897-918, 1980.]]Google ScholarCross Ref
- 7 K. Claessen and D. Sands. Observable Sharing for Functional Circuit Description. In Asian Computer Science Conference, Phuket, Thailand, 1999. ACM Sigplan.]] Google ScholarDigital Library
- 8 M. Davis and H. Putnam. A computing procedure for quanti~cation theory. Journal of the Association for Computing Machinery, 7(3):201-215, 1960.]] Google ScholarDigital Library
- 9 J. Duran and S. Ntafos. An evaluation of random testing. Transactions on Software Engineering, 10(4):438-444, July 1984.]]Google ScholarDigital Library
- 10 J. Gannon, R. Hamlet, and P. McMullin. Data abstraction implementation, specification, and testing. Trans. Prog. Lang. and Systems, (3):211-223, 1981.]] Google ScholarDigital Library
- 11 D. Hamlet. Random testing. In J. Marciniak, editor, Encyclopedia of Software Engineering, pages 970-978. Wiley, 1994.]]Google Scholar
- 12 R. Hamlet and R. Taylor. Partition testing does not inspire confidence. Transactions on Software Engineering, 16(12):1402-1411, December 1990.]] Google ScholarDigital Library
- 13 J. Hughes. Why Functional Programming Matters. In D. Turner, editor, Research Topics in Functional Programming. Addison Wesley, 1990.]] Google ScholarDigital Library
- 14 M. P. Jones. The Hugs distribution. Currently available from http://haskell.org/hugs, 1999.]]Google Scholar
- 15 P. M. Maurer. Generating test data with enhanced context-free grammars. IEEE Software, 7(4):50-56, 1990.]] Google ScholarDigital Library
- 16 Gunnar Stalmarck. A System for Determining Propositional Logic Theorems by Applying Values and Rules to Triplets that are Generated from a Formula, 1989. Swedish Patent No. 467 076 (approved 1992), U.S. Patent No. 5 276 897 (1994), European Patent No. 0403 454 (1995).]]Google Scholar
- 17 Philip Wadler. Theorems for free! In International Conference onFunctional Programming and Computer Architecture, London, September 1989.]] Google ScholarDigital Library
- 18 Philip Wadler. A prettier printer, March 1998. Draft paper.]]Google Scholar
- 19 H. Zhu, P. Hall, and J. May. Software unit test coverage and adequacy. Computing Surveys, 29(4):366-427, December 1997.]] Google ScholarDigital Library
Index Terms
- QuickCheck: a lightweight tool for random testing of Haskell programs
Recommendations
QuickCheck: a lightweight tool for random testing of Haskell programs
QuickCheck is a tool which aids the Haskell programmer in formulating and testing properties of programs. Properties are discribed as Haskell functions, and can be automatically tested on random input, but it is also possible to define custom test data ...
Testing monadic code with QuickCheck
QuickCheck is a previously published random testing tool for Haskell programs. In this paper we show how to use it for testing monadic code, and in particular imperative code written using the ST monad. QuickCheck tests a program against a specification:...
QuickCheck: a lightweight tool for random testing of Haskell programs
ICFP '00: Proceedings of the fifth ACM SIGPLAN international conference on Functional programmingQuick Check is a tool which aids the Haskell programmer in formulating and testing properties of programs. Properties are described as Haskell functions, and can be automatically tested on random input, but it is also possible to define custom test data ...
Comments