Test-Driven Development - TDD
Version 1.0.0 · Updated 2026-07-30
CORE DEFINITION
A development process: write a test case first (which will fail), then write just enough code to pass the test, and finally refactor. That is the "red-green-refactor" cycle.
SCAFFOLDING EFFECT
Reduce cognitive load
Start with the end in mind. It forces us to define "what is success" (test cases) before we start. Not only for writing code, but also for writing plans: "write acceptance criteria first, then plan content" to ensure goal focus.
Anchor fast decisions
TDD: Write a failing unit test for a feature (red), then write the minimal implementation to make it pass (green), then refactor to remove duplication and bad smells; tests lock behavior and drive design.
MINIMUM ACTION
In progress 0/4Practice this model in one real situation:
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more
Source support: Explicit
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E6%B5%8B%E8%AF%95%E9%A9%B1%E5%8A%A8%E5%BC%80%E5%8F%91verified
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS