liveBook · Manning

Counterexample

A counterexample is a concrete instance that demonstrates a stated property, rule, formula, or universal claim does not hold.

How 2 Manning books explain it

BDD in Action, Second Edition

A counterexample is a concrete case showing where a proposed rule or expected behavior does not apply or produces an incorrect result.

How it is used
Uses concrete exceptions during requirements conversations to challenge assumptions and define acceptance criteria.
How deep it goes
Explains counterexamples through questioning, tables, rule clarification, and automated acceptance criteria.
Examples
Uses ineligible flights, outdated dates, nonqualifying flight numbers, cancellations, and future bookings as concrete counterexamples.
What you can do after
Apply it via structured conversations and examples to clarify rules and produce precise acceptance tests.

Read how BDD in Action, Second Edition explains counterexample →

Learn Haskell by Example

A counterexample is an input that causes a tested property to fail, demonstrating that the property does not hold universally.

How it is used
Uses failing generated inputs to test properties and guide debugging.
How deep it goes
Defines failure and explains deterministic shrinking down to a minimal falsifying input, including the Arbitrary shrink function.
Examples
Uses a failing rot13 symmetry test, an alphabet-rotation test, and shrink results for characters and associative maps.
What you can do after
Diagnose property or implementation bugs with smaller, repeatable failing inputs.

Read how Learn Haskell by Example explains counterexample →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.