Integration Tests Or Unit Tests – Your Call

I don’t know what started all these discussions in a single week. There’s Ayende’s, Dror‘s and also Daniel Mayer, which goes in even more details about what a unit test is and what an integration test is and is not. So A bit more from me.

While numbers count (pun intended), just a reminder: It all comes down to what you do with them. If your unit tests are quick, but you don’t run them all the time, you’re missing the point. If you run all your tests, including long integration tests, you’re probably hurting your productivity.

Start with what you’re comfortable with. If you care about your code, run all the tests that you can, as many times as possible, without hurting your productivity. Everything else – you can run automatically at night, and review the result in the morning. It can lead to related concrete decisions: If you running unit tests all the time, and the integration tests at night, it might make sense to separate the tests to different assemblies.

Eventually, it comes down to what works for you, numbers be damned.