Unit testing discipline

by JackH on February 9, 2007

One of the hardest things when unit testing is retaining discipline. I have a nasty habit of refactoring code and then fixing something else that is completely unrelated to the job at hand. I find it really hard to stop tinkering.

What then happens? Well, your tests go red. You then find yourself trying to figure out whether the tests are failing because of your initial refactoring or your code tinkering.

One potential remedy might be continous integration. Perhaps, if every time I checked in changes and the system refused because of broken tests then maybe I’d be able to stop myself tinkering. Unfortunately, for now we are doing ActiveX components in ATL/C++. There is very little tool support for continuous integration in the Visual C++ world.

Role on .NET…we’ll be there soon :)

Leave a Comment

Previous post:

Next post: