Mocks let your integration test pass for the wrong reason
My integration test passed run after run before I caught it lying.
The test registered a new capability into the router at runtime and checked that routing would eventually pick it. Reasonable. Green every time I ran it. I trusted it. Then I actually read the loop and saw it sent the same task string every single iteration. My scorer was deterministic, it hashed the task and indexed into the capability list, so one fixed string mapped to one fixed slot, and the new capability sat at a slot that string could never reach. The thing the test claimed to exercise was structurally unreachable. The assertion passed anyway, because every iteration landed on something registered, which was all the weak check demanded.
The unit tests for these pieces were all green too. Of course they were. Unit tests test a function. The bug was not in any function, it was in the seam, the router quietly assuming something the registry never promised. That is the most common failure in any multi-module system, not "X has wrong logic" but "X works fine and Y expected a different shape," or "A only works if B was set up first."
Mocks are built to hide exactly this. A mock returns what you told it to and never enforces the real interface, never cares about argument order, never notices a type drift. Mock the registry and the scorer and your test passes whether or not the real ones agree with each other.
So I stopped mocking the things I was testing the seam between. A real in-memory registry, a real scorer, the full route-score-record path wired together, and assertions on what actually happened, the returned capability really exists, the history grew by exactly one, that entry records the task and the choice truly made. The fix to the original bug was one line, vary the task strings so the hash spreads across every slot. Then it could fail when the feature broke, which is the only reason a test earns its checkmark.
If your integration test never met your real dependencies, it is not testing integration. It is testing your mocks, and your mocks always agree with you.
Part of a series. Start here: A green test suite proves less than you think