Testing

What is Behavior-Driven Development (BDD)?

Behavior-Driven Development extends TDD by writing tests in plain language that describes user behavior, enabling collaboration between developers, testers, and business stakeholders.

By the Hyrax team·4 min read·May 1, 2026
TL;DR
  1. 1.The Origin of BDD
  2. 2.Given-When-Then
  3. 3.BDD Tools
  4. 4.The Three Amigos
  5. 5.Living Documentation

Behavior-Driven Development (BDD) is a software development methodology that extends Test-Driven Development by using plain language to describe software behavior from the perspective of users and business outcomes. BDD closes the gap between technical and non-technical stakeholders by expressing requirements as executable specifications that both humans and machines can understand.

The Origin of BDD

BDD was introduced by Dan North in 2003 as a response to the confusion teams experienced with TDD. Developers often asked "what should I test?" and focused on code coverage metrics rather than business value. BDD reframes the question: "what behavior should this software exhibit?" Tests become specifications of behavior, not checks on implementation.

Given-When-Then

The core syntax of BDD is the Given-When-Then pattern, which structures scenarios as:

  • Given — the initial context or state
  • When — the action or event that occurs
  • Then — the expected outcome

Example: Given a user is logged in / When they click "checkout" with items in their cart / Then they should be redirected to the payment page.

BDD Tools

FrameworkLanguageFeature
CucumberMulti-languageGherkin syntax; most widely used
SpecFlowC#.NET ecosystem BDD with Gherkin
BehavePythonPython BDD with Gherkin scenarios
RSpecRubyNative BDD DSL; subject/it/expect syntax
Jest + jest-cucumberJavaScriptGherkin integration for Jest

The Three Amigos

BDD introduces a collaboration practice called the Three Amigos: a developer, a tester, and a business analyst (or product manager) who meet before development begins to discuss a story and agree on concrete examples of the expected behavior. These examples become the acceptance criteria and, ultimately, the automated tests.

Living Documentation

BDD test suites serve as living documentation — specifications that are always current because they are executed and validated with every build. A Cucumber test suite describes what the application does in language that any stakeholder can read, making it a durable artifact that does not go out of date the way wiki documentation does.

BDD and Autonomous Code Governance

BDD scenarios describe expected user behavior in precise, unambiguous terms. Hydra uses these scenarios as behavioral contracts when evaluating automated changes. A dependency update that passes BDD scenarios provides high confidence that user-facing behavior is preserved. Scenarios that fail after an automated change pinpoint exactly which behavior regressed, making diagnosis fast and targeted.

Frequently Asked Questions

Is BDD the same as acceptance testing?

BDD tests are a form of acceptance tests — they describe behavior at the level of user outcomes. However, not all acceptance tests use BDD syntax, and BDD tests also serve as unit and integration tests at lower levels.

Do non-technical stakeholders actually write BDD tests?

Rarely in practice. The value of BDD is that stakeholders can read and validate scenarios, not necessarily that they write them. Developers write the Gherkin; stakeholders review and approve it. The collaboration in the Three Amigos meeting is where shared understanding is actually built.

When should you use BDD vs TDD?

Use TDD for unit-level design and low-level correctness. Use BDD for acceptance criteria and system-level behavior. They complement each other: BDD tests define the outer acceptance loop while TDD tests drive the inner implementation loop.

What is Gherkin?

Gherkin is the plain-language domain-specific language used to write BDD scenarios. It uses Given-When-Then syntax and is the format used by Cucumber, SpecFlow, and Behave.

Frequently Asked Questions

What is the Given-When-Then pattern?

A structure for BDD scenarios: Given (context), When (action), Then (outcome) — making test scenarios readable by non-technical stakeholders.

What are the Three Amigos?

A BDD collaboration practice where a developer, tester, and business analyst agree on concrete behavioral examples before development begins.

Is BDD the same as acceptance testing?

BDD tests are a form of acceptance testing, but not all acceptance tests use BDD syntax. BDD adds the plain-language collaboration layer.

What is Gherkin?

The plain-language DSL used for BDD scenarios with Given-When-Then syntax, supported by Cucumber, SpecFlow, and Behave.

Stop flagging. Start fixing.

Hyrax reviews your pull requests, remediates issues autonomously, and closes the ticket.

Join the waitlist