What do masters of refactoring know that novices don’t?
In 2006 I stumbled upon an answer to that question. I was preparing numerous refactoring labs for use in Industrial Logic’s eLearning. Each lab features problem code and solution code. To produce the solution code, I’d refactor the problem code by applying sequences of low-level design transformations, like Extract Method, Move Method, Extract Class and Inline Method.
As I did this work, I noticed myself performing common sequences of refactorings. Three different labs all used a common sequence to produce an important design improvement. Another four labs used another common sequence. These common sequences had no names yet they revealed valuable refactoring strategies!
Since then I’ve named these strategies, discovered new ones and experienced how helpful they are on real-world projects.
In this tutorial, I will discuss and demonstrate the following refactoring strategies and lower-level tactics:
This session is an interactive lecture. I present information about each strategy/tactic, show a demonstration of it in an IDE and then discuss it with the audience.
I have given this talk at SD West 2007 and will be giving it again at SD West 2008. (It has gone under the title, Patterns of Refactoring at those conferences).