Unit Testing information

 Brief outline of Test Driven Development -- for more detail, Kent Beck's book is good

 Unit testing vs acceptance and smoke tests

Available packages include

  •  CppUnitLite -- lightweight alternative to CppUnit designed to improve portability, understood to be freely redistributable.
  • Swig linkage to perl, python etc. means that numerous other frameworks could be used, but it seems as well to work in native C++.

Some  suite comparisons are available.

In deciding which way to go, we need to think about Licensing. It would be good for the framework available from the repository, but most of these packages require the (free to modify) licenses to be redistributed with the source.

A pdf article is available outlining  a process for instrumenting legacy code -- see Michael Feathers' book for further detail

Comment on code asserts

Using inline ASSERTs certainly achieves some of the aims of UnitTesting. However, as part of the main code, they will not be tested where the test suite used does not have coverage. This will be true both in terms of lines touched, and parameters used. Such ASSERTs will also often make an identical test repeatedly.