Thursday, March 3, 2011

Is Automated Testing Making Us Lazy?

I had an interesting moment at work this morning. I needed to make a low-level change in a complex text processing application that I've been developing for several months. In the old days, I would have studied the affected code and tried to reason out the consequences of the change. Once I had convinced myself that the change was safe, I would have made it, then followed up with some manual testing. It might have taken a couple of hours, and I might have missed something.

Today it took five minutes, because I have dozens of automated tests in place, unit and functional, providing very good code coverage. So I didn't spend any time checking the code. I just made the change and ran the tests, and let them tell me whether the change was safe. (It was.)

This feels a little strange. It means I don't have to know my code as intimately as I used to. I'm giving up some control, and that freaks me. OTOH I'm a believer in letting the machine do the work. And, of course, from my client's point of view, it's a huge win - much greater productivity with the same result.

I think the widespread adoption of automated testing is the best thing to happen to software development in the last ten years. But I feel like I'm stepping off a cliff. Is this dangerous the same way that modern IDE's, with their powerful autocompletion capabilities, are dangerous, because they let mediocre developers ignore the documentation?

Or is this simply an added benefit of automated testing? I can produce more reliable software more quickly, and I'm free to let go of some of the details. I think I can get used to that.

No comments:

Post a Comment