TDD/Unit Testing:
I searched some for TDD tutorials this week. and found a few. Unfortunately, I found tutorials with no or very little “hands on” practice. So I am still looking for good tutorials. When I find some, I will post links on this blog.
What I have gleaned from the tutorials so far is that when building your code, you replace your main file with your testing file(s) so that the tests can call each of the functions/methods individually with known values and should get back predictable results.
Embedded Units Testing:
For embedded systems unit testing, my code will be compiled to run natively on the development machine rather than being compiled for the target processor. This means a different tool chain for test build than for production or debug builds.
Note: Tool Chain is the set of tools that are used to create machine runnable code from your source files.
Any API call or peripheral device needs to have mock code that can be run as part of the tests.
Note: Mock Code is software that represents things that are not on your testing machine, or would hinder testing.