Take a Step Back Before Claiming Done

Before you claim to be done, take a look at your work and see whether there is any cleanup needed. After a quick review, the production code looks clean; functions are short and focused, names are readable, and we got rid of magic numbers as we proceeded.

There are magic numbers in the LedDriverTest.c file for the boundary values. They could be removed, but I’ll leave them for now. I think it makes the tests a little bit easier to read. Once again, it’s a judgment call.

As the design evolved, our test strategy evolved too. Maybe that should be revisited. The early tests relied on the value of virtualLeds. Later tests depended upon the query functions. You could refactor the tests so that more of the ...

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.