In another question, it was revealed that one of the pains with TDD is keeping the testing suite in sync with the codebase during and after refactoring. Now, I'm a big fan of refactoring. I'm not going to give it up to do TDD. But I've also experienced the problems of tests written in such a way that minor refactoring leads to lots of test failures. How do you avoid breaking tests when refactoring? * Do you write the tests 'better'? If so, what should you look for? * Do you avoid certain types of refactoring? * Are there test-refactoring tools? **Edit:** I wrote a new question [that asked what I meant to ask][1] (but kept this one as an interesting variant). [1]: http://programmers.stackexchange.com/questions/5951/how-do-you-efficiently-keep-your-tests-working-as-you-redesign