Sometimes, programmers find themselves rewriting an existing program. We've all done it, perhaps more often than we'd like to admit. But when you find yourself in this situation, don't call what you're doing refactoring, because it's not.
If you are in the so-called RefactoringHell, you aren't refactoring any more.
I was just trying to explain this concept to someone the other day. I hear people use the word ReFactoring all of the time, when they often really mean ReWriting. ReWriting is really ReWorking?. See WhatIsReworking.
The act of fixing bugs or adding new functionality is not actually ReFactoring (no matter what you might hear). ReFactoring simply makes it easier to do so.
TestDrivenDevelopment provides another way to look at this.
CategoryRefactoring CategoryMisconception