CsCheck is a free C# random testing library inspired by QuickCheck, intended for self-hosted use. Its composable Gen classes generate cases and support automatic shrinking without Arb classes; a shrunk case includes a seed that can reproduce a failure. The library supports random, model-based, metamorphic, performance, specification, regression, parallel, and equality testing. Parallel tests compare outcomes against possible linearizations and support shrinking. Specification checks can enumerate a reachable state space or sample it, and can test whether declared faults are caught. Its Faster function statistically compares methods and can run as a regular test across platforms. The README examples use TUnit, though the project says the library can work with any testing framework. The project page reports more than 1,000 F# tests using CsCheck in MKL.NET. NuGet lists version 4.9.1 and provides .NET CLI and PackageReference installation instructions. The project notes that generic recursion limits AOT compatibility, and that the Dbg module is temporary and may change between minor versions.
Who it is for
CsCheck suits C# and F# developers who want generated, shrinkable tests and reproducible failures. It can be used with TUnit or other testing frameworks.
What is good
- Automatic shrinking is supported without Arb classes.
- Shrunk cases include seeds for reproducing failures.
- Supports stateful, parallel, and specification testing.
- Faster statistically compares method performance.
- The project states that no reflection was used.
What to know first
- Generic recursion limits AOT compatibility.
- The Dbg API may change between minor versions.
- It is intended for self-hosted use.
Verdict
CsCheck offers a broad set of generated and stateful testing approaches, with shrinking and reproducibility built in. Developers considering AOT use should account for the stated generic-recursion limitation.
CsCheck plans and pricing
All plansCompared on property-based testing tools
- Free plan
- Yes
- Supported languages
- C#, F#
- Test runner support
- TUnit; any testing framework
- Failing-case shrinking
- Yes
- Stateful testing
- Yes
- Reproducible failures
- Yes
