Sunday 3 October 2010

Unit tests can help or hinder refactoring

Helping
Having a suite of tests which cover the intended behaviour of a class in isolation allows the development team to feel more comfortable that subsequent changes to the implementation of that class have not had undesirable side-effects.

Hindering
If a blanket policy is in place to have some numeric value associated to represent "good test coverage," then some test cases can become an overhead that needs to be worked through when refactoring takes place.

No comments:

Post a Comment