Beware the Integrated Tests Scam (was Integrated Tests Are a Scam)
UPDATE. It’s 2023 and although I still broadly agree with the content of this article, I don’t like the style of it any more. I find it too abrasive and judgmental. I’m sorry about that.
I leave this article here because I’m not ready to rewrite it just yet. I almost certainly will, although I haven’t decided when to do that. In the meantime, I’ve changed the title of this post to reflect my current thinking, even though I imagine that many readers will always refer to think as “Integrated (even Integration!) Tests Are A Scam”. Popular names change slowly; I don’t mind.
Integrated tests won’t kill you, although the scam remains a problem. Nowadays it has become worse as many distributed “microservices” architectures exhibit the same symptoms while adding the cost of having published APIs, thereby restricting their ability to refactor. If you thought refactoring with mock objects was hard…!
I don’t hate integrated tests, but neither do I trust them. The theatrics in this article came at a time when I thought I needed to yell loudly and provocatively in order for people to listen. I wanted to capture their attention and I was playing around with some marketing/branding ideas. I don’t want to rewrite history, but rest assured that I present these ideas with a much more moderate tone these days.
In other words, please don’t let the abrasive and judgmental tone get in the way of whichever good ideas are still in here. One day I’ll find the energy to write this again from the beginning in a style that reflects the more-moderate me. But the integrated tests scam will almost certainly still be a problem, whenever I finally sit down to do that. I still believe that.
On March 1, 2010 I changed the phrase “integration tests” to “integrated tests” in this article.
Integrated tests are a scam—a self-replicating virus that threatens to infect your code base, your project, and your team with endless pain and suffering.
Wait… what?
Integrated tests pose a significant risk to the health of your code base. If you’re not careful, accumulating integrated tests will gradually suffocate your code base, driving you to a place where you have to decide whether it woul