~/codigoagente
AI agents

SDD vs TDD vs BDD vs DDD: the differences and when to use each one with AI coding agents

SDD (*Spec-Driven Development*), TDD (*Test-Driven Development*), BDD (*Behavior-Driven Development*) and DDD (*Domain-Driven Design*) are often compared as if they were four options to choose from. They are not: each one answers a different question and works at a different level of a project. DDD decides which words you use to model the business, BDD describes how the system behaves for the user, SDD sets what gets written before the agent writes code, and TDD proves that each piece of code works.

This article explains what each one is, where it comes from, a table of differences, what the same feature looks like under each approach, and how to apply them in Claude Code, Codex or Cursor. At the end we add ODD (*Organic Driven Development*), the SDD alternative people are searching for most, because it completes the map.

Each acronym answers a different question, from the most abstract (top) to the most concrete (bottom) · codigoagente

Quick summary: what each one is

AcronymNameOriginQuestion it answersWhat it produces
**DDD**Domain-Driven DesignEric Evans, 2003 bookWhat do we model, and with which words?Ubiquitous language, bounded contexts, entities and aggregates
**BDD**Behavior-Driven DevelopmentDan North, 2006How should it behave for the user?*Given / When / Then* scenarios (Gherkin)
**SDD**Spec-Driven DevelopmentPopularized in 2025 by GitHub Spec Kit, Kiro and OpenSpecWhat gets written before the agent codes?A specification, a technical plan and a task list
**ODD**Organic Driven DevelopmentGentle-AI, its only workflow since v4.0.0 (October 2026)How much planning does this task need?Nothing, an inline task or a single feature document
**TDD**Test-Driven DevelopmentKent Beck, 2002 bookDoes this piece of code work?Automated tests written before the code

The key to keeping them apart: DDD is design, BDD and TDD are ways to verify (one from the outside, one from the inside), and SDD and ODD are processes that decide how much gets documented before the agent touches code.

What TDD (Test-Driven Development) is

TDD is the practice of writing a failing test first and only then the minimum code that makes it pass. Kent Beck formalized it in *Test-Driven Development: By Example* (2002), as part of Extreme Programming. The cycle has three steps:

  1. Red: write a test for behavior that does not exist yet. It fails.
  2. Green: write the minimum code to make it pass.
  3. Refactor: clean up the code without breaking the test.

With AI agents, TDD matters more: it is the cheapest way to check that the agent did what you asked and not just something that *looks* right. A test that is red before the change and green after it is evidence; an agent saying "done, it's implemented" is not.

What BDD (Behavior-Driven Development) is

BDD grew out of TDD. Dan North introduced it in 2006 ("Introducing BDD") because teams kept getting stuck on questions like "what do I test?" or "what do I call this test?". His answer: describe behaviors in business language, with a fixed template:

book-slot.featuretext
Scenario: a taken slot cannot be booked
  Given the Tuesday 10:00 slot is already booked
  When a customer tries to book Tuesday at 10:00
  Then they see the message "That time is no longer available"
  And no booking is created

Tools such as Cucumber execute that format (Gherkin), but the tool is not the point: the client, the developer and the agent all read the same acceptance criterion. If you have ever written "acceptance criteria" in a ticket, you have done lightweight BDD.

What DDD (Domain-Driven Design) is

DDD is a software design approach, not a testing practice or a process. Eric Evans described it in *Domain-Driven Design: Tackling Complexity in the Heart of Software* (2003). It has two halves:

  • Strategic DDD: a ubiquitous language (the same words in the business, the code and the database) and bounded contexts (in "Bookings", *customer* means one thing; in "Billing", another).
  • Tactical DDD: code building blocks such as entities, value objects, aggregates, repositories and domain events.

With an agent, the strategic half pays off most: if the agent does not know your vocabulary, it invents names (Booking, Appointment, Reservation) for the same thing in three different files. A glossary in the repository prevents that. We show it with an example in the grill-with-docs and domain-modeling article.

DDD vs SDD? They do not compete

"DDD vs SDD" shows up a lot in Google, but it mixes two different things. DDD decides how the business model is organized; SDD decides which documents get written before implementing. You can (and usually should) do both: the SDD specification uses the DDD ubiquitous language, and the SDD technical plan says which context or module each change lives in.

A note on acronyms: in this context DDD almost always means *Domain-Driven Design*. Other uses exist (*Documentation-Driven* or *Data-Driven Development*), but they are much less common.

What SDD (Spec-Driven Development) is

SDD puts a written specification at the center of working with an agent: before asking for code, you write what is being built, why, and the acceptance criteria. A technical plan, a task list and finally the implementation are derived from the spec. The best-known tools are GitHub Spec Kit (MIT), AWS Kiro and OpenSpec (MIT). We cover it in depth, with a sample spec.md, in what is Spec-Driven Development.

The interesting part for this comparison is that SDD already contains BDD and TDD. We checked it in Spec Kit's templates (main branch, version 1.4.2 in development, November 2026):

  • templates/spec-template.md writes acceptance scenarios in BDD format: **Given** [initial state], **When** [action], **Then** [expected outcome].
  • templates/constitution-template.md suggests "Test-First (NON-NEGOTIABLE)" as an example principle, with TDD's red-green-refactor cycle.

Kiro does something similar with a different notation: it writes requirements in EARS ("WHEN [event] THE SYSTEM SHALL [behavior]"), which plays the same role as BDD scenarios.

So "SDD vs TDD" is a false choice: SDD is the process that decides which tests need to exist, and TDD is how you write them and make them pass.

And ODD: how much SDD each task needs

The problem with applying SDD to everything is the overhead: a three-line bug turns into several Markdown files nobody reviews. ODD (*Organic Driven Development*), the workflow of Gentle-AI (MIT), lets the agent decide on every request how much structure is needed: nothing for a question, an inline task with test first for a small change, and a single document with *Specs*, *Tasks* and *Log* for large work.

ODD does not replace TDD or DDD: it applies test first by default when a useful test exists, and it respects the project's vocabulary. What it replaces is the part of SDD that forces you to document everything. We cover it in depth, with sources and measurements, in ODD vs SDD: what Organic Driven Development is.

Table of differences

DDDBDDSDDODDTDD
TypeDesignVerification (outside)ProcessProcessVerification (inside)
Who reads itBusiness and teamBusiness, QA and teamTeam and agentAgent and youTeam and agent
When it happensAt the start and when the model changesWhen defining each featureBefore each featureOn every requestDuring each task
Typical artifactGlossary, context map`.feature` file or acceptance criteria`spec.md`, `plan.md`, `tasks.md``odd/tasks/<feature>.md` only if largeTest files
Cost when overusedTen folders for a contact formScenarios for trivial thingsPaperwork for small bugsToo little planning where it was neededBrittle tests nobody maintains
Fit with an agentGlossary in the repoCriteria in the ticketSpec Kit, Kiro, OpenSpecGentle-AI or a `CLAUDE.md` blockA TDD skill or a standing instruction

The same feature under each approach

To make it concrete, take a small feature from a hair salon booking app: "a customer cannot book a slot that is already taken".

With DDD, you first fix the words. A glossary entry in the repository:

GLOSSARY.mdtext
**Slot**: a 30-minute interval of one stylist on one day. It is either free or booked.
**Booking**: a Slot assigned to a Customer. Never "appointment" or "reservation" in the code.

With BDD, you describe the visible behavior: the Gherkin scenario from the previous section.

With SDD (Spec Kit), the agent generates a spec.md with user stories and that same scenario as an acceptance criterion, then a plan.md (which table and which endpoint change) and a tasks.md. For a rule like this, that is several files.

With ODD, the agent classifies the task as small (it is understood, the risk is bounded and it could be resumed from git diff), so it creates no documents and goes straight to the test.

With TDD, the test that fails before the change:

bookings.test.tstypescript
import { describe, it, expect } from "vitest";
import { book } from "./bookings";

describe("book", () => {
  it("rejects a slot that is already booked", async () => {
    await book({ slotId: "tue-1000", customerId: "c1" });
    await expect(book({ slotId: "tue-1000", customerId: "c2" }))
      .rejects.toThrow("That time is no longer available");
  });
});

Notice that all five approaches live together in the same feature: the glossary provides the names (slot, book), BDD provides the exact message, SDD or ODD decide how much paperwork gets written, and TDD proves it.

How to apply them in Claude Code

You do not need to install five tools. This is the combination we recommend for a solo developer or a small team:

  1. Light DDD, once: a GLOSSARY.md with 10-20 business terms and a line in CLAUDE.md saying "use only the glossary terms". The grill-with-docs skill builds it with you by asking questions.
  2. Light SDD when the project starts: a PRD, an architecture and the tickets. The to-spec and to-tickets skills turn a conversation into exactly that. Use Spec Kit only when the specification is itself a deliverable (a client, a large team, a regulated industry).
  3. BDD in every ticket: acceptance criteria in *Given / When / Then* format, with the literal messages.
  4. ODD day to day: let the agent decide how much planning is needed. The CLAUDE.md block from our ODD vs SDD article is enough.
  5. TDD when implementing: failing test first. Matt Pocock's tdd skill or the Superpowers plugin enforce it.

