Behavior-driven development (BDD) is an agile software development methodology where the team agrees on what the system should do by writing concrete examples in plain language. Everyone from the business side to the test team ends up working from the same executable specification.
The product owner, a developer and a tester write the examples together before any coding starts, usually as Given-When-Then scenarios in Gherkin. Tools such as Cucumber, Reqnroll, Behave and Behat then run those scenarios as automated tests.
Cucumber’s documentation is explicit that there’s a lot more to BDD than using Cucumber. If the scenarios get written after the code already exists, that’s test automation, not BDD. The order is discovery, then formulation, then automation.
What Is Behavior-Driven Development (BDD)?

BDD doesn’t replace the agile methodology a team already runs. Cucumber’s documentation presents it as an addition that closes the gap between business people and technical people.
Shared understanding through examples is the core principle. Liz Keogh, an early BDD pioneer, argued at a Cucumber conference that the conversation matters more than the tooling (InfoQ, 2014).
Cucumber’s documentation calls the living documentation and automated tests nice side effects of that conversation, not the goal.
It also helps to rule a few things out. BDD isn’t a synonym for Cucumber, JBehave or any other tool, and QA alone doesn’t own it. Test cases that merely borrow Given-When-Then wording aren’t BDD either.
Dan North and the origin of BDD
North started BDD to fix a recurring problem with test-driven development. Programmers did not know where to begin, what to test, what to call their tests, or why a test failed.
- North started JBehave in 2003, a JUnit replacement built on “behaviour” vocabulary instead of “test” (Cucumber documentation).
- The RSpec project, BDD for Ruby, was founded in 2005 by Dave Astels, Steven Baker, Aslak Hellesoy and David Chelimsky (Cucumber documentation).
- In 2006 North published “Introducing BDD”, the first public description of the practice.
- By November 2009 he was defining BDD as a “second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology” (Behave documentation, citing his talk at the Agile specifications, BDD and Testing eXchange in London).
The Given-When-Then template borrowed from two older ideas. The shared vocabulary comes from Eric Evans’s ubiquitous language in domain-driven design, and the shape comes from Rachel Davies’s “As a, I want, so that” story template at Connextra.
North himself called BDD a rephrasing of existing good practice, not a radically new departure.
How BDD Works: Discovery, Formulation and Automation
Each story moves through discovery, formulation and automation, and the cycle repeats for the next story. The team first talks through concrete examples. Then it writes the agreed ones as Gherkin, and finally connects each example to the system as a test that fails before the code exists.
Discovery: agree on examples first
Discovery happens in a workshop where the team talks through real examples from the user’s perspective.
Cucumber’s documentation tells newcomers to start here, because the other two practices pay off little until discovery works.
A session like this tends to expose misunderstandings between business and delivery before anything is built, and it often shows that some behavior can wait, which shrinks the story. Open questions nobody in the room can answer yet come out too.
Formulation: from examples to feature files
Formulation takes the examples agreed in discovery and turns them into a feature file in Gherkin. That file reads as a business specification and still runs as a test.
A developer and a tester can write the scenarios as a pair, as long as the product owner reviews the result (Cucumber documentation).
Automation: the failing test comes first
Pick one example and connect it to the system as a test. It fails, which is the point.
Then write the code that makes it pass and move on to the next example. In Cucumber’s description, that failing test is what guides the implementation.
Does doing every practice actually matter?
In a Cucumber survey of 189 respondents, run around SmartBear’s 2019 acquisition of Cucumber Ltd, 59% of teams doing all BDD practices released to production at least several times a week. Across the full sample the figure was 24%.
The post itself calls the survey a quick sample, not in-depth research, and it shows correlation only. Teams that follow every practice may simply be the teams with strong delivery habits anyway. Worth remembering before that 59% ends up in a pitch deck.
How Do Three Amigos Sessions and Example Mapping Work?

