If it’s wrong, I don’t want to be right
We all have vices. Software engineers typically have more of them than the average guy. (I don’t really know that for sure, but it seems true intuitively, and it’s fun to say.) Some vices, as we all know, are more or less socially acceptable, especially if we make adequate attempts to conceal them. My ex-girlfriend’s father would sneak to the garage to smoke cigarettes. I didn’t realize he did that until someone told me during a family get-together many years after I met him. And I don’t care that you’re a 37-year-old Lego aficionado, as long as you keep that secret locked away in a closet like the rest of us self-respecting gentlemen. And, let’s face it, YouPorn.com (98th most popular site in the US) isn’t more popular than Catholic.com (6,198th most popular site in the US) for any reason other than the obvious one: you people are messed up.
I’m investigating Test-Driven Development 1, and the phrase deserves capital letters because I’m currently reading a book about test-driven JavaScript development, which only happens in places where Test-Driven Development–the big, corporate kind–is celebrated. To understand how I feel about this, let me share a previous experience. I was once asked how I might solve a problem for a large development team who had achieved 98% code coverage. They had had reasonable success, maintained average (not enviable) quality, but were beginning to miss deployment deadlines as marketing had gained control and began to push for features. The summary of their problem, neatly delivered, beckoned for the reply, “Why, you should push back on Marketing, and [insert whatever software engineering people say here].” Of course, I said, “I recommend you stop wasting time on tests, welcome a trivial decrease in quality, and get back to spending 37 of your 39-hour work weeks writing actual code”. Imagine that, I proposed writing actual code to deliver actual features.
Today, I ran this: js-test-driver – Remote javascript console – Google Project Hosting . And, you know what? It felt good. It felt really, really good. I immediately heard the siren song luring me to the island of non-stop, self-executing, regression-, integration-, just-make-it-up-as-we-go-because-it-feels-so-good-and-reassuring-testing. That went on for about 25 minutes until I looked at my watch and realized I had accomplished nothing. It’s really easy to get a temporary feeling of pleasure and productivity from that activity though, and I had to stop and remind myself how idiotic it sounds to suggest that it’s too hard to just write code, so we should write some code to help us write code.
While I would never make the case that no code should ever be tested 2, I do think the software engineering culture is at the far (and unhealthy) end of the continuum. Like smoking, or legos, or your while-the-wife-is-out-shopping Internet activity, it would be better for all concerned if you enjoyed this sort of thing more privately.
Footnotes
1 By investigating, I don’t mean to say I’m learning it for the first time. Having written code as an application-tier developer at a big solution company and as a UI developer at a big digital agency, I maintain two paradigms, one of which has required me to do various-phase-unit-testing-type activities within certain contexts. I mean to say I’m investigating it the way you might research any political party that opposes yours before, say, a big election.
2 I blame Kent Beck. He could’ve done more to prevent this nonsense from happening by issuing some sort of warning, like the text that appears before a JackAss video.
