Behaviour-driven development in practice
Write each example as a short scene in plain words. Everyone can read it, and a tool can run it.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a play written in plain words. Before the actors learn their lines, the writer lists the scenes in plain words. "Scene one: a guest arrives. Scene two: the guest asks for tea." The director, the actors and the audience can all read it.
Daily List is a to-do list app. Sam, Nina and Tom sit down to talk about sharing a list. They do not write code or long documents. They write scenes. "Lily has a list called Weekend. She shares it with a friend. The friend sees it under shared lists."
These scenes are written in a small plain-language format called Gherkin. A text file called a holds them. Leo then writes code, a , that runs each line.
This way of working is behaviour-driven development. The scenes show how the product should behave, and everyone can read them.
The picture has a limit. A play is performed once. A scene file runs again and again, so it must stay exact.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 1 in this section
- gherkin
- a plain way of writing examples; also a pickled cucumber
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Writing examples as short scenes in plain words that everyone can read and a tool can run.
- Set the scene
- Say the action
- Show the result
- Run the line
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| A play in plain words | A feature file of scenes |
| A scene | A scenario |
| A line the actor speaks | A step definition that runs the line |
| The scene is set, the action, the result | Given, When, Then |
WHERE THIS PICTURE STOPS
- A play is performed once. A scene file runs again and again.
- Actors improvise. A step runs the same way each time.
- Audiences watch a play. Tools run a scenario and report pass or fail.
HOOK
Set, act, result.
REMEMBER IT THIS WAY
A sequence: the real steps, in order.
Say each scene as : the scene, the action, the result. Lily shares Weekend, and the friend sees it under shared lists.
| In the trick | What it stands for |
|---|---|
| Given | The scene is set |
| When | The action |
| Then | The result |
TELL A FRIEND
A play written in plain words. Given sets the scene, When is the action and Then is the result.
OFTEN MIXED UP WITH Acceptance tests from examples. The acceptance tests lesson shows how examples become checks. This lesson writes them as plain scenes a tool can run.
PRACTISE AND KEEP
Sources for this topic — 10 sources
- Market practice
Gherkin reference (Cucumber documentation) ↗ — Cucumber · Current reference, Background and Scenario Outline: Feature/Rule scope, after Before hooks, non-header Examples rows. Opened6 November 2026.
Publisher page opened on 5 November 2026. Earlier search-only notes are superseded for the claims stated here. Wording is paraphrased; source-figure reuse is not assumed.
- Market practice
Example Mapping (Cucumber documentation) ↗ — Cucumber (SmartBear) · Example mapping sorts a story into rules, examples and questions in a short conversation (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Behavior Driven Development: Dan North interview (Today Software Magazine) ↗ — Today Software Magazine · Dan North describes BDD as growing out of teaching test-driven development without the word test, and phrases requirements as Given, When, Then (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
ISTQB Certified Tester Foundation Level Syllabus v4.0.1 ↗ — International Software Testing Qualifications Board · Sections 4.5.2 and 4.5.3: the Given, When, Then format for acceptance criteria, and acceptance test-driven development (confirmed against the syllabus, read in full text from a mirror copy of the publisher PDF, v4.0.1, 15 September 2024)
v4.0.1 is dated 15 September 2024 and is a list of corrections to v4.0 (21 April 2023) that reworded six learning objectives — not a cosmetic reissue. 78 pages.
Two traps this entry exists to stop. v4.0.2 is the German edition (1 March 2025, 94 pages), so sorting by version number reaches the wrong document. And the widely-repeated per-chapter question allocation "8 / 5 / 4 / 11 / 9 / 3" is wrong: it is 8 / 6 / 4 / 11 / 9 / 2, derived from three official sample-exam answer keys and confirmed against the Exam Structure Tables.
The single most consequential detail for a question bank: white-box coverage — statement and branch — is K2 "Explain", not K3 "Apply" (FL-4.3.1, FL-4.3.2, FL-4.3.3), and MC/DC, path and condition coverage are declared out of scope in §4.3. A question asking a candidate to compute branch coverage is testing something this syllabus does not.
Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.
Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.
Read from two independent PDF-to-markdown conversions mirrored on raw.githubusercontent.com. They are treated as faithful because they were produced by unrelated parties with different tooling, agree on the full 64-item objective set including wording, and reproduce the same internal inconsistency present in the source PDF. Chapter 1 reads "testware that supports" where Appendix B reads "that support". A conversion artefact does not replicate across two toolchains.
The licence permits attributed non-commercial extracts and use as the basis for articles. Whether a site that sells a pass may rely on that is an owner's decision, not this entry's.
7 November 2026 review: actual publisher PDF 4.0.1, 15 September 2024, 78 pages, front matter/copyright and relevant numbered operative sections 0.5–0.10 and chapters 1–6 compared with CTFLpractice lessons. Earlier mirror/search descriptions are historical access records. TheK2 white-box objectives require explanation; the source does not justify a categorical ban on small numeric illustrations that support explanation. Later Exam Rules 1.2§4.1.4 usesK2 for keyword definitions, while syllabus§0.5 usesK1; keep dated scopes distinct. No copied questions or figure assets.
- Market practice
Keep your scenarios BRIEF (Seb Rose, Cucumber blog, 2019) ↗ — Cucumber · Seb Rose, 'Keep your scenarios BRIEF' (Cucumber blog, 2019): most scenarios five lines or fewer; BRIEF expansion. Better Gherkin page: declarative over UI steps. Search excerpts, pages not opened. 'Often holds two rules' is the lesson's own advice. The ten-step cap seen in a GitHub guide is a community rule and is not used.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Writing better Gherkin (Cucumber documentation) ↗ — Cucumber · Seb Rose, 'Keep your scenarios BRIEF' (Cucumber blog, 2019): most scenarios five lines or fewer; BRIEF expansion. Better Gherkin page: declarative over UI steps. Search excerpts, pages not opened. 'Often holds two rules' is the lesson's own advice. The ten-step cap seen in a GitHub guide is a community rule and is not used.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Who does what (Cucumber) ↗ — Cucumber · r8a-cucumber-who-does-what (whole team writes Gherkin at first; developer and tester pair later; product owner reviews). Search excerpt, page not opened.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
ISTQB Certified Tester Foundation Level Syllabus v4.0 (section 4.5) ↗ — ISTQB (copy hosted by GASQ) · Numbering read in a search excerpt of the v4.0 syllabus PDF; v4.0.1 is an errata release and the 4.0.1 PDF was not opened. Also fix the locator text in the topic source list, content/quizzes/quiz-testing-bdd-in-practice.json and three entries in content/glossary/terms-software-testing.json.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
ISTQB Certified Tester Foundation Level practice question - three Cs ↗ — CertifHub (practice site) · Three Cs wording from a certification practice question page; the syllabus section 4.5.1 on collaborative user stories was not opened. Check before relying on it.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Scenario-Oriented vs. Rules-Oriented Acceptance Criteria ↗ — Antony Marcano · Round 10 source: the v4.0 syllabus section 4.5 names scenario-oriented and rule-oriented criteria. The ten-task rule is an invented Daily List example. Search excerpts, pages not opened.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.