Take one user story and put a product owner, a developer and a tester in a room with it. That’s a three amigos session. Example mapping gives the conversation a structure, built on colored index cards.
The business seat usually belongs to the product owner, who speaks for the rules the software must follow.
Who brings what
The business voice covers the rules and priorities and explains why the story exists. The developer talks about effort and technical limits, and offers alternatives where there are any. The tester asks what could go wrong and where the edge cases hide.
Three is a minimum, not a cap. Cucumber’s documentation sees no reason to hold only one such session at the start of a project.
Example mapping cards
| Card | Colour | What it holds |
|---|---|---|
| Story | Yellow | The user story under discussion |
| Rule | Blue | A constraint that summarizes a group of examples |
| Example | Green | A concrete case that illustrates one rule |
| Question | Red | An unknown nobody in the room can answer yet |
The blue rules amount to the story’s acceptance criteria. Each green example illustrates exactly one of them.
Only rules and examples reach the feature file. The red questions are transient, according to Seb Rose on the Cucumber blog.
Matt Wynne described the technique in a December 2015 Cucumber post. It arrived after BDD, Cucumber and Gherkin already existed.
How long a session runs
Wynne puts a well-sized story at about 25 minutes for a small group (Cucumber blog, 2015). Seb Rose’s ACCU 2022 talk sets the ceiling at under 30 minutes.
A story that will not fit is a finding, not a failure. A rule with many examples may hide several rules, and a pile of red cards means the story is not ready.
At Cucumber, the team takes a thumb vote after 25 minutes to decide whether a story can move into development.
How Are BDD Scenarios Written in Gherkin?

