Front Page | Recent Changes | Title Index | Amateur Radio | Software Development
» Find Page
» Worked All Britain
» Front Page
» Watson W7900
» Unit TestingThere are some very good unit testing packages available. For C++ my preferred choice is the Boost Test Library.
But for any of the unit testing packages to work we have to ensure that the software is testable. (Or levelisable, as John Lakos would call it). This is much easier to do with new code than with an existing code-base that was not written with testability in mind. Dependencies between components can prevent each one from being separately tested. I favour hierarchically testing components, so a simple and clean (acyclic) dependency graph is the ideal starting point. Note that by component I mean a coherent unit of code, e.g. a class or cluster of classes, not necessarily a programme or COM component. There's a clear parallel between loose coupling and testability - which is a bonus, as loose coupling also promotes extensibility and maintainability.
Terry Ebdon, December 2002
|