Monday, April 17, 2006

Refactoring (so hard to let go)

Did you happen to come across a utility method that returns Collection, but which can return null as well? What do you do then, if this method is being used in half a hundred of places across entire code base? What do you do if in some places people have actually started relying on this method returning null in those cases when it does? Naturally, as you work through the uses of this method, you find that as many places do not perform check for null... How does that make you feel? Do you enter 50 bugs and fire it off in the general direction of QA to let them dispatch? Or do you do it all yourself, taking risk of broken build? Who else do you tell this about? Does your manager have to know (it's hard to justify, you know.... what's the big deal with this code being broken anyway)? Hard to let go.

Update: the result, in two places code was broken after the refactoring. In one place, regression tests caught my mis-deed. Another was caught and corrected by a collegue (my heartiest thanks to him). Companies bigger than average have this robustness to them :) Not redundancy, no.

0 Comments:

Post a Comment

<< Home