# Behavior-Driven Development

A collaborative development practice that uses concrete behavioral examples to align product, engineering, and testing before and during implementation.

- Type: practice
- Domain: Engineering & architecture
- Level: Intermediate
- Last reviewed: 2026-09-22
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/behavior-driven-development/>)

## What it means

Behavior-driven development \(BDD\) is a way for people with business, development, and testing perspectives to discover and describe desired system behavior together. Teams discuss concrete examples, resolve ambiguous rules, and may automate selected examples as readable specifications. Given-When-Then is a common structure for expressing context, an event, and an observable outcome, but the conversation is more important than the notation or tool.

## Why it matters

Many software defects begin as differences in understanding rather than coding errors. BDD creates an early feedback loop around language, rules, and edge cases. Shared examples can connect product intent to executable checks, help teams distinguish behavior from interface details, and preserve useful knowledge about why a capability exists.

## When to use it

Use BDD for features with important business rules, multiple stakeholders, or terms that different groups interpret differently. It works well when examples can clarify acceptance boundaries before implementation. A simple internal change with obvious behavior may need only a brief discussion and focused tests rather than a formal feature file.

## How it works

1. Bring together people who understand business goals, implementation constraints, and testing risks.
2. State the capability and its value using language shared by the domain experts and delivery team.
3. Explore representative, boundary, and exception examples until rules and unresolved questions become visible.
4. Record essential examples as concise scenarios, often using Given-When-Then.
5. Automate scenarios that provide durable value at the most appropriate system boundary.
6. Review scenarios as behavior changes, removing duplication and obsolete specifications.

## A practical example

For subscription cancellation, a product manager, developer, and tester discuss customers in trials, paid periods, and overdue states. They discover that immediate cancellation applies only to trials; paid access lasts through the billing period. A few scenarios document these rules and drive API-level checks while interface details remain in separate tests.

## Where it breaks

BDD can deteriorate into verbose test scripting performed after decisions are already made. Large suites of slow end-to-end scenarios are costly and fragile, while overly technical wording excludes domain participants. Not every example should be automated, and readable syntax does not guarantee that stakeholders actually collaborated or that the product solves the right problem.

## Common mistakes

- Treating BDD as a test-automation framework rather than a collaborative discovery practice.
- Writing scenarios around clicks and fields instead of meaningful outcomes.
- Automating every discussed example at the user-interface layer.
- Keeping obsolete feature files that no longer describe current behavior.

## Visualization

[View the visualization on the website](<https://wiki.soroush.uk/topic/behavior-driven-development/#visualization-behavior-driven-development>)

## Sources

1. [Behavior-Driven Development](<https://cucumber.io/docs/bdd/>) — Cucumber · Official methodology documentation
2. [Introducing BDD](<https://dannorth.net/introducing-bdd/>) — Dan North & Associates · Foundational author article

## Related topics

- [Test-Driven Development](<https://wiki.soroush.uk/topic/test-driven-development/>)
- [Continuous Integration](<https://wiki.soroush.uk/topic/continuous-integration/>)
- [CI/CD Pipeline](<https://wiki.soroush.uk/topic/cicd-pipeline/>)
