Thursday, September 28, 2006

Refactoring: Improving the Design of Existing Code

Martin Fowler's discussion book and catalogue of common refactorings is a hugely interesting read. It presents the reader with an overview of what refactoring is, how it evolved, and why we should be making use of the technique in software development.

Refactoring is the process of improving software by making it more readable, maintainable, and shaping it into a better design. Many people consider the end point of a successful refactor to be a design pattern (Refactoring to Patterns).

The bulk of this book is given over to a catalogue of possible refactorings. Some very simple, such as Encapsulate field (i.e. replace a public field with a private field and a public property), to other more complicated efactorings such as Introduce Null Object.

A large part of refactoring is being able to test that your changes have not broken existing code. For that reason this book advocates and discusses automated unit testing as a way to verify that your refactorings haven't broken anything.

This book is getting on a bit now, but there are still a large number of software professionals who have not embraced a more agile way of working who would benefit from the gentle introduction that this book delivers.

Another point to make is that this book is Java based, but that should not put of any C# professional from reading it.

0 Comments:

Post a Comment

<< Home