Ditto Post: Unit Tests Are Overrated

Over at, Krzysztof Kozmic has a great post about testing, and how (paraphrasing) integration tests are more valuable than unit tests.

“At the end, let me share a secret with you – Windsor, has very few unit tests. Most tests there are (and we have close to 1000 of them) exercise entire container with no part stubbed out in simulations of real life scenarios. And that works exceptionally well for us, and lets us cover broad range of functionality from the perspective of someone who is actually using the container in their real application.”

I agree with this, and it is something that really hit home on my most recent large project (more on that in a bit). 

Check it out.

posted on Monday, February 28, 2011 6:42 PM Print
# re: Ditto Post: Unit Tests Are Overrated
Steve Gentile
3/1/2011 10:02 AM
I don't know - even the best of us make mistakes and need to write up TDD type tests.

It's all part of building up the software and validating the steps, making sure you've covered different aspects of the code.

Integration tests also are important. I don't really see why we must rate one better than the other, they are doing and accomplishing different things.

Tests can provide more than just 'code coverage' - perhaps that is his point - not sure. Tests can help document and show how pieces of the internal code works. In the case of some OSS like Windsor, I would hope they also help provide red flags to those coming into a new code base where they might not understand how a piece of the software works.

I could see arguing more for a BDD vs. a TDD, but to think we are just testing the public API points without concern of the internals can be dangerous ground. I think with BDD your getting more of a taste of the process itself. So that area is interesting - if I could have it my way, there would be unit tests, BDD tests, and integration tests all working hand in hand :)

I sure hope other engineering professions test their products - imagine a roller coaster engineer saying 'no need to test the cable strength and chains, as long as the coaster runs through some loops on the tracks it must be ok' - just hope 3 years from now they don't have some maintenance guy do some 'cost reductions' and put in invalid cables :)

I see sort of his point, but it smacks a bit of arrogance to me that we can think we can build this solid code base just through integration tests. To me, we need both. Good code base should have unit and integration tests - and each is equally important.
# re: Ditto Post: Unit Tests Are Overrated
3/1/2011 8:23 PM

I can see where we need BDD tests and integration tests, but I don't see what any TDD tests can add value wise, except for true DDD style tests.

If your app works, using only scenarios that BDD and integration tests validate, what value do unit tests provide? Tests of future inputs?

I understand the 'ideal' that unit tests can help document code, but I don't see that ideal actually played out much. YMMV.

Post Comment

Title *
Name *
Comment *  
Please add 3 and 3 and type the answer here: