The mechanics of test-driven development

November 14, 2022
Red-Green-Refactor may describe the mechanics of TDD, but not its essence.

“TDD is just red-green-refactor,” I heard someone say.

Is it?

Red: write a failing test.
Green: Make the test pass.
Refactor: Remove redundant code, or other structural problems.

That’s not inaccurate. But saying that’s all there is to Test-Driven Development is a bit like saying that all there is to baking a cake is mixing ingredients, and putting them into the oven. Or that all there is to riding a bicycle is pedaling and steering.

Learning the mechanics of a thing is important. But it’s rarely sufficient. It’s the content that matters.

Share this

Related Content

What's the relationship between TDD and Evolutionary Design?

TDD doesn't give you ED for free, it only makes it easier.

Have unit tests ever saved you?

Three times unit tests saved me, in as many days.

How to convince someone to write "impossible" tests

"Next time you find an untestable component, bring it to me, and we'll write the test together."