- Home
- Property-Based Testing Tools
- FsCheck
FsCheck
What it is
FsCheck is a free library that automatically checks properties of .NET programs against randomly generated inputs. 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. When a property fails, FsCheck shrinks the failing input and reports a minimal counterexample. Developers can define custom generators and shrinkers and package them together in Arbitrary instances.
The project documents integrations with xUnit.net and NUnit, as well as user-created integrations for Expecto, Fuchu, AutoFixture, and MSTest. FsCheck and its NUnit and xUnit.NET plugins are available through NuGet. Its BSD license permits modification and redistribution for commercial and non-commercial use. The project notes that its documentation covers version 2.x and is outdated and incomplete, while version 3.x is maintained and receives fixes and features. Stateful model-based testing is experimental and has no semantic-versioning guarantees. Properties cannot have generic types, and the documented function for expecting exceptions is not available in the C# API.
For and against
For
- Works with properties expressed in F#, C#, or VB.
- Reports a minimal counterexample when a property fails.
- Supports custom generators and shrinkers.
- Documents xUnit.net and NUnit integrations.
- BSD licensing permits commercial and non-commercial redistribution.
Against
- Documentation covers outdated and incomplete version 2.x.
- Stateful model-based testing is experimental.
- Properties cannot have generic types.
- The documented exception function is absent from the C# API.
The verdict
FsCheck offers property-based checks, generated inputs, and shrinking for .NET projects. Developers should account for the documentation gap and the experimental status of its stateful testing API.
Who it suits
FsCheck is for developers testing properties of .NET programs with generated inputs. It fits teams using F#, C#, or VB and a supported test runner or framework.
Plans and prices
FsCheck
BSD-licensed library · NuGet packages
Read 7 Oct 2026 · fscheck.github.io
On the record
- Audience
- FsCheck is for developers who want to test properties of .NET programs with generated inputs.fscheck.github.io · read 7 Oct 2026
- C# limitation
- The documented function for expecting exceptions is not available in the C# API.fscheck.github.io · read 7 Oct 2026
- Counterexamples
- When a property fails, FsCheck displays a minimal counterexample.fscheck.github.io · read 7 Oct 2026
- Current documentation
- The project says its 2.x documentation is out of date and incomplete, while version 3.x is maintained and receives new features and fixes.fscheck.github.io · read 7 Oct 2026
- Documentation status
- The site warns that its documentation covers version 2.x while version 3.x is maintained and receives new features and fixes.fscheck.github.io · read 7 Oct 2026
- Experimental feature
- The experimental model-based testing API is exempt from semantic versioning guarantees, so minor releases may break code using it.fscheck.github.io · read 7 Oct 2026
- Failure reports
- When a property fails, FsCheck displays a minimal counterexample by shrinking the failing input.fscheck.github.io · read 7 Oct 2026
- Generators
- Users can define custom test data generators and shrinkers, and package them together in Arbitrary instances.fscheck.github.io · read 7 Oct 2026
- Installation
- FsCheck and its NUnit and xUnit.NET plugins can be installed from NuGet.fscheck.github.io · read 7 Oct 2026
- Integrations
- The project documents integrations with xUnit.net and NUnit, and user-created integrations with Expecto, Fuchu, AutoFixture and MSTest.fscheck.github.io · read 7 Oct 2026
- Languages
- Properties can be expressed in F#, C# or VB.fscheck.github.io · read 7 Oct 2026
- License
- The project says its BSD license permits modification and redistribution for commercial and non-commercial purposes.fscheck.github.io · read 7 Oct 2026
- Property limitation
- Properties cannot have generic types; the documentation says type annotations can be used to resolve types.fscheck.github.io · read 7 Oct 2026
- Purpose
- FsCheck automatically tests .NET programs by checking properties against randomly generated cases.fscheck.github.io · read 7 Oct 2026
- Stateful testing
- Model-based testing for stateful systems and objects is in the Experimental namespace, where semantic-versioning promises do not apply.fscheck.github.io · read 7 Oct 2026
- Support
- The project invites users to report issues on GitHub and says contributors may open issues about documentation problems or gaps.fscheck.github.io · read 7 Oct 2026
- Testing modes
- FsCheck includes a built-in test runner and can run properties from F# or C# interactive, command-line programs or test frameworks.fscheck.github.io · read 7 Oct 2026
- Test runner
- FsCheck includes a built-in runner usable from F# or C# Interactive, command-line programs, or a test framework.fscheck.github.io · read 7 Oct 2026