Geeks With Blogs
A Technical Debtor Toward continuous improvement

Mere minutes after I posted on “architectural refactoring,” Keith Nicholas has commented about the unsuitability of the term. He said:

you'd be better off calling it "evolutionary design"
The dilution of the word refactoring is disturbing, there's a certain rigor to "factorization" which shouldn't destroy the product.
refactoring != a cool way to say "I'm gonna change stuff"

There’s a fair bit to be said on this, so I thought I’d add another post rather than try to reply in an undersized comment box.

I agree that the use of "refactoring" in this context makes me a little squeamish. Keith is absolutely right that there's a lack of rigor here -- partly because the scope of the changes ensures that enough changes that this isn't really a refactoring in the Fowleresque sense.

However, as Fowler defines it, "evolutionary design means that the design of the system grows as the system is implemented". In the case I'm describing, the design isn't growing. Rather, suboptimal design decisions are being rethought, reworked, rebuilt. In an evolutionary sense, I suppose you could argue this is "growth," since the new architecture is "fitter" than the old.

However, to my mind, the word "evolutionary" brings with it a connotation that the improvement is a small forward step, building on what is already there -- not a massive reworking of the underpinnings of the architecture.

The scope of this effort is what's a little unusual. Kyle Baley, for example, talks here about architectural changes and how you know when it’s time to start over. Now, Kyle is a fellow Canuck and an all-around decent fellow. I even agree that, from what he describes, they made the right choice. However, he describes an effort that was scoped at a maximum of 2 developer-weeks. I had on the order of twice as much time personally into proof-of-concept for the changes that were made; all told, we invested something like 120 developer-weeks into the changes.

I have trouble calling a step of this magnitude “evolutionary.” Perhaps architectural renovation would be a more apt term.

(And, as a minor aside, when I said earlier that “I’m not even leaving the functionality intact,” I should have been clearer. The original architecture made heavy, brilliant and infuriating use of refactoring. That trait, among others, were ripped out. After the renovation, the code base had been reduced by close to 40%, and virtually every line of code had been touched, or at least inspected. However, the business functionality remained essentially unchanged – essentially, since we were able to identify and remove a fair number of bugs during the process.)

Thanks for keeping me honest, Keith – and for the great point you made.

Posted on Monday, July 12, 2010 9:29 PM ALTDOTNET , Software Development | Back to top


Comments on this post: Architectural Renovation?

# re: Architectural Renovation?
Requesting Gravatar...
better!

when I've done what you've done, I've tended to talk about it as Rearchitecting. Basically, I want the same functionality more or less, but want to change the approach of large chunks of the software and change the fundamental architecture so that how you extend and create new functionality will be done quite differently (and hopefully more effectively!).
Left by Keith Nicholas on Jul 12, 2010 10:05 PM

# re: Architectural Renovation?
Requesting Gravatar...
Keith,

I'd rather stay away from "rearchitecting." That has a cleanliness to it that just isn't present in this case. At least to me, it implies enough adherence to good principles in the original architecture that you can make piecewise changes, substituting a new architecture within one tier.

Renovation is, to me, a much more descriptive term. It begins with the act of removing a whole lot of unsatisfactory cruft. This in itself gives rise to new discovery -- often more that has to be removed. It's messy and dirty, full of surprises. Sometimes the underpinnings have to be completely rebuilt. Only then can you begin to build on top of it again.

Jeff
Left by Jeff Certain on Jul 13, 2010 6:33 AM

# re: Architectural Renovation?
Requesting Gravatar...
yes, its a messy business, the only things I've "rearchitected" have been badly designed evolved hacky lumps of steaming poop. Which oddly I find quite fun to do :-) But they do have architectures... I found grady boochs blog about what he is doing for his "handbook of architecture" is quite useful. A lot of his research is to go find people who will let him look at their software and then he does a kind of "archaeological dig" into the underlying structures of the software, the patterns, etc.

The two most common things I tend to come across, embedded systems.... they tend to be monster state machines. I often introduce a pipes and filters architecture with small well defined state machines.

Web Apps/ Business apps, well, the biggest sin there is a lack of layering, so thats usually about introducing layers, shuffling things, and introducing appropriate technology / architecture at each layer. and using something like MVP / MVC depending on the technology being used for the UI

and of course, most of the time I'm starting with 0 automated tests. So usually thats my first port of call, creating seams to test against.
Left by Keith Nicholas on Jul 13, 2010 3:24 PM

# re: Architectural Renovation?
Requesting Gravatar...
Keith,

What we started with was an interesting example of good ideas taken too far. Great fun to pull it apart and improve it, and greatly frustrating at times too.

As far as layering, it's there... but often developers don't always respect the layers. NDepend is a great help in finding these issues, but I'm really looking forward to migrating to TFS2010 soon, and having the architectural layer diagram validation as part of our CI builds. That'll be then end of that nonsense!

With automated tests, one of the real challenges we have is a data-centric mindset; the code is difficult to write automated tests for, since much of the code relies on having a database available (and in a known state). There are plans to address this in the very near future.

Jeff
Left by Jeff Certain on Jul 13, 2010 9:46 PM

Your comment:
 (will show your gravatar)


Copyright © Jeff Certain | Powered by: GeeksWithBlogs.net