Testing comparisons

Property-based vs. example-based testing

Compare named boundary examples with generated inputs. Use an independent membership rule to find cases that a few carefully chosen lists can still miss.

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.

Property-based vs. example-based testing
Evidence neededNamed examplesGenerated properties
Agreed boundaryName the input and its exact result.Include the boundary in the strategy explicitly.
Unexpected sparse listAdd one when its significance is known.Generate lists with gaps and compare membership.
Readable failureShow the input and asserted answer.Save the reduced counterexample and reference answer.
Proof of coverageList 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.

Primary documentation

Your next release starts here

Keep building.
Put testing to work.

Give Cue April your next testing challenge. Let your AI quality lead coordinate the checks, so your team can focus on what comes next.

Create account

Create your account, connect a repository and review your proposed setup before approving a run.