Monday, June 09, 2008 9:36 PM
A few weeks ago, I finally conceded victory to the gas crunch here in the states and traded in my beloved gas guzzling SUV for a brand new hybrid. Although I can’t say that I’m an avid environmentalist (my old car basically ran on baby seals and Al Gore’s tears) I have to admit that the new car has begun to change some of my old habits just a bit.
This is all due to a rather innocuous gauge which replaces the tachometer as part of the dashboard of all new Toyota hybrids. Although its rather easy to go unnoticed at first, the more you drive the more it starts to jump and demand your attention. That’s because this gauge gives you constant feedback while you drive and tells you your real-time, instantaneous MPG at that exact moment in time. And as much as I thought I wouldn’t even give it a second a glance, I’ve grown to watch it constantly.
Why? Because I’m cheap. Let’s be honest, this is primarily why I bought the hybrid in the first place. Yes, they’re a little more expensive then a traditional gasoline car but when you drive as much as I do (150 mile commute per day, anyone?) you make up that difference pretty fast. The point is though, once you’ve shelled out the extra money for a new car two years before you’d planned to, and paid the premium for a hybrid engine, NOTHING gets your attention faster then watching that little glowing white needle bounce happily up to 0 MPG. Each time I saw it happen, I immediately retraced my last action in mind to try and figure out what I had done to harm my precious gas mileage. Was it that last 70 degree climb up the interstate passing that school bus in the right hand lane at 80 MPH? Maybe it was gunning it on the way out of the Fort Pitt Tunnels while vying for position over that deceptively harmless seeming old lady in the powder blue Volvo that’s already cut me off 2 mornings in a row this week. Whatever it was, you start to notice real fast because you see the results of your mistake instantly.
And that’s the key. Most cars have some sort of an average MPG indicator. Hell, even my old gas guzzling SUV had a running average MPG tally in the overhead console (which never broke 19, by the way). The difference is that it was the average. It was pretty hard to tell how anything stupid I did on the road affected me in the long run. I only saw my overall MPG drop hours later, and inevitably, too much later to make any sort of a connection.
In software development, we can benefit from this same miracle of constant feedback. Continuous integration shows us how the changes we make to our own code affect others’ code as soon as we commit. Not days later when we integrate, not weeks later when QA smoke tests everything, we find out immediately after we commit our code to the repository. Unit tests show us how the changes we made affect our own, and hopefully others’, code as soon as we write it. As soon as we make a change to the codebase we can run our entire suite of unit tests and know immediately whether we made things better or worse. Sure we could have done this before. A QA engineer would have identified when something went wrong when we threw it over the wall to them a few weeks alter. Failing that, one of our customers would have inevitably found it within the next year and would have been more than happy to let us know. And then, it would only be a matter of trudging back through the past year of code commits to try and figure out exactly when the problem was introduced and exactly what we did to cause it.
Constant feedback lets us identify problems as soon as they happen, fix them immediately, and most importantly learn what we did wrong so we can be sure to never repeat that mistake again as we move forward. By constantly becoming aware of our mistakes, we’re guaranteed that we’ll constantly improve.