image

Syncor Unit Testing Framework for NetBurner


image The Syncor Unit Testing Framework allows you to easily write and run unit tests on your NetBurner code. The tests run on the NetBurner itself not the PC so that you can incorporate custom hardware into your tests. The library also includes a graphical test runner that works with the NetBurner built-in web server. This allows you to quickly and easily run subsets or your entire test package and see quickly if you have any failures. In addition this allows you to write test code without any fear of crashing the NetBurner in such a way that you can't make a new load over Ethernet.  Your test can of course still crash the NetBurner. However, since tests only run, once you invoke them from the Web test page, your NetBurner will always be able to do a clean reboot after any trap.

Getting Started

The framework is available for free from the NetBurner forum. Rather than include the demonstration videos in the upload to the forum (they total about 100Mb), I just uploaded them to YouTube and you can watch them there.

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)

If you are en experienced NetBurner developer and already familiar with UnitTest++ you can probably skip the videos. Just import the framework into Eclipse and get started writing tests. In the video I go through the steps to copy and rename the framework but you don't have to do this if you just want to test it out. You can save some steps and just directly import it. I thought it was important to show the extra steps in the video because once you adopt unit testing into your development methodology you'll want to have a new unit testing project for every library or device project.

I highly recommend putting most of your NetBurner code into libraries. First, it allows you to segment your functionality so that the build cycle is very fast and that will encourage you to write unit tests. Second it's advantageous to be able to separate the tests from the actual code so that you use the minimal memory footprint in your final product. Also when you write libraries you make your own code much easier to reuse.

This framework was built on top of the UnitTest++ testing framework. If you want the underlying documentation for UnitTest++ see The UnitTest++ home page. There is a link there to the documentation.


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  2. Should we ever meet in a restaurant and you feel that unit testing your embedded code was worthwhile and you wouldn't have done it without this framework, you will pick up the tab.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copyright (c) 2011 Syncor Systems, Inc.