FsCheck vs Hypothesis
FsCheck
fscheck.github.ioHypothesis
hypothesis.worksSide by side
| Figure | FsCheck | Hypothesis |
|---|---|---|
| Price from | Free | — |
| Free plan | Yes | — |
| Free trial | — | — |
| Open source | — | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| Plans published | 1 | 0 |
| Spec score · Property-Based Testing Tools | 8.4 (#3) | 7.4 (#15) |
| Integrations | The project documents integrations with xUnit.net and NUnit, and user-created integrations with Expecto, Fuchu, AutoFixture and MSTest. | First-party extras include integrations for specific packages, and the documentation gives Django as an example installable extra. |
| Stateful testing | Model-based testing for stateful systems and objects is in the Experimental namespace, where semantic-versioning promises do not apply. | Rule-based state machines let Hypothesis generate sequences of operations to test stateful systems and objects. |
Plans
In their own words
FsCheck
FsCheck checks properties of.NET programs against randomly generated cases. Developers can express properties in F#, C# or VB, then run them with the built-in runner from an interactive session, a command-line program or a test framework. Integrations are documented for xUnit.net and NUnit, with user-created integrations for Expecto, Fuchu, AutoFixture and MSTest. When a property fails, FsCheck shrinks the input and shows a minimal counterexample. Developers can also define custom generators and shrinkers and group them in Arbitrary instances. The library supports parameterized cases and parallel execution, and its packages and NUnit and xUnit.NET plugins are available from NuGet. FsCheck is free: its listed plan is free, with a BSD license permitting commercial and non-commercial modification and redistribution. It runs on Linux, macOS and Windows. The project maintains version 3.x, but its documentation covers 2.x and is described as out of date and incomplete. Its model-based testing API is experimental and exempt from semantic-versioning guarantees.
Hypothesis
Hypothesis is a free property-based testing library for Python. You describe behavior that your code should satisfy, and it generates inputs—including edge cases—to explore whether those properties hold. Strategies let you define and combine the data used in tests. When a failure appears, Hypothesis reports an example and tries to simplify it; failing examples are stored in a local test database for replay in later runs. Tests run as ordinary Python functions within pytest, unittest, nose, or another framework that can run a Python function. Hypothesis is not itself a test runner. By default, it generates 100 random inputs per test, and max_examples controls that count. Rule-based state machines can generate sequences of operations for testing stateful systems and objects. The project supports and tests CPython and PyPy 3.10 and later, and says it regularly works on Linux, macOS, Windows, and Emscripten. Its compatibility policy supports only the newest Hypothesis version; undocumented behavior may change in patch releases.