Palladion Software
user icon Guest

Unit Testing Redux

Following up to an earlier post on effective unit testing: most people are trying too hard.

Created by tseaver. Last modified 2009-08-02 16:48:01.

Thinking back over my post from a year ago I find that the real reason for most bad unit tests is that people are trying too hard, typically for one of the following reasons:

Most of the issues involved with the first motive are satisfactorily addressed in the earlier post: refusing to share code between test modules makes most tempations to cleverness go away. Where the temptation remains, the cure is to look at an individual test and ask the following questions:

Fixing tests which fail along the "don't repeat yourself" axis is usually straightforward:

Rewriting tests to conform to this pattern has a number of benefits: