Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
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 http://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)Forge: A Tool and Language for Teaching Formal MethodsProceedings of the ACM on Programming Languages10.1145/36498338:OOPSLA1(613-641)Online publication date: 29-Apr-2024
  • (2024)Probeable Problems for Beginner-level Programming-with-AI ContestsProceedings of the 2024 ACM Conference on International Computing Education Research - Volume 110.1145/3632620.3671108(166-176)Online publication date: 12-Aug-2024
  • (2024)Simulation-Based Testing of Simulink Models With Test Sequence and Test Assessment BlocksIEEE Transactions on Software Engineering10.1109/TSE.2023.334375350:2(239-257)Online publication date: 1-Feb-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

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]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 September 2000
Published in SIGPLAN Volume 35, Issue 9

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1,239
  • Downloads (Last 6 weeks)272
Reflects downloads up to 15 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Forge: A Tool and Language for Teaching Formal MethodsProceedings of the ACM on Programming Languages10.1145/36498338:OOPSLA1(613-641)Online publication date: 29-Apr-2024
  • (2024)Probeable Problems for Beginner-level Programming-with-AI ContestsProceedings of the 2024 ACM Conference on International Computing Education Research - Volume 110.1145/3632620.3671108(166-176)Online publication date: 12-Aug-2024
  • (2024)Simulation-Based Testing of Simulink Models With Test Sequence and Test Assessment BlocksIEEE Transactions on Software Engineering10.1109/TSE.2023.334375350:2(239-257)Online publication date: 1-Feb-2024
  • (2024)Navigating Confidentiality in Test Automation: A Case Study in LLM Driven Test Data Generation2024 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER60148.2024.00041(337-348)Online publication date: 12-Mar-2024
  • (2024)Executable contracts for elixirJournal of Logical and Algebraic Methods in Programming10.1016/j.jlamp.2024.101019(101019)Online publication date: Oct-2024
  • (2024)Exploring behaviours of RESTful APIs in an industrial settingSoftware Quality Journal10.1007/s11219-024-09686-032:3(1287-1324)Online publication date: 1-Sep-2024
  • (2024)Verification Technology for VDM: Craft and AutomationThe Practice of Formal Methods10.1007/978-3-031-66676-6_6(109-130)Online publication date: 4-Sep-2024
  • (2024)Validation of Formal Models: A Case StudyThe Practice of Formal Methods10.1007/978-3-031-66673-5_15(292-313)Online publication date: 4-Sep-2024
  • (2024)Relational Synthesis of Recursive Programs via Constraint Annotated Tree AutomataComputer Aided Verification10.1007/978-3-031-65633-0_3(41-63)Online publication date: 24-Jul-2024
  • (2024)Exceptional Interprocedural Control Flow Graphs for x86-64 BinariesDetection of Intrusions and Malware, and Vulnerability Assessment10.1007/978-3-031-64171-8_1(3-22)Online publication date: 9-Jul-2024
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media