I know that refactoring is \"changing the structure of a program so that the functionality is not changed\". I was talking with some of the guys I\'m working with on my fina
Fowler draws a clean line between changes to code that do, and those that do not, affect its behavior. He calls those that do not, "refactoring". This is an important distinction, because if we divide our work into refactoring and non-refactoring code modification activities (Fowler calls it "wearing different hats"), we can apply different, goal-appropriate techniques.
If we are making a refactoring, or behavior-preserving code modification:
If we are making a behavior-changing code modification:
If we lose sight of this distinction, then our expectations for any given code modification task are muddled and complex, or at any rate more muddled and more complex than if we are mindful of it. That is why the word and its meaning are important.