Property-Based Testing
also called Generative Testing, QuickCheck-Style Testing
Asserting invariants that must hold for all inputs, then having the framework generate many inputs to try to break them.
Example-based tests check the cases the author thought of, which is precisely the set of cases that were already handled correctly. Property-based testing inverts this: you state a rule that should always hold, and the framework hunts for a counterexample.
Useful properties are usually structural rather than domain-specific. Round-tripping: anything serialised then deserialised equals the original. Invariants: a ledger's balance always equals the sum of its entries, whatever sequence of operations is applied. Equivalence: an optimised implementation agrees with the naive one on every input. Idempotence: applying twice equals applying once — directly relevant to retry-heavy distributed systems.
The feature that makes it practical is shrinking. When a failure is found, the framework reduces the input to the minimal case that still fails, so instead of a 400-element structure you receive a two-element one, which is usually enough to see the bug immediately.
It is not a replacement for example-based tests, and it is poorly suited to code whose behaviour is a list of business rules rather than a rule. Where it repays effort dramatically: parsers, serialisers, state machines, concurrency primitives, financial arithmetic and anything with boundary conditions.