Book Profile
Refactoring Improving the Design of Existing Code
Martin Fowler · 2018
A guide to improving the design of existing software by applying a series of small, behavior-preserving changes called refactorings, enabling faster development and higher quality code.
Get the book →Over time, even the best-designed software tends to decay, becoming complex, brittle, and difficult to change. This 'technical debt' slows down development, increases bugs, and frustrates developers. 'Refactoring' provides a disciplined, proven solution. It's a process of restructuring code in small, safe steps, each one improving the internal design without changing the code's external behavior. This book, written by software design expert Martin Fowler, explains the 'why' and 'when' of refactoring, details how to identify 'bad smells' in code that signal a need for improvement, and provides a comprehensive catalog of over 60 specific refactoring techniques with step-by-step instructions and examples. By integrating refactoring into your daily workflow, you'll not only clean up your code but also deepen your understanding of it, find bugs more easily, and ultimately program faster, creating a healthy, evolvable codebase that accelerates future development.
What it argues
This model illustrates how the practice of refactoring, enabled by self-testing code, improves the health of a codebase and developer understanding. These improvements, in turn, lead to reduced bugs and increased long-term development speed.
Key ideas it contributes
- Refactoring Practice — The disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior, through a series of small, behavior-preserving changes.
- Self-Testing Code — A codebase that has a comprehensive suite of automated tests that can be run easily and will report on their own success or failure, providing a safety net to detect bugs introduced by changes.
- Codebase Health — The internal quality of a software system, characterized by good design, high clarity, appropriate modularity, and low duplication, which supports its long-term evolvability and maintainability.
- Developer Understanding — The developer's cognitive grasp of the code's purpose, structure, and behavior, enabling them to make changes confidently and correctly without extensive archaeology.
- Bug Reduction — A decrease in the frequency and severity of defects in the software, as well as the effort required to find and fix them.
- Development Speed — The rate at which a development team can deliver new, valuable features to users without being hindered by the existing codebase.