A minimal CLAUDE.md block that combines all five ideas:

CLAUDE.mdtext
## How to work
- Vocabulary: use only the terms in GLOSSARY.md. If one is missing, ask before inventing it.
- Every ticket has Given / When / Then criteria. Copy the literal messages into the tests.
- Small task: do it inline. Large task (several sessions): create docs/tasks/<feature>.md with Specs, Tasks and Log before the first change.
- Test first: write the test, check that it fails, implement, check that it passes.
- Never mark anything done without a test or check that actually ran.

Common mistakes

  • Picking "one" methodology. Asking whether to use SDD or TDD is like asking whether to use a blueprint or a tape measure. You use both.
  • Tactical DDD on a CRUD app. Aggregates, repositories and domain events for a contact form add folders with no benefit. Start with the glossary.
  • BDD scenarios without literal messages. "Then they see an error" cannot be tested; "Then they see the message 'That time is no longer available'" can.
  • Full SDD for every bug. If the agent writes three Markdown files to change one condition, you pay the cost of SDD without its benefit. That is where ODD fits.
  • Tests written afterwards by the agent. A test the agent writes after implementing usually checks what it did, not what you asked for. Order matters: red first.

Frequently asked questions

What is the difference between SDD and TDD?

SDD is a process: you write a specification, a plan and tasks before coding. TDD is a coding practice: you write a failing test before each change. Spec Kit, the most used SDD tool, includes TDD as an example principle in its constitution template.

Are DDD and SDD the same thing?

No. DDD (*Domain-Driven Design*) is about designing the business model and its vocabulary; SDD (*Spec-Driven Development*) is the process of specifying before implementing. They complement each other: the specification should use the domain language.

What is the difference between BDD and TDD?

BDD describes the behavior visible to the user in business language (*Given / When / Then*); TDD tests units of code from the inside. BDD started as a way of doing TDD focused on behavior.

Is it SDD or SSD?

It is SDD, for *Spec-Driven Development*. SSD (*Solid State Drive*) is a kind of disk and is unrelated; it is a very common typo when searching for "odd vs sdd".

Which is better for coding with AI: SDD or ODD?

It depends on the size. For new projects, client contracts or large teams, SDD. For daily work on an existing project, ODD, which only writes a plan when the task needs one. We compare them in detail in ODD vs SDD.

Conclusion

SDD, TDD, BDD and DDD are not rivals: DDD provides the words, BDD the criteria, SDD (or ODD, if you want the plan to grow with the task) decides how much gets written before coding, and TDD proves it works. With an AI agent, the most practical mix is a glossary, *Given / When / Then* criteria in every ticket, planning only for large work, and test first every time.

The complete workflow, step by step

If you want to set all of this up in a real project without improvising, the guide Claude Code de cero a producción (in Spanish) walks through it end to end: planning with light SDD and ODD (chapter 4), working by tickets with acceptance criteria, choosing an architecture with tactical DDD when it pays off (chapter 7), reviewing code with AI before pushing (chapter 10) and deploying to Vercel or your own VPS. It includes 68 prompts, templates and ready-to-copy skills, with a complete example project. It costs 19.99 USD, one-time payment: get the guide here.

Sources: Kent Beck, *Test-Driven Development: By Example* (2002) · Dan North, "Introducing BDD" (2006) · Eric Evans, *Domain-Driven Design* (2003) · GitHub Spec Kit (templates/spec-template.md and templates/constitution-template.md) · Kiro: specs concepts · Gentle-AI.

// source code

Repositories in this article
The code this article covers is public: browse it, star it or clone it from here.

Help us grow

codigoagente is free, with no paywalls. If this article helped you, any of these keeps the blog going.

// newsletter

One email a week with the repos worth your time

The week's new articles, tested against real code. No spam; unsubscribe in one click.

AI agents

guide · The complete ECC guide for Claude Code · #8

AgentShield, ECC's scanner, checks CLAUDE.md, settings.json, MCP, hooks and agents. We ran it on a deliberately vulnerable setup and on ECC's own install.
  • Security and code review
  • Claude Code
read article
AI agents

guide · The complete ECC guide for Claude Code · #7

We measured ECC's context footprint with /ecc:context-budget --audit (about 12,500 tokens on the minimal profile) and how to trim it: model, compaction and MCP.
  • Claude Code
  • Skills for your agents
read article
AI agents

guide · The complete ECC guide for Claude Code · #6

What ECC's 28 hooks do, how GateGuard stops the first edit, how to save and resume sessions and how continuous learning instincts work, with a real test.
  • Claude Code
  • Skills for your agents
read article