What do we mean by refactoring?
If we should give a strict definition of refactoring, we could be in some trouble, because it is often interpreted in different ways. The most common meaning, anyway, is related to code rewriting. Code refactoring is the process of restructuring and improving existing code without changing its behavior. Code is rewritten so that it is easier to understand and easier to modify.
We could also give a “recursive” definition of refactoring: a series of refactorings applied to the software without changing its behavior.
Let me highlight this again because it’s very important: the software will return the very same results as before, no more and no less. It will just be written differently. The main (maybe the only) target you have to achieve is to make your code easier to understand, and this is one of the most important yet most difficult tasks to accomplish.
Refactoring could also be bounded with another couple of concepts.
...