Wasted Unit Tests

I read a blog post entitled “Can Unit Testing Be A Waste” on AgileSoftwareDevelopment. It was written by pbielicki. He recommended you write unit tests at a high level of abstraction. Writing tests for getters and setters is a total waste of time. The goal of agile development is to eliminate waste. You should add tests just in time to verify functionality. You should also use common sense while choosing what to test.

One of the most interesting parts of the blog post was the many comments it received. For example, there was agreement that you need a coverage tool to even know where you stand with unit testing. There was emphasis on the goal of unit testing being a quality product. Another goal is to satisfy the customer.
Here on my project we are supposed to do unit testing. For the most part there is some level of unit test. Previously we had implemented a system of peer review to ensure there was adequate documentation of the unit tests. The peer review also ensured there was enough coverage for the unit test cases. However we have recently stopped performing such peer reviews. This is unfortunate. And I think it is starting to show in the quality of the code we are producing.

I am certain we are not wasting time on unit testing. We try to determine the minimal set of tests that will ensure something we code actually works. Our team borders on the side of too little when developing unit tests. Like many developers, we do not particularly like unit testing. I do it because I like it even less when I ship out very buggy code. That only creates a whole new set of worse problems. My company works on a maintenance contract where we get penalized when there are a lot of bugs shipped out to production. So this is a dollar and cents type of issue.

My manager has said that we have a documented peer review plan. The real problem is that I have never seen it. Thus it is truly not a priority. Yeah if I banged on doors and made a big deal about it, somebody would finally find me a copy of the thing. However it would be worthless if nobody is following it. Ouch. Get ready for a rough ride guys.