QuickCheck
{{Short description|Software testing software}}
{{For|the convenience store|QuickChek}}
{{Use mdy dates|date=December 2011}}
{{Infobox software
| name = QuickCheck
| title =
| logo =
| logo caption =
| screenshot =
| caption =
| author =
| developer = Koen Claessen, John Hughes
| released = {{Start date and age|1999}}
| latest release version = 2.14.2
| latest release date = {{Start date and age|2020|11|14|df=yes}}
| latest preview version =
| latest preview date =
| repo = {{URL|https://github.com/nick8325/quickcheck}}
| programming language = Haskell
| operating system = Unix-like, Windows
| platform =
| size =
| language = English
| genre = Software testing
| license = BSD-style
| alexa =
| website = {{URL|www.cse.chalmers.se/~rjmh/QuickCheck}}
}}
QuickCheck is a software library, a combinator library, originally written in the programming language Haskell, designed to assist in software testing by generating test cases for test suites – an approach known as property testing.
Software
It is compatible with the compiler, Glasgow Haskell Compiler (GHC) and the interpreter, Haskell User's Gofer System (Hugs). It is free and open-source software released under a BSD-style license.
In QuickCheck, assertions are written about logical properties that a function should fulfill. Then QuickCheck attempts to generate a test case that falsifies such assertions. Once such a test case is found, QuickCheck tries to reduce it to a minimal failing subset by removing or simplifying input data that are unneeded to make the test fail.
The project began in 1999. Besides being used to test regular programs, QuickCheck is also useful for building up a functional specification, for documenting what functions should be doing, and for testing compiler implementations.{{cite web |url=http://hackage.haskell.org/packages/archive/collections-api/1.0.0.0/doc/html/Data-Collections-Properties.html |title=Data.Collections.Properties |website=hackage.haskell.org}}
Re-implementations of QuickCheck exist for many languages:
{{div col|colwidth=20em}}
- C{{cite web |last=Pennebaker |first=Andrew (mcandre) |url=https://github.com/mcandre/qc |title=qc |website=GitHub |date=October 13, 2011 |access-date=December 9, 2011}}{{cite web |last=Zito |first=Andrea (nivox) |url=https://github.com/nivox/quickcheck4c |title=quickcheck4c |website=GitHub |date=July 27, 2014 |access-date=July 27, 2014}}{{cite web |last=Vokes |first=Scott |url=https://github.com/silentbicycle/theft |title=Theft: property-based testing for C |website=GitHub |date=March 30, 2015 |access-date=November 16, 2015}}
- C++{{cite web |url=http://software.legiasoft.com/quickcheck/ |title=QuickCheck |website=Software.legiasoft.com |access-date=December 9, 2011}}{{cite web |url=https://github.com/philipp-classen/CppQuickCheck |title=CppQuickCheck |website=GitHub |access-date=March 30, 2015}}{{cite web |url=https://github.com/emil-e/rapidcheck |title=RapidCheck |website=GitHub |access-date=March 30, 2015}}
- Chicken{{cite web |last=Pennebaker |first=Andrew (mcandre) |url=https://github.com/mcandre/cluckcheck |title=cluckcheck |website=GitHub |access-date=December 9, 2011}}
- Clojure{{cite web |last=Draper |first=Reid (reiddraper) |url=https://github.com/reiddraper/simple-check |title=simple-check |website=GitHub |date=May 9, 2013 |access-date=August 21, 2013}}{{cite web |last=Draper |first=Reid (reiddraper) |url=https://github.com/clojure/test.check |title=org.clojure/test.check |website=GitHub |date=March 27, 2014 |access-date=March 27, 2014}}
- Common Lisp{{cite web |url=http://www.cliki.net/cl-quickcheck |title=cl-quickcheck |website=Cliki |access-date=December 9, 2011}}
- Coq{{cite web |url=https://github.com/QuickChick/QuickChick |title=QuickChick |website=GitHub |access-date=August 26, 2019}}
- D{{cite web |last=Pennebaker |first=Andrew (mcandre) |url=https://github.com/mcandre/dashcheck |title=dashcheck |website=GitHub |date=October 27, 2011 |access-date=December 9, 2011}}
- Elm{{cite web |url=https://github.com/elm-explorations/test |title=elm-explorations/test |website=GitHub |access-date=November 20, 2018}}
- Elixir{{cite web |url=https://github.com/pragdave/quixir |title=quixir: Property-based testing for Elixir |last=Thomas |first=Dave (pragdave) |date=2017-07-17 |website=GitHub |access-date=2019-04-01}}{{cite web |url=https://github.com/alfert/propcheck |title=propcheck: Property based testing for Elixir |last=Alfert|first=Klaus |website=GitHub |access-date=2021-02-01}}
- Erlang{{cite web|url=https://github.com/proper-testing/proper|title=PropEr: a QuickCheck-inspired property-based testing tool for Erlang|website=GitHub|access-date=May 8, 2019}}
- F#, and C#, Visual Basic (.NET) (VB.NET){{cite web |url=https://fscheck.github.io/FsCheck |title=FsCheck |website=GitHub |date=June 25, 2015 |access-date=June 25, 2011}}
- Factor{{cite web |last=Pennebaker |first=Andrew (mcandre) |url=https://github.com/mcandre/factcheck |title=factcheck |website=GitHub |date=October 13, 2011 |access-date=December 9, 2011}}
- Go{{cite web |author=leanovate |url=https://github.com/leanovate/gopter |title=Gopter |website=GitHub |date=April 26, 2016 |access-date=April 26, 2016}}
- Io{{cite web |last=Pennebaker |first=Andrew (mcandre) |url=https://github.com/mcandre/IoCheck |title=IoCheck |website=GitHub |date=October 17, 2011 |access-date=December 9, 2011}}
- Java{{cite web |url=https://github.com/functionaljava/functionaljava/ |title=FunctionalJava's QuickCheck module |website=FunctionalJava |access-date=August 14, 2015}}{{cite web |url=https://bitbucket.org/blob79/quickcheck |title=Quickcheck for Java |website=Quickcheck.dev.java.net |access-date=December 9, 2011}}{{cite web |url=http://www.jcheck.org/ |title=JCheck |website=JCheck |access-date=December 9, 2011}}{{cite web |url=https://github.com/pholser/junit-quickcheck/ |title=junit-quickcheck |website=junit-quickcheck |access-date=July 3, 2013}}{{cite web |url=http://jqwik.net/ |title=jqwik for the JUnit5 Platform |website=jqwik |access-date=June 19, 2017}}{{cite web |url=https://github.com/ncredinburgh/QuickTheories |title=Quick Theories property testing for Java 8 |website=ncredinburgh |access-date=October 30, 2017}}{{cite web |url=https://github.com/JetBrains/jetCheck |title=jetCheck property-based testing for Java 8 |website=JetBrains |access-date=July 10, 2018}}
- JavaScript{{cite web |last=Thompson |first=Darrin (darrint) |url=http://bitbucket.org/darrint/qc.js/ |title=qc.js |website=Bitbucket |access-date=December 9, 2011}}{{cite web |last=Crockford |first=Douglas |url=https://github.com/douglascrockford/JSCheck |title=jscheck |website=GitHub |access-date=October 21, 2017}}{{cite web |last=Dubien |first=Nicolas (dubzzz) |url=https://github.com/dubzzz/fast-check |title=fast-check |website=GitHub |access-date=February 3, 2018}}{{cite web |title=JSVerify — property based testing for JavaScript. Like QuickCheck. |url=https://jsverify.github.io |website=jsverify.github.io}}
- Julia{{cite web |url=https://github.com/pkalikman/Checkers.jl |title=Checkers.jl |website=GitHub |access-date=April 8, 2018}}
- Logtalk{{cite web |url=https://logtalk.org/manuals/devtools/lgtunit.html |title=lgtunit |access-date=February 26, 2020}}
- Lua{{cite web |url=https://github.com/luc-tielen/lua-quickcheck |title=lua-quickcheck |website=GitHub |access-date=February 25, 2017}}
- Mathematica{{Cite web|title=QuickCheck.wl — Automated Property-Based Testing for the Wolfram Language - Online Technical Discussion Groups—Wolfram Community|url=https://community.wolfram.com/groups/-/m/t/2309649|access-date=2021-07-11|website=community.wolfram.com|language=en-US}}
- Objective-C{{cite web |last=Pennebaker |first=Andrew (mcandre) |url=https://github.com/mcandre/objcheck |title=objcheck |website=GitHub |access-date=December 9, 2011}}
- OCaml{{cite web |last=Cruanes |first=Simon |url=https://github.com/c-cube/qcheck |title=QuickCheck inspired property-based testing for OCaml. |website=GitHub |access-date=September 1, 2022}}
- Perl{{cite web |url=https://metacpan.org/module/Test::LectroTest::Tutorial |title=Test: LectroTest: Tutorial |quote=The LectroTest project was inspired by Haskell's QuickCheck module by Koen Claessen and John Hughes}}
- Prolog{{cite web |url=http://www.swi-prolog.org/pack/list?p=quickcheck |title=library(quickcheck)}}{{cite book |chapter-url=http://repositorio.inesctec.pt/bitstreams/8eba3be3-020c-4ab3-9b49-398b3b65a561/download
|last1=Amaral |first1=Claudio |last2=Florido |first2=Mario |last3=Costa |first3=Vitor Santos |year=2014
|chapter=PrologCheck - Property-based testing in Prolog
|title=Proceedings of the Twelfth International Symposium on Functional and Logic Programming (FLOPS 2014)
|volume=8475 |pages=1–17 |doi=10.1007/978-3-319-07151-0_1 |series=Lecture Notes in Computer Science |isbn=978-3-319-07150-3 }}
- PHP{{cite web |last=Oestreicher |first=Stefan (steos) |url=https://github.com/steos/php-quickcheck |title=PhpQuickCheck |website=GitHub |access-date=November 12, 2015}}
- Pony{{cite web |last=Wahl |first=Matthias (mfelsche) |url=https://github.com/mfelsche/ponycheck |title=ponycheck |website=GitHub |access-date=December 26, 2018}}
- Python{{cite web |last=MacIver |first=David |url=https://hypothesis.works/articles/quickcheck-in-every-language/ |title=QuickCheck in Every Language |date=April 16, 2016 |access-date=Aug 1, 2022}}
- R{{cite web |url=https://github.com/armcn/quickcheck |title=quickcheck: Property Based Testing in R |date=March 17, 2022 |website=GitHub}}
- Racket{{cite web |url=https://docs.racket-lang.org/quickcheck/index.html |title=Quickcheck |website=docs.racket-lang.org}}
- Ruby{{cite web |url=https://github.com/mcandre/rubycheck |title=Rubycheck: a Ruby port of the QuickCheck unit test framework |last=Pennebaker |first=Andrew (mcandre) |date=September 14, 2017 |website=GitHub}}
- Rust{{cite web |last=Gallant |first=Andrew (BurntSushi) |url=https://github.com/BurntSushi/quickcheck |title=QuickCheck for Rust (with shrinking) |website=GitHub |access-date=May 27, 2015}}{{cite web |url=https://github.com/altsysrq/proptest |title=Hypothesis-like property testing for Rust|website=GitHub }}
- Scala{{cite web |url=https://github.com/rickynils/scalacheck |title=ScalaCheck |website=GitHub |access-date=June 30, 2016}}{{Cite web |url=https://github.com/scalaprops/scalaprops |title=scalaprops/scalaprops |website=GitHub |access-date=2016-06-30}}{{Cite web |url=https://github.com/japgolly/nyaya |title=nyaya |website=GitHub |access-date=2016-06-30}}
- Scheme{{cite web |url=http://www.inf.ufrgs.br/~carlossch/scheme-check/ |title=Scheme-Check: Randomized Unit Testing for PLT Scheme |archive-url=https://web.archive.org/web/20050212183945/http://www.inf.ufrgs.br/~carlossch/scheme-check/ |archive-date=2005-02-12 |quote=Scheme-Check is a module that implements randomized unit testing in PLT Scheme. With Scheme-Check, instead of creating many individual tests, you specify properties of your code and Scheme-Check generates a large amount of random data sets to test those properties. Scheme-Check is basically a Scheme port of QuickCheck.}}{{Cite web |first=Antero|last=Mejr|url=https://srfi.schemers.org/srfi-252/|title=SRFI 252: Property Testing|website=Scheme Requests for Implementation|access-date=2024-04-25}}
- Smalltalk{{cite web |last=Pennebaker |first=Andrew (mcandre) |url=https://github.com/mcandre/quicksmash |title=QuickSmash |website=GitHub |access-date=December 9, 2011}}
- Standard ML{{cite web |url=http://contrapunctus.net/league/haques/qcheck/ |title=QCheck/SML |website=Contrapunctus |date=November 22, 2011 |access-date=December 9, 2011}}
- Swift{{cite web |url=https://github.com/typelift/SwiftCheck |title=SwiftCheck: QuickCheck for Swift |date=November 3, 2017 |website=GitHub}}
- TypeScript{{cite web |last=Dubien |first=Nicolas (dubzzz) |url=https://github.com/dubzzz/fast-check |title=fast-check |website=GitHub |access-date=February 3, 2018}}
- Whiley{{cite web |last=Chin |first=Janice |url=http://ecs.victoria.ac.nz/~djp/files/JaniceChinENGR489.pdf |title=QuickCheck for Whiley |access-date=April 20, 2020}}
{{div col end}}
See also
References
{{Reflist}}
Further reading
{{Refbegin}}
- {{cite journal
|last1=Claessen |first1=Koen |last2=Hughes |first2=John |year=2002
|title=Testing Monadic Programs with QuickCheck
|journal=SIGPLAN Notices
|volume=37
|issue=12
|pages=47–59
|url=http://www.cse.chalmers.se/~rjmh/Papers/QuickCheckST.ps
|format=PostScript
|access-date=2006-01-29
|doi=10.1145/636517.636527
|citeseerx=10.1.1.111.1618}}
- {{cite journal
|last1=Claessen |first1=Koen |last2=Hughes |first2=John
|name-list-style=amp |year=2000
|title=QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs
|journal=Proceedings of the International Conference on Functional Programming (ICFP), ACM SIGPLAN
|url=http://www.eecs.northwestern.edu/%7Erobby/courses/395-495-2009-fall/quick.pdf
|access-date=2006-01-29
}}
- {{cite journal |last1=Claessen |first1=Koen |last2=Hughes |first2=John |name-list-style=amp |year=2003 |title=Specification Based Testing with QuickCheck |journal=The Fun of Programming, Cornerstones of Computing, Jeremy Gibbons and Oege de Moor (Eds.) |publisher=Palgrave |pages=17–40 |url=http://www.math.chalmers.se/~koen/pubs/entry-fop-quickcheck.html |access-date=2006-01-29 |url-status=dead |archive-url=https://web.archive.org/web/20070704035801/http://www.math.chalmers.se/~koen/pubs/entry-fop-quickcheck.html |archive-date=July 4, 2007 |df=mdy-all}}
- {{cite journal |last=Claessen |first=Koen |date=August 2004 |title=QuickCheck: Specification-based Random Testing |journal=Presentation at Summer Institute on Trends in Testing: Theory, Techniques and Tools |url=http://www.math.chalmers.se/~koen/pubs/entry-tt04-quickcheck.html |format=PPT |access-date=2006-01-29 |url-status=dead |archive-url=https://web.archive.org/web/20070430065923/http://www.math.chalmers.se/~koen/pubs/entry-tt04-quickcheck.html |archive-date=April 30, 2007}}
- {{cite journal |last1=Claessen |first1=Koen |last2=Runciman |first2=Colin |last3=Chitil |first3=Olaf |last4=Hughes |first4=John |name-list-style=amp |year=2002 |title=Testing and Tracing Lazy Functional Programs Using QuickCheck and Hat |journal=Advanced Functional Programming: 4th International School, Lecture Notes in Computer Science |publisher=Springer Verlag |volume=2638 |pages=59–99 |url=http://www.cs.chalmers.se/~koen/pubs/afp02-quickcheck.ps |format=PostScript |access-date=2006-01-29 |url-status=dead |archive-url=https://web.archive.org/web/20061012125122/http://www.cs.chalmers.se/~koen/pubs/afp02-quickcheck.ps |archive-date=October 12, 2006}}
{{Refend}}
External links
{{Wikibooks|Haskell/Testing}}
- [https://hackage.haskell.org/package/QuickCheck QuickCheck] on Hackage
{{Haskell programming}}
Category:Software testing tools
Category:Free computer libraries
Category:Free software programmed in Haskell