## Definition
**Specification by Example** is Gojko Adzic's collaborative method for illustrating requirements with concrete, realistic examples instead of abstract prose. As Adzic puts it in [[Specification by Example - Gojko Adzic]], "examples are concrete and unambiguous" — they pin down meaning that words leave open.
## The problem it solves
Abstract requirements create what Adzic calls "an illusion of shared understanding": everyone nods at "the system shall handle invalid input gracefully," and everyone pictures something different. The disagreement surfaces only after the code ships. Concrete examples force the ambiguity to the surface *before* anyone writes code, because a specific input with a specific expected output cannot be quietly reinterpreted.
## Examples become tests
The same example that specifies behaviour can validate it. "For a basket of 99 EUR, free shipping applies; for 98.99 EUR, it does not" is simultaneously a requirement, a conversation, and an acceptance test. This is the bridge to the [[Executable Acceptance Criterion]] and, when written in Given/When/Then, to the [[Gherkin Scenario]].
```
Given a basket total of 99.00 EUR
When the customer checks out
Then shipping is free
```
## Key examples, not exhaustive ones
A common failure is trying to enumerate every case. Adzic's discipline is to find the *key* examples — the ones that capture a rule and its boundaries — not to fuzz the entire input space. Three examples that bracket a threshold teach more than two hundred that repeat the same path. Exhaustiveness is the job of property testing, not of specification.
## Living documentation
Because the examples are executable and run continuously, they stay true. They become [[Living Documentation]]: a description of the system that cannot drift from the system, because a drift breaks the build.
## The pre-AI foundation of SDD
Specification by Example predates LLMs by a decade, yet it is the intellectual foundation of [[Spec-Driven Development]]. The agentic twist is mechanical, not conceptual: the examples that humans wrote to align with each other now also serve as the prompt and the verifier for an agent. The method was right; the audience grew.
## Related
- [[Specification by Example - Gojko Adzic]]
- [[Executable Acceptance Criterion]]
- [[Gherkin Scenario]]
- [[Three Amigos]]
- [[Living Documentation]]
- [[Spec-Driven Development]]