What is SDD?
Specification-Driven Development (SDD) is a development methodology that clearly defines "what to build" before writing code.
In simple terms, it's a planning document written before development, and you can think of it as a document that only includes requirements.
Core Philosophy
Traditional Way | SDD Way |
|---|
Code is the source of truth | Specification is the source of truth |
Specifications are reference documents | Specifications generate code |
Code first, documentation later | Specification first, implementation later |
Why SDD?
Clear Goal Setting: Define "what" and "why" before buildingReduced Modification Costs: Modifying specifications is much cheaper than modifying code after it's writtenMaximizing AI Tool Usage: Able to give clear instructions to AI like Claude CodeImproved Communication: Share the same understanding with team members/clients
It's for repeatedly presenting my requirements.
With generative AI, you encounter countless different versions in the ongoing conversation window.
This means the AI responding can keep changing.
Each time, it's impossible to make the AI understand the current task.
This concept is much more important than items 1-4 above.
The example below is not written by me, but is a version written in a simple template format.
# [Feature Name]
## Overview
> Explain in one line what you're building
## User Story
**Who**: [User Type]
**Wants**: [Feature]
**Why**: [Purpose/Value]
## Behavior Specification
- **Input**: [User Actions]
- **Processing**: [System Actions]
- **Output**: [Results Visible to User]
## Constraints
- [Constraint 1]
- [Constraint 2]
## Completion Criteria
- [ ] [Testable Condition 1]
- [ ] [Testable Condition 2]
- [ ] [Testable Condition 3]
Below is an example of applying the template above.
# Book Search Feature
## Overview
> Users search for books by keyword and confirm the results list
## User Story
**Who**: Library User
**Wants**: Search books by title or author name
**Why**: To quickly find the desired book
## Behavior Specification
- **Input**: Enter 2 or more characters in the search box and press Enter or click the search button
- **Processing**:
- Check if the keyword is included in the title and author name
- Case-insensitive search
- Query up to 50 results
- **Output**:
- Results found: Book list (title, author, publication year)
- No results: "No search results found" message
## Constraints
- 1-character search not allowed (minimum 2 characters)
- Special character search not allowed
- If search results exceed 50 items, display "Too many search results. Please enter a more specific keyword"
## Completion Criteria
- [ ] When searching for "Python", display books with "Python" in the title
- [ ] When searching for "Hong Gildong", display books by author "Hong Gildong"
- [ ] When 1 character is entered, display guidance "Please enter 2 or more characters"
- [ ] Display guidance message when no results
- [ ] Display same results for "Python" and "python" regardless of case
Using with AI Tools
When you provide the specification to AI, it generates much more accurate code.
Please implement according to the specification below.
[Paste specification content]
Key Summary
- Specification = Contract: A document where you agree on what to build
- Completion criteria is the core: Must be testable to be a real specification
- Start small: Begin with simple features for practice
- Keep the document: Check the specification first when making modifications later
References
With AI development, countless methods emerge like design patterns, but optimizing the method that suits you
becomes much easier to understand and simpler when you incorporate your own development philosophy.
Even TDD becomes tiring if applied aggressively, so take only the essence and apply it. In fact, now it's not about what code to write, but rather
how to effectively assign work to AI.
There's not much content, but I hope it was helpful.