Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M2184

Test-Driven Development - TDD

Test-Driven Development - TDD
TechnicalHigh supportSoftware Engineering
Included
account_tree

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

psychology

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

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/4

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more

Source support: Explicit

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E6%B5%8B%E8%AF%95%E9%A9%B1%E5%8A%A8%E5%BC%80%E5%8F%91ZH · Explicit
    verified

RELATED MODELS