Roots of the mock trauma in a Flash
Published by Manuel Rivero on 26/04/2026
Roots of the mock trauma.
- The problem is usually caused by either:
- Design problems in production code
- Procedural code or code with too many responsibilities.
- Weak interfaces (with high probability to be changed):
- Wrong level of abstraction.
- Responsibility smells.
- Data smells.
- A misuse of test doubles, as we saw, using them when we shouldn’t:
- the misconception of thinking the class is the unit (probably responsible of most of the mock-trauma).
- using test doubles for value objects.
- using test doubles for internals.
- using test doubles for types we don’t own.
- Design problems in production code
We think that instead of blaming test doubles, we need to learn to:
- Design better.
- Use the tool better.