When Kent Beck published his book on XP his message was clear. Refactor mercilessly.
Refactoring is a form of rework and in lean that is considered waste. So was Kent mistaken about this?
Is there any proof that refactoring and Evolutionary Design (ED) are better than Big Upfront Design (BUD)? Agilist seem to have a strong believe that BUD leads to more waste than ED. The cost of refactoring is considered lower than the cost of building the wrong system.
However, is there any proof to this or is it just beliefs and gut feelings? I have certainly seen absolute poor design coming from ED, but so have I seen this with BUD. The difference? BUD seems to deliver structured crap. ED seems to deliver unstructured spaghetti crap.
“Now hold on”, I hear you saying. That must mean they did not refactor! Maybe… The success of refactoring seems to depend on several things. Skill, experience, motivation, courage, discipline. Discipline is only easy when it has become a habit. As long as we need to think about it, it is doomed to fail. If we are still dependent on willpower, then there is a fair chance we won’t refactor when we know it is needed.
Don’t get me wrong. I much more like the ED way of working, but I am just not sure it can be considered a superior to BUD.
ED is allows earlier feedback. This makes it easier to adjust when you find out you are working in the wrong direction. ED allows responding to change, but this also has it’s limits. If the entire goal of the software system changes, it may mean the whole software must be changed.
Refactor mercilessly. Is that even a good idea? I have seen teams stranding and take forever to deliver the next feature, because they needed to refactor more. When you encounter such a situation, stop them? Refactoring is only allowed on code that is impacted by adding the next feature.