Test Driven Development in Embedded Software
Applying the concepts and value of Test Driven Development to embedded systems was inspired by two things:
- Our customers asking for help in making TDD feasible in embedded software.
- A general perception that TDD was impossible to implement in anything but “fat” embedded systems running languages like Java or C++.
Inspiration in solving the problem was found in high level GUI design patterns.
“Mocking the Embedded World: Test-Driven Development, Continuous Integration, and Design Patterns”
Jump to our Papers page to read the abstract or open the PDF right here.
Mocking the Embedded World: TDD, Continuous Integration, and Design Patterns [PDF]
Resources
» Unity – embedded unit test framework for C (released 2008)
» Mocking the Embedded World: Example Project [ZIP]
(full sample project distributed at Embedded Systems Conference Silicon Valley 2007)
Setup & use instructions (for Windows):
- Unzip the archive. Source files are in the \src directory; all system and unit tests are found in the \test directory.
- Install the Ruby scripting language interpreter by downloading and running the One Click Installer. Version 1.8.5 was used with this example.
- After installing Ruby, run ‘gem install rake’ at a command line to install the Rake tool (Rake is Ruby make).
- Install IAR’s Embedded Workbench for ARM. Version 4.41A (4.41.1.501) was used for this example.
- From the root of the project run ‘rake -T’ at the command line to list all rake tasks; run ‘rake test:units’ to build and run all of the project unit tests.
Notes:
- The tools we created for unit testing & mocking and building the project are significantly improved today over the tools included in this sample project. Our unit test framework, Unity, is available for separate download (see link above in Resources). CMock requires further work before it’s available for release.
- The system tests are viewable in test\system of the sample project. However, without a miniLAB device and an Atmel AT91SAM7X ARM7 demo board, these tests cannot actually be executed.
“Effective TDD for Embedded Software”
Jump to our Papers page to read the abstract or open the PDF right here.
Effective TDD for Embedded Software [PDF]
Resources
Full Model Conductor Hardware example code referenced in our paper: