Unit Testing: Don’t Ever Sacrifice It

I was reading this article at JavaWorld.com, where the author makes the argument that unit testing is a means to an end, and that once you are finished unit testing, you are not finished with the project. There are other types of testing to be done, integration testing in particular. While I agree that integration testing is hard and exposes flaws (not to mention poorly defined interfaces), it seems like the author is saying that in a resource-constrained project environment, unit testing may have to be dropped in favour of other types of testing (like integration testing).
My argument is: if your most basic units don’t function as intended, integration testing will fail anyway. So do not ever, ever, ever, sacrifice unit testing. It is fundamental.
To me, unit testing gives the project its first confidence boost: that the code works as designed. All of the code paths that can be reasonably testing work. Why ever sacrifice that?
What do you think?

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.