Counterexample
A counterexample is a concrete instance that demonstrates a stated property, rule, formula, or universal claim does not hold.
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.
Related concepts
- shrinkingaddressed by · Shrinking is a test-case minimization technique that reduces a failing input while preserving the failure.
- scenarioused by · A scenario is a concrete description of a situation or conditions, often including actions and expected or possible outcomes, for analysis or evaluation.
- acceptance criteriaproduces · Acceptance criteria are verifiable conditions that a requirement, feature, or deliverable must satisfy to be considered acceptable or complete.
- Example Mappingused by · Example Mapping is a collaborative technique that organizes user stories, rules, examples, and questions to clarify requirements and expected behavior.
- scenario keywordcontrasts with · Scenario, also called Example, is a Gherkin keyword that introduces an executable example of expected behavior in a feature file.
- property-based testingproduced by · Property-based testing is a software-testing technique that generates varied inputs and checks whether specified general properties of the software’s behavior hold across them.
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.

