Key takeaway
- TDD vs BDD vs ATDD compared: who writes each test, what it checks, one worked example, tools after SpecFlow, AI coding agents and when to use each.
TDD, BDD and ATDD all write a test or example before the code, but they answer different questions. Test-driven development (TDD) asks "does this unit of code do what the developer intended?". Acceptance test-driven development (ATDD) asks "have we built what the customer agreed to?". Behaviour-driven development (BDD) asks "does the system behave the way the business described it, in words everyone can read?".
They are layers, not rivals. Teams usually get the best results by agreeing acceptance examples first (ATDD or BDD), then building each piece with TDD underneath. This post compares the three side by side for leaders choosing a practice; for the full TDD method, worked example and research, see our test-driven development guide.
What are TDD, BDD and ATDD?
TDD is a developer practice. Martin Fowler describes it as "a technique for building software that guides software development by writing tests", run as a short loop of red (write a failing test), green (write just enough code to pass) and refactor (tidy the design with the tests still passing). Kent Beck developed it in the late 1990s as part of Extreme Programming.
ATDD is a team practice. The Agile Alliance defines it as customer, development and testing viewpoints "collaborating to write acceptance tests in advance of implementing the corresponding functionality". These conversations are often called the "three amigos", and the agreed tests act as both requirement and check.
BDD grew out of both. Dan North introduced BDD (first in Better Software magazine, March 2006) because "people's misunderstandings about TDD almost always came back to the word 'test'". He replaced test language with behaviour language: stories written as "As a [X], I want [Y], so that [Z]" and scenarios written as Given, When, Then. The Agile Alliance calls BDD "a synthesis and refinement of practices stemming from" TDD and ATDD.
What are the key differences between TDD, BDD and ATDD?
The clearest way to separate them is by who takes part, what the test describes and at what level it runs.
| Dimension | TDD | ATDD | BDD |
| Question it answers | Does this code unit work as the developer intended? | Does the feature meet the agreed acceptance criteria? | Does the system behave as the business described it? |
| Who writes it | Developers | Customer or product owner, developer and tester together | Product, development and testing together, in shared language |
| Language | Programming language (unit test framework) | Business terms, often tables of examples | Structured natural language: Given, When, Then |
| Level | Unit and component | Feature or user story, from the user's view | Feature behaviour, from business rule down to code |
| Feedback loop | Seconds to minutes | Per story or sprint | Per scenario, per story |
| Main outcome | Testable design and a regression safety net | Shared definition of "done" | Living documentation the whole team can read |
| Typical tools in 2026 | JUnit, pytest, Jest, Vitest, Go's testing package | Robot Framework, FitNesse, Cucumber | Cucumber and Gherkin, Reqnroll (.NET), JBehave |
The Agile Alliance notes that ATDD "may also be called" BDD or Specification by Example, and that the terms "exist to stress some differences in approach that lead to similar outcomes". In practice, ATDD stresses the agreement on acceptance criteria, while BDD adds a shared notation, outside-in development and a focus on business outcomes.
How does one feature look under TDD, ATDD and BDD?
Take one rule from an order system: a returning customer gets free delivery on orders over a set threshold. Each practice captures it differently.
| Practice | What the team writes first | Example |
| ATDD | An acceptance criterion agreed by product, development and testing, with example values | "A returning customer with an order of 60 pays no delivery. A new customer with the same order pays standard delivery." |
| BDD | The same examples as an executable Gherkin scenario | Given a returning customer, When they place an order worth 60, Then delivery is free |
| TDD | A failing unit test for the class that calculates delivery | A test that calls the delivery calculator with a returning customer and an order of 60 and expects a delivery charge of zero |
In Gherkin, the scenario sits in a feature file. A Rule keyword (part of Gherkin since version 6) groups the examples that illustrate one business rule, and Scenario Outline with Examples runs one scenario for each row of a table. Gherkin is localised for over 70 languages, so business owners can read and write scenarios in their own language.
Feature: Delivery charges
Rule: Returning customers get free delivery over the threshold
Example: Returning customer above the threshold
Given a returning customer
When they place an order worth 60
Then the delivery charge is 0
The developer then drops down a level and uses TDD to build the delivery calculator: one failing unit test, the minimum code, a refactor, and on to the next case. The acceptance scenario passes only when all the units beneath it work together.
Which approach should you choose for which situation?
| Situation | Best fit | Why |
| Libraries, algorithms, APIs and back-end services with clear inputs and outputs | TDD | Fast unit feedback shapes the design and protects refactoring |
| Requirements are often misunderstood between business and engineering | ATDD | Agreeing acceptance tests before coding closes the gap early |
| Rules-heavy domains such as pricing, claims, eligibility or compliance | BDD with TDD underneath | Business owners can read and review the scenarios; developers keep unit-level control |
| Regulated delivery that needs evidence of what was agreed and tested | ATDD or BDD | Executable specifications double as traceable acceptance evidence |
| Teams new to test-first work | TDD first, then BDD | The Agile Alliance notes BDD needs more concepts and is hard to recommend without prior TDD exposure |
| AI coding assistants or agents writing production code | TDD inside ATDD or BDD | Human-approved acceptance examples and failing tests tell the agent what "done" means |
For Go teams, our post on test-driven development in Go shows the TDD layer in a single language, with table-driven tests and fuzzing.
How do TDD, BDD and ATDD fit together in one test architecture?
Think of the three as nested loops. The outer loop is the conversation: product, development and testing agree examples for a story (ATDD), and write the ones worth automating as scenarios (BDD). The inner loop is TDD: developers build each unit test first until the scenario passes. Unit tests stay fast and many; acceptance scenarios stay few and focused on business behaviour.
The scenarios also need a maintainable structure behind them, or step definitions turn into brittle scripts. Our guide to domain-driven testing explains how to organise test automation in layers around the business domain so that BDD and ATDD suites stay readable as the system grows. Teams that run delivery through agile ceremonies can also look at AgentScrum, which automates sprint planning and Scrum ceremonies with agentic AI, so acceptance criteria are captured as stories are planned.
What has changed for TDD, BDD and ATDD in 2026?
Tooling has moved. SpecFlow, long the main BDD framework for .NET, reached end of life on 31 December 2024, as announced by Tricentis; its GitHub projects were deleted on 1 January and it receives no updates for newer .NET versions, according to the Reqnroll team. Reqnroll, an open-source reboot of the SpecFlow codebase, is the usual migration path. On the ATDD side, Robot Framework (version 7.4.2 on its site) describes itself as "an open source automation framework for test automation and robotic process automation (RPA)" and publishes an ATDD demo.
AI coding agents have made test-first more valuable, not less. In June 2025 Kent Beck told his coding agent to "Always follow the TDD cycle: Red → Green → Refactor" and watched for warning signs including "disabling or deleting tests". Microsoft's VS Code TDD guide sets up separate Red, Green and Refactor custom agents whose handoffs fill in the next prompt but do not submit it, so a person reviews each step. The pattern is the same as BDD and ATDD at a smaller scale: people agree what correct looks like, and the agent works until the tests say so.
Our own engineering teams have adopted an agentic TDD standard operating procedure on Elixir platform work, steering effort away from chasing coverage numbers and towards failing tests that define each change before an agent writes code. Platforms such as ElixirClaw, an agentic OS platform to build, orchestrate and govern AI agents and automation workflows while keeping humans in control, depend on exactly this kind of agreed, executable definition of done. Where the system under test is itself an AI agent, AgentQA adds automated quality assurance for AI.
What governance, security and cost questions should leaders ask?
| Area | Question to ask | What good looks like |
| Ownership | Who approves acceptance criteria and scenarios? | A named product owner signs off examples before build starts |
| Traceability | Can we show which requirement each test covers? | Scenarios link to stories; results are kept with each release |
| Test integrity | Can a person or agent weaken a test to make it pass? | Reviews and CI checks flag deleted assertions, skipped tests and changed expected values |
| Security | Do abuse cases appear as scenarios, not only happy paths? | Negative and misuse examples sit alongside the main scenarios |
| Tool risk | Is any framework end of life or single-vendor? | Retired tools such as SpecFlow have a migration plan |
| Cost | Where is test effort going? | Most checks are fast unit tests; a smaller set of acceptance scenarios covers business rules |
How should an enterprise adopt TDD, BDD and ATDD?
- Start with one product team and one business rule. Choose a rule that causes rework or disputes today.
- Run three amigos sessions. Agree concrete examples for each story before development starts; this is ATDD with no tooling yet.
- Build the TDD habit underneath. Developers write failing unit tests first for the code that implements those examples.
- Automate the examples worth keeping. Turn stable, high-value examples into Gherkin scenarios or Robot Framework tests, structured by domain.
- Add CI gates and integrity checks. Run unit tests on every change and acceptance scenarios on every merge; block weakened tests.
- Bring AI agents in last. Let agents implement against human-approved scenarios and failing tests, with review at each handoff.
- Measure and spread. Track escaped defects, rework and lead time on the pilot team before rolling out.
When is each approach the wrong choice?
TDD adds little to throwaway prototypes or spikes, and on its own it cannot tell you whether you built the right feature. Industrial studies summarised in our TDD guide report lower defect density in exchange for more initial development time, so it pays most on code that will live and change.
BDD goes wrong when it becomes a tooling exercise. If developers write Gherkin alone and business owners never read it, the team carries the cost of a scenario layer without the shared understanding. The Agile Alliance warns that tying BDD to specific tools misses its purpose.
ATDD struggles when no one with business authority can attend. Kent Beck dismissed ATDD as impractical in 2003, and the Agile Alliance notes that tools can hinder the real goal of "facilitating conversation between developers and product owners". Driving every acceptance test through the user interface also tends to produce slow, fragile suites.
What has changed since this comparison was first written?
- The old version tied TDD to big data engineering only; all three practices apply to any software, and the post now compares them for enterprise delivery.
- It described BDD tests as written "in plain descriptive English"; BDD scenarios use structured Given, When, Then steps in Gherkin, localised for over 70 languages.
- It did not cover tools; SpecFlow is now end of life and Reqnroll is its successor for .NET.
- It did not cover AI coding agents, which now make human-approved tests the main way to define "done".
- Repeated benefit lists, decorative images and outdated service links were removed.
To map one delivery decision your agents should make, and the acceptance criteria and policy it depends on, book a Context Workshop. See what happens in the workshop.
Frequently asked questions about TDD vs BDD vs ATDD
What is the main difference between TDD and BDD?
TDD is a developer practice that writes unit tests in code before the implementation. BDD describes system behaviour in structured natural language (Given, When, Then) that business owners, testers and developers can all read, and usually runs on top of TDD.
Is ATDD the same as BDD?
They are closely related. The Agile Alliance says ATDD may also be called BDD or Specification by Example, with the terms stressing differences in approach that lead to similar outcomes. ATDD centres on agreeing acceptance tests before building; BDD adds a shared notation and outside-in development.
Can a team use TDD, BDD and ATDD together?
Yes, and they work best together. Acceptance examples agreed through ATDD or written as BDD scenarios form the outer loop, and developers use TDD in the inner loop to build the units that make those scenarios pass.
What replaced SpecFlow for BDD in .NET?
SpecFlow reached end of life on 31 December 2024. Reqnroll, an open-source reboot of the SpecFlow codebase, is the usual replacement and is highly compatible, though migration takes some effort.
How do TDD and BDD help with AI coding agents?
Failing tests and approved scenarios give an agent a precise definition of done. Kent Beck instructs his agent to follow red, green, refactor and watches for disabled or deleted tests, and VS Code's TDD guide uses separate Red, Green and Refactor agents with human review at each handoff.
Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE