Check out Good Design, part IV: The Role of Tests by Rob Myers. Here is an excerpt:
We’ve seen how refactoring becomes the primary design activity on an Agile team. Diligent, confident refactoring is possible to the degree that the code is tested through an automated test suite. If the tests don’t cover a portion of the code, a defect may be introduced when that code is…
The full article is available here.