Refactoring is a word that is often heard in software development organizations, and in some cases, it becomes a bad word. How can that be? It happens when the word is used but something else is happening—namely, rewriting or redesigning.
Refactoring does not just mean cleaning up code and making it easier to read and maintain. If you have simplified the code but changed its behavior, you have not refactored it—even if you consciously removed behavior that is no longer needed or wanted.
Refactoring is “a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.” From refactoring.com:
Its heart is a series of small behavior preserving transformations. Each transformation (called a “refactoring”) does little, but a sequence of transformations can produce a significant restructuring. Since each refactoring is small, it’s less likely to go wrong. The system is kept fully working after each small refactoring, reducing the chances that a system can get seriously broken during the restructuring.
If you are redesigning or rewriting, please call it that. In order for non-technical people to understand what refactoring is and why it is important, we must use the word correctly.