R – Do you concentrate more on unit, integration or acceptance tests

acceptance-testingintegration-testingroiunit testing

Most gigs I end up at either have little or no unit tests. Typically what are described as the unit tests are actually integration tests and will be rarely run from the developers machine. I usually start my evangelism by preaching the difference between the two and try to get people to write very focussed unit tests and leave the integration tests for later, i.e. when enough people are writing unit tests that we can "move on" to writing the integration tests. Acceptance or system level tests are usually handled manually by the developer and then by the QA department.

My question is when working outside of an Agile environment, how much effort do you put into unit, integration and acceptance tests and what do you see the most value from?

Best Answer

I try to pound on unit tests from the beginning. I'm not the world's biggest TDD fan, but I really harp on unit tests. I don't think some magic fairy is going to ensure that integration testing is going to pass with flying colors because all of the unit tests work, but it gets pretty darn close.

As for acceptance testing, I'm not even going to look at something until I see the unit tests pass (or fail, if they are supposed to fail). I can't think of many cases that I'd accept a complete lack of unit tests. What if some core lib in the application updates?

Many will argue that unit tests are developer centric, they would be correct. However, a lack of unit tests is an indicator all on its own .. especially if the one doing acceptance tests happens to be a developer :)

Edit:

Integration tests are also important to me. We typically build things to a very tight spec .. when integration tests fail (after previously passing), its a strong indicator of scope creep. When that happens, someone needs to make some noise prior to just fixing it.