Would a handful of examples find the boundary errors in this rule?
Prefer named examples for published business rules and known boundaries. Add property-based testing when many valid inputs share a rule you can check independently. Generated tests are most useful when the generator covers the relevant shapes and the assertion can distinguish correct behaviour from plausible errors.
Build an independent membership rule
Given a list of observed IDs, a membership query should return true exactly for the IDs in that list. Test an empty list and a list with one ID as named examples. Then generate short lists and query both present and absent IDs against a simple reference set. In the worked pandas example, change the observed IDs and inspect four probes from two released versions.
| Evidence needed | Named examples | Generated properties |
|---|---|---|
| Agreed boundary | Name the input and its exact result. | Include the boundary in the strategy explicitly. |
| Unexpected sparse list | Add one when its significance is known. | Generate lists with gaps and compare membership. |
| Readable failure | Show the input and asserted answer. | Save the reduced counterexample and reference answer. |
| Proof of coverage | List the cases the team selected. | Describe the input domain, settings and gaps. |
Keep a failure after its discovery
A generator limited to consecutive positive numbers may never exercise a gap between observed IDs. Include sparse lists deliberately. If a run finds a disagreement, save the minimal case and both results as a named regression. A later random run can pass on different inputs even though the original error remains reproducible.