Biting Back
Sunday, October 2, 2011 at 9:27PM How much did forgetting to work in small increments screw me up on Friday? So much so that I did something I never do: I brought work home with me.
On Friday I needed to make a pretty serious architectural change in the way the new testing framework we’re developing does its error reporting so that I could add an important new report. The current structure created objects that couldn’t hold the new information we needed to pass along, but the real problem was that they were created at the wrong point in the process, after the errors I was looking to report had already occurred. So I need to make some object life-cycle changes, and I also had to contend with some pretty substantial technical debt. I’d been saying for about a week that the error reporting code was in the worse shape of any part of that code base, so I knew I was in for some real work. Friday I waded in, eager to get through it. Which is when my tired brain betrayed me, and I got stuck in the middle of a gigantic refactoring that I should have done as a long series of smaller refactoring. I realized I wasn’t going to get through it before the end of the day, and I didn’t want to make things worse, so I just stopped and brought it home with me.
The reason this turned into such an undertaking because of my failure to apply some of the new techniques I’ve adopted that have made programming fun for me again. Yes, I was using Test-Driven Development to build my replacement classes, setting up a unit test, creating the functionality required to make that test pass, and repeating every few minutes or so. And I was using my existing unit tests to protect myself while I was refactoring, extracting a new class here, renaming a method that, improving the design of the existing code to make it easier to slide in the new functionality I needed. But while I got these things right in the small, it was in the large that my discipline broke down. I started off working in (unintentionally) Pomodoro-sized blocks of time, but somewhere in the middle of the afternoon my disciple or focus gave out. And then I decided to switch the main code over to using something that wasn’t ready. And then the train wreck happened.
The way of out this, of course, was to go back to to what I was doing last week, to focus on incremental progress, to do one thing at a time and ignore the rest of the system until I was ready to tackle that next bit. So that’s what I did this weekend. First, I disabled all of the unit tests that were failing because of the changes I made so that I had clean slate to start with. Then I started picking leaf nodes in my dependency tree, turning their tests back on, and fixing them one at a time. Every twenty-five minutes, my timer would tell me to go do something else for a while. I kept a notecard handy to jot down “do this next” and “here’s how that object should work” notes for myself. Bit by bit, tests got re-enabled and features reappeared. And tonight, it all came back together. I can’t run it in the production environment because my VPN connection isn’t working, but I’ve tested it as throughly as I can without the right hardware. Tomorrow morning I’ll try it out at work. And while I didn’t like having to bring work home with me, at least I was smart enough to work on it in the right way.
Update
Fitness: Ran 5 milesSun, Moon, and Stars: 0 words, 355 seven-day average, 285 average, 53026 total, 26 past the goal for the week
Paul |
Post a Comment |
lean & agile,
things i am doing ![The Runner's Guide to the Meaning of Life [RUNNERS GT THE ME -OS]](http://ecx.images-amazon.com/images/I/41Wyafg85HL._SL75_.jpg)




Reader Comments