I know that doing unit testing on embedded systems has a high barrier to entry. I've spent considerable time trying to lower that barrier for the NetBurner. I've developed a unit testing library based on the open source UnitTest++ project. I then created a web project to provide a graphical unit test runner for the framework. All you need to do now to do unit testing, is import this project into your workspace and write the tests. Once the tests are writting do a build and load and navigate to the unit test web page and run your tests. I took this approach to make the tests as useful as possible. Your tests run on the actual NetBurner hardware and use the same libraries your actual code will use. In addition if you have custom hardware that you can write to and read from you can incorporate that hardware into your unit tests.
It might seem that running the tests on the actual embedded hardware would result in a long delay from writing the tests until seeing the results. However the combination of the NetBurner's ability to load the application over Ethernet and the speed of the GNU compilers makes it quite acceptable. In the video demonstrations, I didn't do any time lapse or editing tricks. The cycle time you see in the second demo where I'm writing actual tests and running them is the time you can actually expect it to take.
If you watch the videos that are referenced by the readme document it will take you about 25 minutes to install and learn how easy it is to do unit testing now. I have found there are several advantages to having a unit testing framework available outside of the normal reasons for doing unit testing.
- You can easily learn about and experiment with NetBurner capabilities
- You will see a lot fewer TRAP conditions that make you resort to FLA and the serial port to get your NetBurner in a usable condition again. Since the tests have to be invoked from the web page, if any test causes a trap, it won't happen again on reboot.
If you want to watch the videos first you can see them here:
The first screencast is a demo of how to use this unit testing framework to test either libraries or NetBurner device executable files. (Approx. length 9 minutes)
The second screencast shows you how to write tests of increasing complexity. It covers using fixtures and how you can do compare tests with vectors. (Approx. length 12 minutes)