«« Bad iBook Mobos Replaced for Free MVC 123 »»
blog header image
On Refactoring

Wow, this has been my biggest refactoring job so far. All I have to say is that without the unit test safety net and Eclipse's refactoring support this would not have been practical.

We had some wicked coupling because of the call-throughs we were doing, so I needed to mess up three layers at once. Now that I've got the UI working on a basic level again I'm going to go back to the sub-UI code. The worst thing you can do during a refactor is try to get features working right away. You'll just be chasing obscure bugs for hours on end. Once you have your post-refactoring bearing again start with methods on the bottom layers and make sure they are completely unit tested (we use jcoverage to check that). Then you can write the layer above it with the confidence that the layers below will work like you expect them to.

Some people prefer the fix-a-little strategy as opposed to the rip-it-up strategy. I think there is a time and a place for both. Sometimes slowly refactoring will just take too long.

When I get up to the user interface how am I going to make sure AudioMan works the same way that it did before the refactoring? Yep, I'm going to use the customer acceptance test spreadsheet. I'll publish that as soon as I figure out how to put the GPL in it. ;)

Posted at January 29, 2004 at 07:09 AM EST
Last updated January 29, 2004 at 07:09 AM EST
Comments
Google
 
Search scope: Web ryanlowe.ca