JetBrains

Refactoring

According to Martin Fowler, "Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior."
Since its first introduction, this technique has been widely adopted.

With the evolution of refactoring automation tools, refactoring has become not only a from-time-to-time maintenance tool, but also an every-day coding practice. When you edit code to make it more rational, portable, modular, or readable, much of that process almost always consists of applying refactorings. Refactoring can be as straightforward as simply renaming a method or a variable. And it becomes more powerful if you combine individual refactoring into series. Together, they can help you accomplish complicated tasks that, at first glance, may seem even impossible to automate and nearly as difficult to do by hand.

So, in modern development processes refactoring can and should be applied at any development stage:

  • Architectural/design decisions and design changes
  • Reusing existing code
  • Global changes that entail repetitive tasks, such as switching to newer APIs or eliminating deprecated APIs
  • Everyday coding

Used properly, refactoring makes even the most routine development processes much more efficient and less tedious.