
Mathieu Cans
Biography
Convinced that collective responsibility for quality and continuous feedback are at the heart of the success of IT projects, I collaborate with teams to develop products by small increments
NewCrafts Paris 2025
We don’t need no (more) mock trouble
HandsOn
This is a hands-on lab with limited capacity.
π§ͺ Do you really enjoy writing tests with mocks?
Or maybe...
β‘οΈ You had a bug in production even though everything was tested?
β‘οΈ You have to change the test when you refactor?
β‘οΈ Youβre sometimes lost in mock setups?
β‘οΈ Integration with external services is source of bugs?
What if the real problem... were the mocks themselves? π
Johan Martinson and Mathieu Cans are proposing a simpler, more reliable alternative based on their experience:
π Simulators instead of mocks, validated by Adapter Contract Testing at architecture hexagonal boundaries.
π‘ The idea?
- hand-code a simulator that behaves like the real service or database.
- write integration test against the real service β thatβs our contract.
- use same test to validate the simulator.
Result: No more trouble ππ―π²ππ½
β
Robust, expressive, business-focused tests that stay close to reality.
π« No more production surprises because of a badly tuned mock.
π« No more incomprehensible tests.
π« No more unexpected behavior from dependencies.