CheckOps
FsCheck
FsCheck is a BSD-3-Clause property-based testing library for .NET, a QuickCheck port written in F# and usable from C#, with xUnit and NUnit integrations.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
FsCheck is a tool for testing .NET programs automatically. Ported from Haskell’s QuickCheck, it lets you specify properties your code should satisfy, then generates many random test cases to check them. When a property fails, FsCheck shrinks the input to a minimal counterexample, which makes bugs easier to understand.
Although written in F#, FsCheck has a C#-friendly API. Generators (Gen) and arbitraries (Arb) produce values for built-in types and can be composed or registered for your own domain types. Integrations such as FsCheck.Xunit and FsCheck.NUnit provide a [Property] attribute so properties run as normal tests with replay support. Model-based (stateful) testing checks sequences of operations against a model. Version 3.6.0 was released on 21 October 2026.
The source code is at fscheck/FsCheck on GitHub under the BSD-3-Clause licence, with about 1,300 stars; the most recent commit was on 21 October 2026.
Features
- QuickCheck for .NET: Generated inputs with shrinking.
- F# and C# APIs: Usable across .NET languages.
- Test framework integration:
[Property]for xUnit and NUnit. - Stateful testing: Model-based checks of operation sequences.
Pros
- Free to use: Open source under the BSD-3-Clause licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 21 October 2026.
Cons
- Learning curve: Generators and properties take practice, especially from C#.
- F#-flavoured documentation: Some examples assume F# familiarity.
Usage and Links (Example)
using FsCheck;
using FsCheck.Xunit;
public class ListProperties
{
[Property]
public bool ReverseTwiceIsIdentity(int[] xs) =>
xs.Reverse().Reverse().SequenceEqual(xs);
[Property]
public Property DiscountNeverIncreasesPrice(PositiveInt price, byte pct) =>
(Pricing.Apply(price.Get, pct % 101) <= price.Get).ToProperty();
}
Resources:
Pricing
FsCheck is free and open source under the BSD-3-Clause licence.
Recommended for?
- .NET teams adding property-based tests to xUnit or NUnit suites.
- F# developers for whom FsCheck is the natural choice.
Conclusion
FsCheck is the established property-based testing library for .NET, bringing QuickCheck-style rigour to both F# and C#.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with FsCheck side by side.
HHypothesisHypothesis is the MPL-2.0 property-based testing library for Python: describe the range of inputs, let it generate cases including edge cases, and get the simplest failing example when a property breaks.Compare with FsCheck
Ffast-checkfast-check is an MIT-licensed property-based testing framework for JavaScript and TypeScript, with rich arbitraries, shrinking, replayable seeds, model-based testing and race-condition detection.Compare with FsCheck
Jjqwikjqwik is an EPL-2.0 property-based testing engine for the JUnit Platform, letting Java and Kotlin developers write properties with generated, shrinking inputs alongside regular JUnit 5 tests.Compare with FsCheck
XxUnit.netxUnit.net is a free, Apache-2.0, community-focused unit testing tool for C#, F# and Visual Basic, part of the .NET Foundation; v3 supports .NET 8+ and .NET Framework 4.7.2+.Compare with FsCheck
NNUnitNUnit is an MIT-licensed unit-testing framework for all .NET languages on Windows, macOS and Linux, broad and non-opinionated, now at version 5 after NUnit 3 and 4.Compare with FsCheck
SStryker.NETStryker.NET is the Apache-2.0 mutation testing tool for C# and .NET from the Stryker Mutator project, run as the dotnet-stryker global tool with HTML reports, a dashboard and incremental runs.Compare with FsCheck