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
Suite comparisons -- packages discussed include
- Boost Test Library -- see license
- CppUnit -- LGPL
- CppUnitLite -- lightweight alternative to CppUnit designed to improve portability, understood to be freely redistributable.
- CppUnitLite (version by Keith Bauer) -- CppUnitLite edited to prevent all g++ warnings -- see license
- CxxTest -- requires perl/python, LGPL
- UnitTest++ -- developed from CppUnitLite to address its limitations (by the author of the Suite comparisons), has a more restrictive license
For a really lightweight alternative, see MinUnit -- a minimal unit testing framework for C; Swig linkage to perl, python etc. means that numerous other frameworks could be used, but it seems as well to work in native C++.
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.
