Library — 2 min summary
Improving the Design of Existing Code — by Martin Fowler
The key message throughout the book in regards to refactoring: do it in small, safe steps, as a continuous habit rather than a one-off cleanup. When in doubt, refactor first so that adding the next feature is easy.
A reliable test suite is what makes refactoring safe. The book stresses writing tests first (or adding them around the code you're about to change) and keeping them fast and trustworthy. Without that net, small steps are much riskier.
Code smells (a term from Kent Beck in this context) are surface signs of deeper design problems—they tell you where refactoring will pay off, not that something is "wrong" by definition.
The book organizes refactorings into a catalog with names, motivations, and step-by-step mechanics—so you can apply them safely and talk about them with others. The main themes:
Some changes are too large for micro-steps alone; the book outlines strategies for larger restructures while keeping the system runnable.
Refactoring is framed as economics and tradeoffs, not perfection; balance ideal design with real constraints.
Use IDE and tooling to automate the mechanical parts and keep each step small and reversible. The goal is a sustainable workflow: continuous improvement, backed by tests and shared discipline.