Skip to Main Content
Test Driven Development for Embedded C
book

Test Driven Development for Embedded C

by James W. Grenning
April 2011
Intermediate to advanced content levelIntermediate to advanced
356 pages
8h 55m
English
Pragmatic Bookshelf
Content preview from Test Driven Development for Embedded C

Transforming the Code

About half of Martin Fowler’s book is a catalog of refactorings. Each refactoring has a name, a problem that it solves, and a series of detailed steps that guide you through a code transformation. Fowler uses Java in his examples, but there is still plenty of useful advice for embedded C programmers.

To give you the feel of refactoring, we’ll refactor a long function. As we refactor, I’ll introduce some helpful techniques and a guiding principle.

Like in the real world, most of your time will be spent extracting functions from long functions. Aside from Rename, Extract Function is the most often used refactoring. Extracting functions reveals the work the long function is doing, raising its level of abstraction. In ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Design Patterns for Embedded Systems in C

Design Patterns for Embedded Systems in C

Bruce Powel Douglass

Publisher Resources

ISBN: 9781941222997Errata Page