Home

Awesome

Overview of Property-Based Testing Functionality

Property-based testing (PBT) frameworks come with a number of different features, but which library supports which features? For a PBT newcomer, it can be hard to tell. Strictly speaking you don't even need a PBT framework. Property-based tests can be written from scratch on a case-by-case basis using a random number generator. One can even test stateful code without a state-machine framework, e.g., as outlined here. However a framework provides reusable parts and infrastructure, thus paving the way for bigger developments, such as property-based testing automotive software against the AUTOSAR specification.

This overview is to help myself keep track. It has been compiled over a number of years teaching PBT. As features are gradually added to a framework the table's entries may unfortunately become outdated. YMMV.

I'll be happy to accept PRs for updating entries and adding new frameworks.

Framework functionality

FrameworkLanguageGen. EDSLShrinkingInt. shr.State machinePar. st. mach.Cov. guidance
QuickCheckErlang:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
PropErErlang:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
QuickCheckHaskell:heavy_check_mark::heavy_check_mark:( :heavy_check_mark: )( :heavy_check_mark: )
SmallCheckHaskell:heavy_check_mark:<sup>1</sup><sup>1</sup>
HedgehogHaskell:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
Scala-HedgehogScala / JVM:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
R-HedgehogR:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
FSharp-HedgehogF# / .Net:heavy_check_mark::heavy_check_mark::heavy_check_mark:
HypothesisPython:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:( :heavy_check_mark: )<sup>2</sup>( :heavy_check_mark: ), ( :heavy_check_mark: )
TSTLPython<sup>3</sup>:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
ScalaCheckScala / JVM:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
gopterGo:heavy_check_mark::heavy_check_mark::heavy_check_mark:
RapidGo:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
propCheckKotlin:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
FsCheckF# / .Net:heavy_check_mark::heavy_check_mark::heavy_check_mark:
CsCheckC# / .Net:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
fast-checkJS / TS:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:( :heavy_check_mark: )<sup>2</sup>
QCheckOCaml:heavy_check_mark::heavy_check_mark::heavy_check_mark:<sup>4</sup>:heavy_check_mark::heavy_check_mark:
CrowbarOCaml:heavy_check_mark:( :heavy_check_mark: )<sup>5</sup>:heavy_check_mark:
MonolithOCaml:heavy_check_mark:( :heavy_check_mark: )<sup>5</sup>:heavy_check_mark:
Base_quickcheckOCaml:heavy_check_mark::heavy_check_mark:
PopperOCaml:heavy_check_mark::heavy_check_mark::heavy_check_mark:
junit-quickcheckJava:heavy_check_mark::heavy_check_mark:( :heavy_check_mark: )<sup>6</sup>
QuickTheoriesJava:heavy_check_mark::heavy_check_mark::heavy_check_mark:( :heavy_check_mark: )( :heavy_check_mark: ):heavy_check_mark:
jqwikJava:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
quickcheckRust:heavy_check_mark::heavy_check_mark:
propcheckRust:heavy_check_mark::heavy_check_mark::heavy_check_mark:
FoxObj.C / Swift:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:( :heavy_check_mark: )
SwiftCheckSwift:heavy_check_mark::heavy_check_mark:
RapidCheckC++:heavy_check_mark::heavy_check_mark::heavy_check_mark:( :heavy_check_mark: )
test.checkClojure:heavy_check_mark::heavy_check_mark::heavy_check_mark:??
Lua-QuickCheckLua:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
theftC( :heavy_check_mark: ):heavy_check_mark:( :heavy_check_mark: )( :heavy_check_mark: )
DeepStateC / C++( :heavy_check_mark: ):heavy_check_mark::heavy_check_mark::heavy_check_mark:
EchidnaSolidity / EVM:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
...

Legend:

Footnotes

Background:

The term property-based testing seems to originate from 'Property-Based Testing; A New Approach to Testing for Assurance' by Fink and Bishop (SE Notes 1997). The approach was popularized as an embedded domain-specific language in 'QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs' by Claessen and Hughes (ICFP 2000) which inspired ports to many other languages.

Integrated shrinking is explained in more detail in

State machines to test protocols and systems with state are described in

Parallel state-machine tests for race conditions were later introduced in

Additional resources: