.NET Zone is brought to you in partnership with:

I’ve been a Windows developer since 3.0 and caught the Visual Basic wave early with v1. I’ve released a “production” application in every version of VB since then (except VB for DOS). Focusing on enterprise, line-of-business development I’ve built Call Center Applications, Mortgage finance systems, Customer Relationship Management tools and more recently I’ve been in the Litigation Support/Electronic Data Discovery/Electronically Stored Information space. Greg is a DZone MVB and is not an employee of DZone and has posted 436 posts at DZone. You can read more from them at their website. View Full User Profile

"Why I Hate Unit Testing"

05.19.2012
| 2218 views |
  • submit to reddit

The Telerik Blogs - Why I Hate Unit Testing

"So you went to work for the cool company that wooed you with promises of cutting edge technologies and techniques. In the interview, they told you that they are agile and unit test everything. You may or may not have been in an agile environment before, but the important thing you are enthusiastic about joining a team that truly gets software development. You tested on your previous job, even using JustMock to write better tests. You promise you can be agile yourself and quickly adopt their practices. You’re immediately hired.

Many of you have been there… maybe you’re there right now.

It takes a few days to receive your workstation, and you find most of the development software isn’t set up. A coworker gives you the instructions, and by the end of the day you find yourself still struggling to connect to the version control server.

The next day, you ask your manager about your problem. It turns out that the person in charge of the version control and build servers left a few months back; you’re the replacement. Further inquiries lead to a startling truth: no one has administrative access.

...

Don’t Hate the Game, Hate the Player

If you have entered a company with poor unit testing practices, you will likely encounter other problems. Many practices and methodologies follow each other, and improper implementation for one item may encourage improper implementation in another. Many companies are successful with different practices in place, and none of this is one-size-fits-all. Steve Forte and Joel Semeniuk have a great presentation on this called The Agile Buffet Table. The most important thing is to regularly analyze your practices and determine if revision is necessary or if everything is okay. And please, realize it’s bad if no one has administrative access to your source control system!

Unit testing is great when done right, and it’s even good when done in a lax manner. However, it’s better to have no unit tests than terrible unit tests.

I hate unit testing done poorly.

image..."

The sad thing is that this could have been a true story (and probably was as it just rings too true doesn't it?). That said, I liked how it provided some great, fairly vendor independent, guidance if you're in this kind of boat.

Published at DZone with permission of Greg Duncan, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)