Refactoring

Ovid on 2003-01-31T18:37:18

Okay, so you're sick of hearing me talk about testing. You've been warned :)

For various reasons, I haven't gotten much done on my current work project. Small database design issues, refactoring, and other considerations have put the brakes on it. I'm building a Web-based inventory control system and for four days, I didn't not fire up my browser once. I relied exclusively on my passing tests (over 700 at this point) to ensure that the stuff worked. After those four days and much effort, I had redesigned much of the code, refactored out more than I thought I could and restructured parts of the database. I fired up my browser, logged in, and everything just worked. Four days, many CVS commits and massive work on a system and it performed flawlessly -- without my ever having run the application during that time. Humbling.


The REAL Metric

chromatic on 2003-01-31T20:04:30

How many lines of code did you delete?

Re:The REAL Metric

Ovid on 2003-01-31T21:04:30

A quick check on my account handler reveals a net total of about 70 lines of code removed due to refactoring. These are lines that will not need to be duplicated in any of the handlers and I expect that we will have about 30 handlers. Thus, we have about 2,000 lines of code that we will not have to write and debug, but still more functionality than we had before.