◄ WORLD V · SONNY 5DART 222 · a helldive at the net

THE QUICKCHECK don't check examples, check the law — then hunt its counterexample

Instead of asserting f(2)==4 on a handful of hand-picked cases, state a property that must hold for all inputs — reverse(reverse(xs))==xs, sort is idempotent — and let the machine throw inputs at it until one breaks it. QuickCheck is Popper in a test harness: a property is a bold universal claim, and a single counterexample refutes it. You do not confirm the law; you try to kill it, and report the first input that does.

THE TECHNIQUE property ∀x: P(x) ; scan for the first x where P fails

State a property over a domain and let the checker search for a refuter. Here the claim n² < 100 is asserted for all n — the checker returns the first n that breaks it, the counterexample: live demo


HISTORY & CREDIT Claessen & Hughes, 2000

“More example tests = more confidence.” — a thousand passing examples cannot prove a law; one counterexample ends it. QuickCheck flips the goal from confirming examples to refuting a universal — the only asymmetry that actually buys knowledge (Popper). Passing is never proof; it is only not-yet-refuted. cited

2000 · Koen Claessen & John Hughes — “QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs”: properties as first-class values, inputs generated to falsify them.
lineage · Karl Popper — falsifiability: a scientific claim must forbid something; testing is the attempt to observe the forbidden.
now · Hypothesis (Python), fast-check (JS), proptest (Rust) — property-based testing everywhere.

The verdict is never “true.” It is FALSIFIED (here is the input that broke you) or survived (nothing broke it — yet). A property that no input could ever break tests nothing. Claessen–Hughes 2000

RECOMMEND FOR I-13 first counterexample found, computed

On the canonical compiler, the property n² < 100 asserted over 1..30 is refuted — the search returns the first breaking input:

$ i13 run quickcheck.i13 # property: for all n in 1..30, n*n < 100 counterexample = 10 -- 10*10 = 100, not < 100: the claim is FALSIFIED at n=10
Recommend: QuickCheck is LIT for I-13 — verified that the universal claim n²<100 over 1..30 is falsified at n=10, the first counterexample. A property is a scan for the disconfirming instance; the machine reports the black swan or admits it found none. It is agreement-by-algebra's opposite pole: disagreement-by-search, the door that faces outward.