Monday, December 21, 2009

Testing with unit tests

Unit test libraries like JUnit and NUnit provide extensive capability for white box testing. The assertion model essentially translates as a verification of intention. By considering intentions, you should be verifying the design and not proving the code. This is the trap. TDD works when it is implemented with test driven design rather than as tests written to prove code.

The biggest problem I've encountered is maintaining the discipline in the face of impending deadlines. It is easy to develop unit tests when the functionality is unique but when its an artifact of a partially enforced bad design, then the unit test for that particular section seems redundant.

No comments: