Skip to content
IT glossary
TestingUpdated December 3, 2026

BDD

It’s a way of developing software in which the team uses concrete examples to agree on what the system should do. Those examples guide implementation and help the team verify the result.

Also known as: Behavior-Driven Development

What is BDD?

Behavior-Driven Development (BDD) turns requirements into concrete examples that developers, testers, and product or business representatives can discuss together. Take the rule “Customers get free shipping on orders of $50 or more.” Does the amount include tax? Is it calculated before or after discounts? A few well-chosen examples make those questions easier to spot and answer before anyone writes the feature.

From conversation to checks

Start with a rule, then choose examples that reveal how it works: a typical case, a boundary case, and any important exception. Write down the agreed outcomes as scenarios. One common format is Given–When–Then: Given describes the relevant starting state, When names the action or event, and Then states the outcome someone can verify.

Gherkin is a language for writing scenarios in that format. A tool such as Cucumber can run them if the team supplies step definitions: code that sets up the initial state, exercises the system, and checks the result. Neither Gherkin nor Cucumber is required for BDD. A scenario can guide a manual check, and a scenario file written after implementation is not a substitute for the conversation about what the feature should do.

Example: free shipping after discounts

Feature: Standard shipping charges
  Scenario: A discount takes the order below the free-shipping threshold
    Given an order has a subtotal of $55 before tax
    And a $10 discount has been applied
    When the system calculates the standard shipping charge
    Then the standard shipping charge is $5

The scenario captures a business decision: a subtotal that starts above the threshold can drop below it once a discount is applied. A companion example with an after-discount subtotal of exactly $50 would pin down whether the boundary is inclusive.

Where it helps and what to avoid

BDD is useful for rules involving prices, eligibility, or changes in order status, where different people may read the same requirement differently. Describe the outcome, not incidental details such as button selectors or private method names. That way, changing the UI or refactoring the code does not force you to rewrite a scenario for a rule that still works the same way.

A BDD scenario does not have to run through a browser. The shipping rule might be cheapest to verify with a test of the pricing component. Use an API or end-to-end check when behavior across a boundary or along the full customer journey is what matters.

In interviews

You may be asked to turn a vague requirement into a scenario or explain how BDD relates to Test-Driven Development (TDD). BDD helps a team decide which behavior to build using shared examples. TDD guides implementation through a cycle of writing a failing test, making it pass, and refactoring. A team can use both on the same feature.