skip to main content
10.1145/351240.351266acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article
Free access

QuickCheck: a lightweight tool for random testing of Haskell programs

Published: 01 September 2000 Publication History

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.

References

[1]
S. Antoy and R. Hamlet. Automatically checking an implementation against its formal specification. In Irvine Software Symposium, pages 29-48, March 1992.]]
[2]
Roland Backhouse, Patrik Jansson, Johan Jeuring, and Lambert Meertens. Generic Programming - An Introduction. In Lecture notes in Computer Science, volume 1608, 1999.]]
[3]
P. Bjesse, K. Claessen, M. Sheeran, and S. Singh. Lava: Hardware Design in Haskell. In International Conference onFunctional Programming, Baltimore, 1998. ACM.]]
[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.]]
[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.]]
[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.]]
[7]
K. Claessen and D. Sands. Observable Sharing for Functional Circuit Description. In Asian Computer Science Conference, Phuket, Thailand, 1999. ACM Sigplan.]]
[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.]]
[9]
J. Duran and S. Ntafos. An evaluation of random testing. Transactions on Software Engineering, 10(4):438-444, July 1984.]]
[10]
J. Gannon, R. Hamlet, and P. McMullin. Data abstraction implementation, specification, and testing. Trans. Prog. Lang. and Systems, (3):211-223, 1981.]]
[11]
D. Hamlet. Random testing. In J. Marciniak, editor, Encyclopedia of Software Engineering, pages 970-978. Wiley, 1994.]]
[12]
R. Hamlet and R. Taylor. Partition testing does not inspire confidence. Transactions on Software Engineering, 16(12):1402-1411, December 1990.]]
[13]
J. Hughes. Why Functional Programming Matters. In D. Turner, editor, Research Topics in Functional Programming. Addison Wesley, 1990.]]
[14]
M. P. Jones. The Hugs distribution. Currently available from https://haskell.org/hugs, 1999.]]
[15]
P. M. Maurer. Generating test data with enhanced context-free grammars. IEEE Software, 7(4):50-56, 1990.]]
[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).]]
[17]
Philip Wadler. Theorems for free! In International Conference onFunctional Programming and Computer Architecture, London, September 1989.]]
[18]
Philip Wadler. A prettier printer, March 1998. Draft paper.]]
[19]
H. Zhu, P. Hall, and J. May. Software unit test coverage and adequacy. Computing Surveys, 29(4):366-427, December 1997.]]

Cited By

View all
  • (2024)ESFuzzer: An Efficient Way to Fuzz WebAssembly InterpreterElectronics10.3390/electronics1308149813:8(1498)Online publication date: 15-Apr-2024
  • (2024)Towards Understanding the Effectiveness of Large Language Models on Directed Test Input GenerationProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695513(1408-1420)Online publication date: 27-Oct-2024
  • (2024)General and Practical Property-based Testing for Android AppsProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3694986(53-64)Online publication date: 27-Oct-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '00: Proceedings of the fifth ACM SIGPLAN international conference on Functional programming
September 2000
294 pages
ISBN:1581132026
DOI:10.1145/351240
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 ACM 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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 September 2000

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

ICFP00
Sponsor:

Acceptance Rates

ICFP '00 Paper Acceptance Rate 24 of 110 submissions, 22%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1,390
  • Downloads (Last 6 weeks)287
Reflects downloads up to 16 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)ESFuzzer: An Efficient Way to Fuzz WebAssembly InterpreterElectronics10.3390/electronics1308149813:8(1498)Online publication date: 15-Apr-2024
  • (2024)Towards Understanding the Effectiveness of Large Language Models on Directed Test Input GenerationProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695513(1408-1420)Online publication date: 27-Oct-2024
  • (2024)General and Practical Property-based Testing for Android AppsProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3694986(53-64)Online publication date: 27-Oct-2024
  • (2024)Validating SMT Solvers for Correctness and Performance via Grammar-Based EnumerationProceedings of the ACM on Programming Languages10.1145/36897958:OOPSLA2(2378-2401)Online publication date: 8-Oct-2024
  • (2024)Semantic-Type-Guided Bug FindingProceedings of the ACM on Programming Languages10.1145/36897888:OOPSLA2(2183-2210)Online publication date: 8-Oct-2024
  • (2024)Refinement Type RefutationsProceedings of the ACM on Programming Languages10.1145/36897458:OOPSLA2(962-987)Online publication date: 8-Oct-2024
  • (2024)Mocking Temporal LogicProceedings of the 2024 ACM SIGPLAN International Symposium on SPLASH-E10.1145/3689493.3689980(98-109)Online publication date: 17-Oct-2024
  • (2024)Software Engineering Methods for AI-Driven Deductive Legal ReasoningProceedings of the 2024 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3689492.3690050(85-95)Online publication date: 17-Oct-2024
  • (2024)(Programs), Proofs and Refutations (and Tests and Mutants)Proceedings of the 2024 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3689492.3689810(223-230)Online publication date: 17-Oct-2024
  • (2024)The Havoc Paradox in Generator-Based Fuzzing (Registered Report)Proceedings of the 3rd ACM International Fuzzing Workshop10.1145/3678722.3685529(3-12)Online publication date: 13-Sep-2024
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media