Skip to main content
Strategy & Process
DEFINITION

What is Specification by Example?

Specification by example (SBE) is a collaborative approach to defining requirements using concrete, realistic examples of system behavior, which are refined into executable acceptance tests that double as always-current, living documentation. It is the practice behind BDD: the examples are agreed by product, development and QA together, then automated with tools such as Cucumber.

No account needed · Scored in under a minute against a senior rubric

IN DEPTH

What does Specification by Example mean in practice?

Abstract requirements ("the system should handle discounts") are easy to misinterpret. Specification by example replaces or augments them with concrete cases ("a 10% discount on a $50 order gives $45; an expired coupon is rejected"). Concrete examples force clarity, expose disagreements, and are far harder to misunderstand than prose. The team collaborates (often via the three amigos) to derive key examples that capture the important behaviors and edge cases.

Those examples are then automated as acceptance tests, so the specification becomes executable: running the tests proves the system still matches the agreed examples. Because the tests are tied to the examples and kept passing, they form living documentation that never drifts out of date the way written specs do, if the behavior changes, the test (and thus the documentation) must change with it.

Specification by example is the conceptual backbone of BDD and ATDD. BDD provides the Given-When-Then language to express the examples; ATDD emphasizes agreeing them before development. SBE is the broader principle: drive shared understanding and verification from concrete, agreed examples rather than ambiguous descriptions.

WHY IT MATTERS

Why do interviewers ask about Specification by Example?

Specification by example connects requirements, collaboration, testing, and documentation, a holistic view interviewers value. Explaining how concrete examples become executable acceptance tests and living documentation shows you understand modern, communication-driven quality practices.

EXAMPLE

What does Specification by Example look like in a real project?

For a shipping-cost feature, the team agrees on examples: orders over $50 ship free; under $50 cost $5; international adds $15. These become automated acceptance tests. Months later, when free shipping changes to $75, the test must be updated, so the executable specification and its documentation stay accurate by construction.

TIP

How should you talk about Specification by Example in an interview?

Define specification by example as defining requirements through concrete, agreed examples that become executable acceptance tests and living documentation. Tie it to BDD (the language) and ATDD (agreeing before dev), and stress the killer benefit: documentation that cannot silently go stale because it is executable.

Go Deeper on Specification by Example

Know the term. These are the courses that turn the concept into something you can demonstrate.

FAQ

Common questions about Specification by Example

How is specification by example related to BDD?

Specification by example is the broader principle of driving shared understanding and verification from concrete, agreed examples. BDD is a way to do it: it provides the Given-When-Then language to express those examples as scenarios. SBE is the philosophy; BDD is a popular implementation of it.

What is "living documentation"?

Living documentation is documentation that stays accurate because it is executable. When acceptance tests are derived from agreed examples and kept passing, they describe how the system actually behaves, and any behavior change forces a test (documentation) update, so it never silently drifts out of date like static written specs.

Related Resources

Dive deeper with these related interview prep pages.

FREE TOOLS  /  no signup

Free QA career tools, no account needed

Instant and private, everything runs in your browser. Try them before you sign up.

EXEC.NOW

Ready to Ace Your QA Interview?

Practice explaining specification by example and other key concepts with our AI interviewer.

Join 500+ QA engineers already practicing with AssertHired.

Question 1 · Automation · Mid-levellive scoring

A test passes locally but fails in CI about one run in five. Walk me through what you check first, and why.

Scored on the same four dimensions as the real thing: Technical accuracy · Coverage · Clarity · Best practices.

Rather skip ahead? Create a free account

FREE.TO.START  ·  7.DAY.TRIAL ON PAID PLANS
Written by , Senior QA Automation Engineer, 50+ QA candidate interviews conductedLast updated July 2026