liveBook · Manning

Counterexample

As explained in 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.

A counterexample is a concrete case that tests a business rule by showing where an expected behavior does not apply. Teams use counterexamples during collaborative requirements conversations to expose hidden assumptions, clarify acceptance criteria, and build shared understanding. section 6.0 section 1.1

Use counterexamples to challenge an apparently obvious rule:

  • Ask “What if...?”, “Is this always the case?”, or “Are there examples where this rule does not apply?” section 6.4.2
  • Record the case beside ordinary examples so the boundary of the rule becomes explicit. section 6.3
  • Turn the clarified examples into business-readable acceptance criteria and, where appropriate, automated acceptance tests. section 1.1

Previous-flight eligibility

A rule says that flights within 90 days of sign-up qualify for credit. A flight 100 days ago is a counterexample because it is too old. Further counterexamples reveal that a partner flight, a cancelled flight, and a future confirmed flight are also ineligible, even when other conditions appear to fit. section 6.3

Flight Number

Flight Date

Status

Eligible

Reason

FH-99

60 days ago

COMPLETED

Yes

 

FH-87

100 days ago

COMPLETED

No

Too old

OH-101

60 days ago

COMPLETED

No

Not a Flying High flight

FH-99

60 days ago

CANCELLED

No

Must be completed

FH-99

In 5 days time

CONFIRMED

No

Must have taken place

Compare eligible and ineligible flights by number, date, status, and reason to see how counterexamples refine a rule. section 6.3

How BDD in Action, Second Edition covers it

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 it assumes
Assumes a proposed business rule or expected behavior, while teaching teams to question apparently obvious exceptions.
What you can do after
Apply it via structured conversations and examples to clarify rules and produce precise acceptance tests.
How it connects
Connects counterexamples to business rules, acceptance criteria, Example Mapping, executable specifications, and automated acceptance tests.

Also explained in

Compare how 2 books explain counterexample →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of BDD in Action, Second Edition. The section links point to the parts of the book it draws on.