👨‍💻
Software Engineering
Refactoring: Improving the Design of Existing Code
Refactoring: Improving the Design of Existing Code
  • Overview
  • Chapter 2
    • Defining Refactoring
    • Why Should We Refactor?
    • When Should We Refactor?
    • Problems with Refactoring
    • Refactoring, Architecture, and Yagni
    • Refactoring & the Wider Software Development Process
    • Refactoring & Performance
    • Going Further
  • Chapter 3
    • Bad Smells in Code
    • Smell: Mysterious Name
    • Smell: Duplicated Code
    • Smell: Long Function
Powered by GitBook
On this page
  • Refactoring (noun):
  • Refactoring (verb):
  • Restructuring (verb):
  1. Chapter 2

Defining Refactoring

If someone says their code was broken for a couple days while they were refactoring, you can be pretty sure they were not refactoring

  • The term "refactoring" is often used very loosely by practitioners to mean any kind of code cleanup.

  • Refactoring is about applying small behavior-preserving steps and making a big change by stringing together a sequence of these behavior-preserving steps.

  • During this process, code should NOT spend much time in a broken state.

Refactoring (noun):

a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing observable behavior.

Refactoring (verb):

to restructure software by applying a series of refactorings without changing its observable behavior.

Restructuring (verb):

a general term to mean any kind of reorganizing or cleaning up of a code base that includes refactoring.

Refactoring is always done to make the code easier to understand and cheaper to modify.

PreviousOverviewNextWhy Should We Refactor?

Last updated 11 months ago