A C# random testing library with parallelized generation and shrinking based on the PCG random number generator.
CsCheck is a random testing library for C# that enables property-based testing, inspired by QuickCheck. It uses the PCG random number generator for both generating test data and shrinking failures, which allows for automatic shrinking, parallel execution, and reproducible test cases. It solves the problem of writing comprehensive, randomized tests with minimal boilerplate and maximum shrinking effectiveness.
C# developers and test engineers who need robust property-based testing, performance benchmarking, or advanced testing strategies like model-based or metamorphic testing in their applications.
Developers choose CsCheck for its superior shrinking capabilities, parallelized performance, and comprehensive testing features—all without the boilerplate required by other libraries. It is the only random testing library that can always shrink to the simplest example given enough time.
Random testing library for C#
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses PCG for both generation and shrinking, eliminating the need for separate Arb classes and providing the most aggressive shrinking available, as demonstrated in the shrinking challenge where it found new smaller examples.
Random testing and shrinking are parallelized by default, making it very fast compared to tree-based libraries, with configurable threads and time-based runs for efficiency.
Failed tests provide seed values that allow exact reproduction and continued shrinking, simplifying debugging and regression testing without committed data files.
Supports multiple advanced testing strategies including model-based, metamorphic, parallel, causal profiling, and performance testing in one integrated library, reducing the need for external tools.
The Faster method enables statistical comparison of performance while ensuring correctness, with detailed output like percentage improvements and sigma values for confidence.
The library is close to AOT compatible but admits 'generic recursion is AOT kryptonite,' which can block deployment in environments like iOS or Blazor where reflection is restricted.
The Dbg module for debug utilities is marked for temporary use only, with the README warning that its API may change between minor versions, risking breakage in ongoing projects.
Requires understanding of advanced testing concepts like model-based and metamorphic testing, and generator composition via Linq, which can be overwhelming for teams new to property-based testing.