Prefactoring re-coined

Two pieces of input struck me this week that caused a bit of a brainwave.  The first stimulus I chanced upon was Michael Feathers’ article on the sloppiness of refactoring, in which he proposes a nice solution to getting the habit of refactoring to completion: do it first.

For every story/feature that you accept in planning imagine how you would implement it if the code was in a state where it would accept the feature easily.  Then, create a task for that refactoring work and make sure it is done before the other tasks for the feature

I like this idea a lot, and I want to introduce it in to the working agreement (how I hate that term) of our team.  This would solve a lot of forgotten refactorings that seem to only be remembered at retrospective time.

The second thing that I chanced upon is The Mikado Method book.  In it the authors propose a method for improving legacy code that begins with determining the dependency graph for the mini-tasks in the implementation, then starting the work at the leaves of the graph (these are the most independent areas of change in task).

What both these approaches essentially give us is a pre-refactoring step in implementation.  I was so excited by both these commalities that caused me to coin the term Prefactoring.  Imagine my dismay at learning that not only Prefactoring was already coined as a term in our lexicon, but also that there was even a book written with that title.  Unfortunately it means something entirely different…

About these ads

2 Comments

Filed under Uncategorized

2 responses to “Prefactoring re-coined

  1. NIce post.

    Slide 22 of the following free webinar (just register) will be of interest: Refactoring to the Open Closed http://www.netobjectives.com/resources/webinars/refactoring-to-open-closed

    It distinguished between classic “Fowlerian” refactoring and refactoring to the Open Closed principle, which you do so you can enhance (add a feature) with less risk and less waste.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s