# Behaviour Driven Development

> The Behaviour Driven Development approach in Engineering focuses on collaboration of developers, testers and stakeholders to define software behavior.

## What is behavior-driven development (BDD)?

The development methodology that encourages collaboration between different roles in a project to define and document system behavior through clear, understandable scenarios, often using natural language.

- Topic: Types of Development
- Type: approach

## Example

Wrong:

```gherkin
Scenario: Login
  Given I open "/login"
  When I type "a@b.co" into "#email"
  And I click "#submit"
  Then I see ".dashboard"
```

Right:

```gherkin
Scenario: Registered user signs in
  Given a registered user
  When they sign in with valid credentials
  Then they see their dashboard
```

The scenario states behavior in domain language, so stakeholders can read it and UI changes do not break it.

## Common mistakes

- Scenarios are full of clicks and selectors, so a redesign breaks all of them.

## Key points

- Scenarios use Given, When, Then and describe behavior in domain words.
- Scenarios do not mention CSS selectors, URLs or other UI details.
- Each scenario checks one behavior.

## Interview questions

### What is Gherkin?

The plain-text format for BDD scenarios, built on the keywords Feature, Scenario, Given, When and Then.

### Is BDD only for testers?

No. Its main value is that developers, testers and product people agree on behavior before code is written.

## Related cards

- [Test Driven Development](https://wonderium.dev/engineering/test-driven-development.md)
- [E2E](https://wonderium.dev/engineering/e2e.md)
- [Integration Test](https://wonderium.dev/engineering/integration-test.md)
- [Agile](https://wonderium.dev/processes/agile.md)
- [Spec-Driven Development](https://wonderium.dev/ai/spec-driven-development.md)

---

- Level: [Engineering](https://wonderium.dev/engineering.md)
- HTML version: https://wonderium.dev/engineering/behaviour-driven-development
- Last updated: 2026-11-25