Scenarios go into Gherkin files, a plain-text syntax whose keywords give structure to executable specifications, according to the Cucumber reference. Given sets the context, When names the event, and Then states the outcome.
Feature: Free shipping
Rule: Orders of 50 EUR or more ship free
Example: Cart above the threshold
Given a cart worth 62 EUR
When the customer checks out
Then no shipping fee is addedThat Example block is four lines long and illustrates a single rule. Every step maps to a step definition, which is the automation code connecting the sentence to the system.
Gherkin keywords at a glance
- Feature opens every Gherkin file and groups related scenarios.
- Rule holds one business rule and the examples that illustrate it. It has been part of Gherkin since version 6.
- An Example (or Scenario) is one concrete case, written as steps.
- Background covers steps shared by every scenario in the feature or rule, with one set per feature or rule.
- Scenario Outline runs one scenario against a table of values under Examples.
- And and But continue a Given, When or Then without repeating it.
Gherkin is localised for more than 70 spoken languages, so the keywords can be written in a team’s own.
Declarative and imperative scenarios
An imperative scenario spells out every click: visit the login page, type an email into a field, press Submit. A declarative one just says Free Frieda logs in with her valid credentials.
Cucumber’s guide to better Gherkin (November 2026 revision) offers one test for every line: “Will this wording need to change if the implementation does?” If the answer is yes, the line gets rewritten.
A login that moves from a password form to a thumbprint won’t touch the declarative version. The imperative one breaks, and the scenario goes down with it.
Keeping scenarios short
Most scenarios should run five lines or fewer, per Seb Rose on the Cucumber blog (September 2019).
That advice sits inside his BRIEF acronym, a set of six principles for writing scenarios. Using words from the business domain and illustrating a single rule per scenario cover most of the daily work, along with simply staying short.
How Does BDD Differ From TDD, ATDD and Specification by Example?
Sources disagree on whether ATDD and Specification by Example are really separate from BDD, since all of them work from agreed examples. TDD is the cleaner contrast. It checks that code is correct, while BDD specifies in plain language what the system should do.
| Practice | Main focus | Written in | Who takes part |
|---|---|---|---|
| TDD | Code correctness and design | Unit tests in the programming language | Developers |
| BDD | Observable behavior from the user’s view | Gherkin or similar plain language | Business, developers, testers |
| ATDD | Acceptance criteria for the story | Natural-language acceptance tests | Business, developers, testers |
| Specification by Example | Requirements as realistic examples | Examples kept as living documentation | Business, developers, testers |
BDD and TDD
BDD stacks on top of TDD instead of replacing it. A failing scenario defines the behavior, and unit-level work fills in the code that makes it pass.
Teams that already practice test-driven development keep their red-green-refactor cycle for classes and functions.
The scenario sits above it, written for people who will never read the unit tests. TDD is written for the developer, while BDD scenarios are written for anyone who cares about the behavior.
BDD and ATDD: where the sources disagree
DeviQA treats them as separate practices, with BDD verifying behavior and ATDD validating against user needs. Software Testing Help goes the other way and notes that the two are often used interchangeably, since both can use Given-When-Then.
One DZone explainer makes both claims in the same section. It says ATDD focuses on acceptance criteria rather than behavior, and also calls ATDD another name for BDD.
Whatever the label, both share the habit that matters, which is agreeing on examples before code is written.
BDD and Specification by Example
Gojko Adzic’s Specification by Example is a collaborative method for specifying requirements and tests from realistic examples.
His book distills seven patterns from interviews with successful teams, from deriving scope from goals to evolving a documentation system (Manning). uSwitch and Songkick appear among its case studies, along with Sabre Airline Solutions.
Several of those patterns line up with BDD’s practices. Illustrating using examples matches discovery. Refining the specification is formulation by another name, and automating validation without changing specifications covers what BDD calls automation.
Which Tools and Frameworks Support BDD?
Cucumber is the reference toolset, with official implementations for Java, Ruby, JavaScript and a handful of other languages, and most other BDD frameworks read Gherkin as well. Cucumber’s own advice is to pick the implementation that matches the language of the production code.
Frameworks by language
| Framework | Language | Status on Cucumber’s list | Notes |
|---|---|---|---|
| Cucumber-JVM, JS, Ruby | Java, Kotlin, JavaScript, Ruby | Official | Hosted under the Cucumber organization |
| Reqnroll | .NET (C#, F#, VB) | Semi-official | Reboot of SpecFlow |
| Behave | Python | Semi-official | Own command-line runner |
| pytest-bdd | Python | Semi-official | Runs inside pytest |
| Behat | PHP | Semi-official | PHP implementation of Cucumber |
| JBehave | Java | Not listed | Story files, 2022 snapshot build on its site |
The status labels come from the November 2026 revision of Cucumber’s installation page, where “semi-official” means hosted elsewhere but built on Cucumber components. RSpec sits outside the table because Ruby teams use it for specification-level BDD without Gherkin.
When a vendor drops a BDD tool
Tricentis announced the end of life for SpecFlow in December 2024, effective December 31, 2024 (Reqnroll news, January 2025). Around the same time, SmartBear moved stewardship of Cucumber to the Open Source Collective, a US non-profit, and said no commercial extension depended on it (SmartBear blog).
Automation Panda’s March 2025 post reads the two moves together and argues that test tool vendors failed to commercialize BDD tools and gave up on them.
Feature files are plain text, so the scenarios survive a tool change. Step definitions are what need porting, and Reqnroll, forked from SpecFlow in early 2024, calls migration straightforward but not effortless.
One loss has no substitute. SpecFlow+ LivingDoc was closed source, so Reqnroll could not take it over.
Reqnroll is community-driven, with no enterprise owner. Spec Solutions, Gaspar Nagy’s company, sponsors his work on the project, and the project publishes its finances through Open Source Collective.
Behave or pytest-bdd
Behave runs as its own command, and its docs include a tutorial on Python step implementations along with a fixtures page and a page-objects page. pytest-bdd lives inside pytest instead, implements a subset of Gherkin, and reuses pytest fixtures written for unit tests as step setup.
A team with an existing pytest suite should start with pytest-bdd, because its fixtures carry over. Version 9.0.0 (September 30, 2026) dropped Python 3.9 and supports 3.10 through 3.14, per its changelog.
What Does BDD Give a Team?
The benefits all come from running scenarios against the system, not from writing them. Specifications can’t drift quietly, because a scenario that no longer matches the system fails the run. Every automated example stays in the suite, so the regression baseline grows with each story. And since scenarios sit beside work items, requirements stay visible while people work.
The scenarios read as software documentation that is checked on every run, which is what makes it living. Cucumber for Jira, launched in October 2019, publishes that documentation from a Git repository into the Jira project.
Because examples are automated one at a time, the suite grows with the product. A failing old scenario flags a change in regression testing terms before release, not after.
The evidence is thinner than the vendor pages suggest. A 2023 systematic mapping study of BDD research found an acute shortage of metrics for measuring BDD, so most benefit claims rest on practitioner reports.
When Does BDD Not Pay Off?
BDD stops paying off the moment the conversation gets skipped. It also struggles when every scenario drives the UI, and when specifications grow faster than the team can maintain them.
Failure modes
- Having one person write everything is the classic mistake. Cucumber’s documentation calls for the product owner, developer and tester to discover examples together, and the Cucumber team lists scenarios written alone, in isolation, as an anti-pattern (Cucumber blog, 2016).
- Running everything through the UI is the next trap. Cucumber co-creators described UI-driven scenarios as problematic, since restoring them when business logic has not changed is wasted effort (InfoQ, 2016).
- Scenario outlines get overused. A template makes it easy to add many scenarios at once, which slows the suite.
- Step definitions tied to a single feature can’t be reused across features, which leads to an explosion of step definitions and high maintenance cost (Cucumber documentation).
Behave’s own documentation shows the tension. A page-object example built on Selenium sits in the same docs as a section of its practical-tips page headed “Seriously, Don’t Test the User Interface.”
Wrong-fit cases
A few situations make BDD a poor fit.
- A team that only wants regression automation. Automating scenarios after the code is written can be reasonable test automation, but it is not BDD, and the Cucumber team lists writing feature files after the code as an anti-pattern (Cucumber blog, 2016).
- No access to the business, which turns scenarios into test scripts in plain English.
- Low-level logic that unit tests cover faster.
A team that cannot hold the discovery conversation should skip Gherkin and keep a plain test framework. It costs less and promises less.
The maintenance burden
Binamungu, Embury and Konstantinou surveyed 75 practitioners from 26 countries and singled out duplication in specifications as a specific maintenance challenge (SANER, IEEE, 2018).
Maintenance is the recurring cost. As examples multiply, specifications get harder to keep consistent and slower to execute. That maintainability concern hasn’t aged out, since the 2023 mapping study still lists specification maintenance among BDD’s open challenges.
How to Start With BDD on a Team
Here’s the order I’d follow.
- Pick a pilot story with real uncertainty. Liz Keogh has suggested concentrating BDD on scenarios where the business is least sure of the outcome (InfoQ, 2014).
- Run discovery with the three amigos, and map the rules and examples before anyone writes a scenario.
- Turn each agreed example into a short Gherkin scenario in business language, written declaratively.
- Automate one example at a time. Connect it as a failing test, then implement, and prefer the API or service level over the UI.
- Choose the framework last, matching it to the production language.
- Run the suite on every build, and treat a failing scenario as a failing build.
Running the scenarios in a continuous integration pipeline keeps the living documentation honest.
pytest-bdd can write Cucumber JSON reports, a format that Jenkins reporting plugins can read (pytest-bdd documentation, version 9.0.0).
The order matters, and Keogh ranks it outright. Having the conversation beats capturing it, and capturing it beats automating it.
Common Questions About BDD
Does BDD require Cucumber?
No. BDD is a practice of discovery, formulation and automation, and Cucumber is one tool for the last step.
Behave, pytest-bdd, Reqnroll and Behat run the same Gherkin scenarios. A team can also run example mapping with index cards before any tool is installed.
What is the difference between a scenario and a scenario outline?
A scenario covers one concrete example written as steps, while an outline is a template that reruns the same steps once per row of an Examples table.
Use an outline when the rows show one rule with different values. Rows that express different rules belong in separate scenarios.
Where does BDD fit in Scrum?
BDD slots into the flow where a story gets clarified, before a sprint pulls it in.
On a Scrum team, the product owner, developer and tester map one story at a time, so planning starts from agreed examples instead of open questions.
Can BDD scenarios drive a browser with Selenium?

Yes. A step definition can call Selenium to drive the browser, while the scenario keeps business wording such as “the customer checks out.”
Behave’s documentation includes a page-object example built on Selenium, which keeps browser details out of the feature files.
How to Tell Whether BDD Is Working
The first sign is stories leaving discovery with agreed rules, examples and answered questions. The second is a scenario suite that stays quick enough to run on every build.
Check discovery output per story first, then scenario quality and duplication, then suite speed and upkeep. Discovery problems show up in the first sprint, whereas duplication and slow runs only build up as scenarios accumulate.
Scaling up costs more shared sessions per story and a larger specification set that needs a named owner. Scaling back means giving up the living documentation, though the automated regression checks stay.
This position was verified in November 2026. It changes if Cucumber or Reqnroll lose their community maintainers, which is why step definitions should stay thin and feature files plain text.
- Who Answers Your Users After Launch? - November 18, 2026
- How to Create a Folder in GitHub From the Browser - November 17, 2026
- 6 Best Cookie Consent Apps for Shopify in 2027: Features and Setup Compared - November 17, 2026



