Test Driven Development for Embedded C

Author:James W. Grenning
Publisher: Pragmatic Bookshelf, 2011
Pages: 310
ISBN: 978-1934356623
Aimed at:  C programmers
Rating: 4.5
Pros: Clear and persuasive
Cons: Not as low level as "embedded" might suggest
Reviewed by: Harry Fairhead

 

The idea of using any sort of programming methodology in the essentially crude world of embedded development might seem unlikely but in this case we have something to learn.

If only all of the programming books I had to read were as straight to the point as this one. Even if you don't write embedded code this is a great introduction to Test-Driven Development in C. In fact you might even complain that there isn't enough about embedded development but I don't think this matters too much. The orientation of the book is towards small resource limited systems.

The book starts off with a look at the basic idea of TDD and manages to "sell" the need for it as well as the principle quite well. From here we move on to specific test toolkits - Unity, CppUTest and examples of using them. Chapter three takes us though an example of TDD in building an LED driver. Then we move on to the particular problems of embedded TDD and how to cope with the hardware problem.

After this you get to a point where you should understand the ideas and approach of TDD but probably are still resistant to it because of issues of efficiency, the time it takes to write and maintain test and so on. Chapter 6 attempts to anticipate these objections and explain why they are not as important as you might at first think.

 

Banner

 

Part II of the book is about testing with collaborators i.e. other modules that the test module is dependent on. This is about the problems of "mocking" when it comes to hardware or code that isn't available to be part of the testing. If you already know something about TDD this provides much of the modification you need to make it possible to see how to adapt what you know to the embedded situation. Part II is about design and continuous improvement. The topics covered include refactoring, adding tests to legacy code and patterns and antipatterns.

Overall this is a book that puts a convincing case for TDD - and suceeds in making it seem reasonable in an embedded environment. It is well written with plenty of well formatted code illustrating the ideas.

What it doesn't do is to tackle the extremely low level problems that an embedded system can encounter - DMA, interrupts and so on. If you are looking for a book that deals with chip level programming and simulation then this isn't it - but not all embedded programming has the exceptionally low level feel to it. Even when it does there will usually be a large chunk of the program that doesn't deal with low level concerns - routines that deal with dates say rather than the RTC hardware. In this sense the book is more about TDD in C with limited resources than about interacting with hardware in intimate ways.

So what you think of the book does depend on the sort of embedded code you are creating.Personally I'm prepared to overlook the defects and recommend it to any C programmer even if they aren't specifically designing embedded code.

 

Banner


XNA Game Studio 4.0 Programming

Author: Tom Miller & Dean Johnson
Publisher: Addison Wesley
Pages: 588
ISBN: 978-0672333453
Aimed at: C# programmers
Rating: 4
Pros: Good introduction to 3D XNA
Cons: Not particularly about programming games
Reviewed by: Mike James

 

If you want to start programming games for the PC, XBox and WP7 wi [ ... ]



The Process of Software Architecting

Author: Peter Eeles & Peter Cripps
Publisher: Addison-Wesley, 2009
Pages: 432
ISBN: 978-0321357489
Aimed at: Software Architects
Rating: 4.5
Pros: Good use of visual representations
Cons: Assumes high degree of pre-existing knowledge
Reviewed by: Alex Armstrong

Billed as "an indispensable resource for  [ ... ]


More Reviews

Last Updated ( Tuesday, 03 April 2012 )
 
 

   
RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.