anthonylloyd/cscheck
Find what a C# project's tests miss, and write tests that find bugs.
Hunts for bugs in C# and .NET code by reading it against what should agree with it (its siblings, docs, callers, history and the code it was ported from), probing the edges of what it must support, and confirming each candidate with a small probe or a CsCheck property, ranked by how likely each is to be real and to be live. Use when asked to find bugs or to check that code is right, e.g. "find the bugs in this parser", "is this calendar code right", "what could go wrong in this class", "check this for edge cases". To measure what the tests miss, use finding-test-gaps; to write the tests, writing-cscheck-tests.
Measures what C# unit tests don't check, with any test framework, CsCheck or not: code coverage for code no test runs, and a sweep of hand-picked mutants, compiled and run without editing the repo, for code the tests run but don't check. Use when asked how good the tests are or what they miss, e.g. "how good are the tests for LruCache", "what's untested in this project", "mutation test this method", "what do the tests on my branch miss", "do these tests actually check anything". It takes a test project, a source file, types or members, or a branch to compare with. To hunt for the bugs themselves, use closing-test-gaps, and to write the tests, writing-cscheck-tests.
Writes CsCheck tests for .NET code that find bugs rather than just pass. Also use it when writing or reviewing unit tests for pure logic, to consider whether a property would find more or could replace them. E.g. "add a CsCheck property for this parser", "write a round trip test for X", "check Equals and GetHashCode agree", "is my new version faster", "model this protocol as a Spec and check the code conforms", "test this class for thread safety", "why does my property pass when the code is broken". Covers Sample, Equality, SampleModelBased, SampleMetamorphic, SampleParallel, Spec, Faster, causal profiling, Single and Check.Hash, and what changed in CsCheck 5. To hunt for the bugs themselves, use closing-test-gaps.