Thursday, April 21, 2011

Unit Testing a Waste of Time?

A Linked-In user recently posted the following question:

How much time do you spend debugging? How much time do you spend dealing with software bugs? Is debugging something that bothers you and wastes your time, or not much of a concern?

Well, I have to admit I'm VERY anal when it comes to unit testing code, and am just as vehement (OK...sometimes a jerk) when it comes to my teams regarding unit testing before it gets sent out. I have known some developers who make a quick change and then check their code in before even running it through a "smoke test". They feel like the change is too minimal, or it is so minor that "nothing can break from this"...well...we all know what ASSUME means (ASS-U-ME).

I am NOT a TDD biggot. But, I truly think that the time spent up front to go through as many possible scenarios as possible (and more) will pay big dividends in the long run. Yes, I admit that I don't code as quickly as some because of that, but for the most part, I'm not going back a month later fixing some stupid bug that reared its ugly head because I was careless.

Regarding the question - "does it bother me or waste my time?" - absolutely not...that is part of the job, and if a developer doesn't like that part, then they may need to re-evaluate their line of work. Debugging is part of coding - part of the solution finding. And ultimately, when we DO find the solution - one of the sources of satisfaction behind our craft.

0 comments:

Post a Comment