Incremental Progress

People new to TDD are often bothered by an early version of code like this. We’re testing nothing (you might think), just some hard-coded return values; the tests are tiny, and we’re bouncing between activities. Let me explain a little more.

Do TSTTCPW: Fake It and Then Make It

Back when I was first learning extreme programming, Kent Beck wrote this catchy acronym on the board: DTSTTCPW.[9] It has a real nice ring to it; I like to think of words that rhyme with it. It stands for Do The Simplest Thing That Could Possibly Work. When you have written only a few simple tests, the simplest thing is usually faking it. The LedDriver faked it by hard-coding the values written to the LED’s address. Once you have some more tests, ...

Get Test Driven Development for Embedded C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.