Freedom251 › Unit Testing Frameworks
FsCheck

What FsCheck is
FsCheck is a free library for automatically checking properties of .NET programs using randomly generated inputs. Developers can express properties in F#, C# or VB, then run them with FsCheck’s built-in runner from an F# or C# Interactive session, a command-line program or a test framework. The project documents integrations with xUnit.net and NUnit, as well as user-created integrations for Expecto, Fuchu, AutoFixture and MSTest.
When a property fails, FsCheck shrinks the failing input and reports a minimal counterexample. Developers can create custom data generators and shrinkers and package them together as Arbitrary instances. The library supports parameterized cases and parallel execution. FsCheck and its NUnit and xUnit.NET plugins are available as NuGet packages.
The project’s BSD license permits modification and redistribution for commercial and non-commercial purposes. Its maintained version is 3.x, while the documentation covers version 2.x and is described as outdated and incomplete. Stateful model-based testing is available in an experimental API that does not carry semantic-versioning guarantees. Properties cannot have generic types, though type annotations can resolve types. The documented function for expecting exceptions is not available in the C# API.
Who it suits
FsCheck suits .NET developers who want to check program properties against generated inputs, including teams writing properties in F#, C# or VB. It can fit workflows using its built-in runner or documented xUnit.net and NUnit integrations, and also supports several user-created integrations.
What it does well
- Checks properties using randomly generated inputs.
- Supports properties written in F#, C# and VB.
- Shrinks failures to minimal counterexamples.
- Allows custom generators and shrinkers grouped as Arbitrary instances.
- Supports parameterized cases and parallel execution.
- BSD license permits commercial and non-commercial redistribution.
What to know first
- The documentation covers version 2.x and is described as outdated and incomplete.
- Experimental stateful testing has no semantic-versioning guarantees.
- Properties cannot have generic types.
- The documented exception-expectation function is unavailable in the C# API.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| FsCheck | BSD-licensed library · NuGet packages | Free |
As fscheck.github.io lists them, read 7 Oct 2026. The maker's own page has the final word.
Getting started
- Visit the FsCheck website.
- Install FsCheck or its NUnit or xUnit.NET plugin from NuGet.
- Write properties in F#, C# or VB.
- Run properties with the built-in runner from an interactive session, command-line program or test framework.
- Use the documented xUnit.net or NUnit integration, or a user-created integration.
FsCheck is a free property-based testing library for .NET, built for developers who want to check rules across generated inputs in F#, C# or VB. Its shrinking can turn a failing case into a smaller counterexample, making it a strong fit when edge cases matter and a less straightforward choice when the experimental stateful API or C# exception checks are central to the workflow.
Overview
FsCheck exercises properties against randomly generated cases, helping developers probe behavior beyond a fixed set of examples. The property still has to capture the rule that matters, so the library is most useful when a team can state expected behavior clearly and wants varied inputs to challenge it.
When a property fails, shrinking reduces the input and reports a minimal counterexample. That gives developers a more focused starting point for diagnosing a failure. Custom generators and shrinkers, bundled as Arbitrary instances, let teams tailor both the test data and how failing cases are simplified.
FsCheck includes a runner for F# or C# Interactive, command-line programs and test frameworks. It documents integrations with xUnit.net and NUnit, alongside user-created integrations for Expecto, Fuchu, AutoFixture and MSTest. That range makes it practical to add property checks to several .NET testing setups, though the user-created integrations are not presented as project-documented integrations.
Key features
- Properties across .NET languages: Checks can be expressed in F#, C# or VB, with parameterized cases and parallel execution supported. The restriction is that properties cannot have generic types; type annotations can resolve types where needed.
- Generated data and shrinking: Custom generators and shrinkers give developers control over input shape and failure reduction. This is valuable for domain-specific data, while still requiring work to define suitable generators.
- Framework flexibility: The built-in runner works from interactive sessions, command-line programs or test frameworks. NuGet packages are available for FsCheck and its NUnit and xUnit.NET plugins.
- Stateful model-based checks: FsCheck has an experimental API for testing stateful systems and objects. Its exemption from semantic-versioning guarantees means minor releases may break code using that API, so it is a riskier foundation for compatibility-sensitive suites.
Pricing
FsCheck — free: The plan is a BSD-licensed library distributed as NuGet packages. There is no paid tier or free-trial period in the plan structure; the license permits modification and redistribution for commercial and non-commercial use. This suits teams that need a no-cost property-testing library and want permission to adapt or redistribute it.
Platforms
FsCheck supports Linux, macOS and Windows. Its supported languages are F#, C# and VB, so it fits .NET teams working across those operating systems.
Who it's for
FsCheck is a good fit for .NET developers who can express important behavior as properties and want generated cases to probe them. It is especially useful when custom data generation and minimized failure examples can make tricky inputs easier to investigate. Teams relying on stable stateful API compatibility should be cautious, and C# users who need the documented function for expecting exceptions will need another approach.
Pros and cons
- Pros: Free BSD licensing permits commercial and non-commercial use, modification and redistribution.
- Pros: Shrinking produces minimal counterexamples, making generated failures more focused to debug.
- Pros: Custom generators, shrinkers, a built-in runner and multiple integrations support varied .NET workflows.
- Cons: The experimental stateful API carries no semantic-versioning guarantee, so minor releases may break dependent code.
- Cons: Generic properties are unsupported, and the documented exception-expectation function is unavailable in the C# API.
- Cons: The project says its 2.x documentation is out of date and incomplete while 3.x is maintained and receives features and fixes. The documentation gap can make adoption and troubleshooting harder.
Alternatives
For another free property-testing library, Racket QuickCheck is a fit for Racket users; it is distributed as a Racket package and requires Racket v6.0 or newer. ScalaCheck is the corresponding option to consider for Scala, with a free BSD-3-Clause open-source library.
fast-check is a free, MIT-licensed JavaScript/TypeScript option for projects in that ecosystem. Go teams can consider Gopter, a free MIT-licensed Go property-testing library. JSVerify is another free open-source JavaScript property-based testing library.
Ruby developers can look at PropCheck, a free MIT-licensed gem requiring Ruby 2.5.1 or newer. QCheck is a free BSD-2-Clause OCaml property-testing library. For Scala, Scala Hedgehog is a free open-source testing library with no paid plans.
Browse more options in Property-Based Testing Tools or compare the broader Unit Testing Frameworks category.
Verdict
Choose FsCheck when you want free, permissively licensed property checks in a .NET workflow, with control over generated data and minimized failure examples. Its practical reach across F#, C# and VB and its built-in runner make it a capable choice for teams extending beyond hand-picked cases. Look elsewhere if a stable experimental stateful API is essential, or if your C# tests depend on FsCheck’s documented exception-expectation function.
Verdict
Choose FsCheck if you want a free, BSD-licensed library for property-based checks in .NET and need generated inputs with minimized failure examples. Look elsewhere if you depend on the experimental stateful API’s compatibility guarantees or need the documented exception-expectation function from C#.
Questions
How much does FsCheck cost?
The FsCheck plan is free.
Which languages can I use to express properties?
Properties can be expressed in F#, C# or VB.
Which test frameworks does it integrate with?
The project documents integrations with xUnit.net and NUnit. User-created integrations include Expecto, Fuchu, AutoFixture and MSTest.
How do I install FsCheck?
FsCheck and its NUnit and xUnit.NET plugins can be installed from NuGet.
What license does FsCheck use?
Its BSD license permits modification and redistribution for commercial and non-commercial purposes.
What limitations should I know about?
Properties cannot have generic types, though type annotations can resolve types. The documented exception-expectation function is unavailable in the C# API, and stateful model-based testing is experimental without semantic-versioning guarantees.
Facts from FsCheck's own pages
- Audience
- FsCheck is for developers who want to test properties of .NET programs with generated inputs. · fscheck.github.io, 7 Oct 2026
- C# limitation
- The documented function for expecting exceptions is not available in the C# API. · fscheck.github.io, 7 Oct 2026
- Counterexamples
- When a property fails, FsCheck displays a minimal counterexample. · fscheck.github.io, 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, 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, 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, 7 Oct 2026
- Failure reports
- When a property fails, FsCheck displays a minimal counterexample by shrinking the failing input. · fscheck.github.io, 7 Oct 2026
- Generators
- Users can define custom test data generators and shrinkers, and package them together in Arbitrary instances. · fscheck.github.io, 7 Oct 2026
- Installation
- FsCheck and its NUnit and xUnit.NET plugins can be installed from NuGet. · fscheck.github.io, 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, 7 Oct 2026
- Languages
- Properties can be expressed in F#, C# or VB. · fscheck.github.io, 7 Oct 2026
- License
- The project says its BSD license permits modification and redistribution for commercial and non-commercial purposes. · fscheck.github.io, 7 Oct 2026
- Property limitation
- Properties cannot have generic types; the documentation says type annotations can be used to resolve types. · fscheck.github.io, 7 Oct 2026
- Purpose
- FsCheck automatically tests .NET programs by checking properties against randomly generated cases. · fscheck.github.io, 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, 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, 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, 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, 7 Oct 2026
Where FsCheck stands on Freedom251
- Unit Testing Frameworks#2 of 32
- Property-Based Testing Tools#2 of 28