Specification by Example
TTool · Specification by Example
“Gojko Adzic's approach, where concrete examples become automated tests.”
The requirement looked clear. Development built what they understood. Testing found it wasn't what the stakeholder meant. Everyone's pointing at the same sentence and reading it differently.
Specification by Example is Gojko Adzic's approach where concrete examples serve triple duty as requirements, documentation, and automated tests. You write Given-When-Then scenarios collaboratively — business and technical people together — forcing the precision that natural language lets everyone avoid.
The unique strength is closing the gap between what stakeholders want, what developers build, and what testers verify. The examples become living documentation that stays accurate because it's executable — it can't go stale the way a specification document does.
Reach for it when ambiguity in requirements is causing rework. It falls apart without automation capability to keep the examples running, and it's wrong for exploratory work where the team is still discovering what the feature should do.
Your next move: Could your team write three concrete examples of the next feature working correctly before they start building it — and if not, is the requirement actually clear, or just clear enough to misinterpret in different ways?
What it looked like for them
Mark Barwald, mass-customised jeans, 2005. In August 2005 Mark Barwald and a university friend launched a website where customers could design their own jeans. It offered 12 million variations, from the cut and the denim to the rivets, the thread and any length.
Too late, they found that 90% of orders were for ordinary jeans from unusually tall women. Barwald later wrote that they had never tested whether people wanted custom-made jeans at all. Specification by example starts from concrete cases, and the founders had specified every pair they could make and no pair a customer was likely to order.
“We've been told to do more with less and I have to decide what stops.”