We don’t need no (more) mock trouble

HandsOn

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.

Prerequisites

  • Solid understanding of unit testing
  • Participants will use their own laptop with Docker working and Either TypeScript+Node, Java or Python
  • Knowledge of TDD and hexagonal architecture can be helpful
  • Clone https://github.com/adapter-contract-testing/snail-race-kata and follow the requirements in the README of the chosen language.

Speakers

Johan Martinsson

Johan Martinsson

Passionate about code design
Mathieu Cans

Mathieu Cans

Orange, Software engineer
}
Shape
Shape

Supporting

 

ConfBuddy

Diversity Charter



Code of Conduct

Our goal is to create a safe and welcoming environment for all participants. We use the Aardling Code of Conduct. All participants including staff, sponsors, and speakers, must adhere to this.

Read the Aardling Code of Conduct.