liveBook · Manning

Refactoring

As explained in Build High Value Software Systems

Refactoring is the restructuring of existing software without changing its externally observable behavior.

Refactoring changes a program’s internal structure without changing its externally observable behavior. It can make code easier to read and change, but cleaner structure alone does not guarantee good production behavior. section 10.2 section 1.1.3

Common code-level refactorings include:

  • Rename a variable for clarity or extract a method to reduce duplication. section 10.2
  • Replace a conditional with polymorphism or move a function to a more appropriate module. section 10.2

Before changing legacy code, understand its business rules and invariants. A technical-looking condition may encode a real constraint; changing it without understanding can break behavior. Existing tests may also miss performance, operational, or architectural assumptions, so validate those constraints early. section 7.1 section 1.1.3

A code change or a process change?

Extracting a class to improve cohesion is refactoring because it improves code structure. Adding a CI cache to reduce build time changes the delivery process instead. The target—not whether code was edited—distinguishes refactoring from Kaizen. section 10.2

How Build High Value Software Systems covers it

How deep it goes
Defines behavior-preserving restructuring and gives common transformations, without detailing a step-by-step refactoring procedure.
Examples
Uses renaming, method extraction, polymorphism, and function relocation as examples.
What it assumes
Requires understanding business constraints and invariants before changing legacy code.
What you can do after
Evaluate whether a change targets code structure or workflow, and identify legacy constraints that must remain intact.
How it connects
Separates code-structure improvement from Kaizen’s focus on workflow, tooling, and process.

Also explained in

Compare how 29 books explain refactoring →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.