Book
Refactoring
Improving the Design of Existing Code, 2nd Edition
Martin Fowler
Summary
A catalog of refactorings: named, step-by-step techniques for restructuring code without changing what it does. Martin Fowler opens with a worked example, then spends a chapter naming code smells, the signals that tell you when to refactor, before building the tests that back every change in the catalog that follows. That catalog runs eight chapters: an introduction to its format and a first set of starter refactorings, then six categories covering encapsulation, moving features between objects, organizing data, simplifying conditional logic, refactoring APIs, and handling inheritance. The vocabulary is the payoff: it turns a vague sense that something is off into a specific complaint a team can act on, and every entry in the catalog is written to be applied in small steps with tests behind it. The second edition is available in Japanese translation from Ohmsha.
Editor's Note
For intermediates who want a catalog of techniques to improve working code without breaking it. Its value rises sharply if you already have testing skills; early on, use it as a reference to dip into rather than a cover-to-cover read.
Target Readers
- Developers who can already write working code and want a named catalog of moves for improving its structure without breaking it
- Engineers who keep flagging the same code smells in review and want the vocabulary and specific technique to fix each one
- Teams building the discipline to refactor in small, test-backed steps rather than large rewrites
Tags
Colophon
- Publisher
- Ohmsha
- ISBN
- 978-4274224546
- Published
- Dec 2019
- List price
- ¥4,840incl. taxMay differ from the actual selling price on Amazon
Get this book
* The link above is an advertisement via Amazon Associates.Related Books
Prerequisites
- Recommended
Clean Code
A Handbook of Agile Software Craftsmanship
Robert C. Martin
Reason: Once you know what good code looks like, you need techniques to safely move existing code toward that standard. Refactoring offers a systematic way to improve structure without changing behavior, guided by code smells.
- Related
The Art of Readable Code
Simple and Practical Techniques for Writing Better Code
Dustin Boswell, Trevor Foucher
Reason: Once you know what readable code looks like, you need techniques to move existing code toward that shape without breaking it. Refactoring offers a step-by-step way to improve structure in small moves without changing behavior, guided by code smells.
Sources
- Related
The Pragmatic Programmer
your journey to mastery, 20th Anniversary Edition
David Thomas, Andrew Hunt
Reason: Refactoring is how the pragmatic discipline of not living with broken windows is applied to real code. It turns 'spot the decay, fix it now' into a habit of small, behavior-preserving improvements.
Sources
- Related
Head First Design Patterns
Building Extensible and Maintainable Object-Oriented Software
Eric Freeman, Elisabeth Robson
Reason: Once you can recognize patterns, techniques for safely moving existing code toward the pattern it wants to be become valuable. Refactoring lets you introduce patterns not in one leap but as a sequence of incremental, safe transformations.
Sources
Next Books
- Recommended
Working Effectively with Legacy Code
Michael C. Feathers
Reason: Once safe refactoring moves are in hand, you take on the hardest case: legacy code without tests. You first find seams to break dependencies, cover them with tests as a safety net, and only then improve the structure.
Sources
- Related
A Philosophy of Software Design, 2nd Edition
John Ousterhout
Reason: Once you have tactical means of improvement, you raise your view to the strategic question of why—the nature of complexity itself. A new criterion enters your refactoring decisions: does this actually reduce complexity?