CheckOps home

Tools directory

F

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.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

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

  1. QuickCheck for .NET: Generated inputs with shrinking.
  2. F# and C# APIs: Usable across .NET languages.
  3. Test framework integration: [Property] for xUnit and NUnit.
  4. Stateful testing: Model-based checks of operation sequences.

Pros

  1. Free to use: Open source under the BSD-3-Clause licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 21 October 2026.

Cons

  1. Learning curve: Generators and properties take practice, especially from C#.
  2. F#-flavoured documentation: Some examples assume F# familiarity.
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.

  1. .NET teams adding property-based tests to xUnit or NUnit suites.
  2. 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.