3. www.spanishtestacademy.com
AGENDA
• Monolith vs microservices
• Traditional model of testing and its challenges in
distributed systems
• Consumer driven contract testing with PACT
• A real life example in action
• Post deployment verification
• Safe rollouts
4. www.spanishtestacademy.com
CLASS PRE-REQUISITES
• Have a local copy of https://github.com/vilacides/
contractTestingExample updated to the latest version
• Java 8 and Maven 3.9
• Have an IDE configured to run maven projects/terminal
• Basic Java knowledge
10. www.spanishtestacademy.com
ENDTO ENDTESTS
• In the monolith
◦ Slow
◦ Unreliable
◦ Difficult to maintain
◦ Difficult to debug
◦ Test real integration end to end
by spinning up the one thing
• In distributed systems
◦ Slow
◦ Even more unreliable
◦ Difficult to maintain
◦ Difficult to debug
◦ Test real integration end to end
by spinning up N things
11. www.spanishtestacademy.com
UNIT AND INTEGRATIONTESTS
• In the monolith
◦ Fast
◦ Reliable
◦ Easy to maintain
◦ Easy to debug
◦ They do not test the real
integrations, they are based on
assumptions
• In distributed systems
◦ Not that fast integration tests
◦ Not that reliable
◦ Easy to maintain
◦ Easy to debug
◦ Require to mock several
services, they are based on
assumptions
24. www.spanishtestacademy.com
CONTRACTTESTING WITH PACT
• What is PACT good for?
◦ End to end integration testing
that is fast and reliable
◦ All the things API!
• What PACT doesn’t replace
◦ Testing that performs UI
interactions
26. www.spanishtestacademy.com
RESHAPINGTHE PYRAMID
• We have reduced the need of end to end tests
• We ultimately want to go fast without breaking things, but
things will break so you priority becomes to be the first one
to know that things went wrong in production
38. www.spanishtestacademy.com
FEATURE FLAGS
• What FF are good for
◦ Experimentation
◦ Safe rollouts and rollbacks
• When FF get tricky
◦ Handling different combinations
◦ Features that require schema
changes in databases
43. www.spanishtestacademy.com
WHAT WE LEARNT
• Focus on integrations between consumers and providers
and have strong defined contracts
• If something goes wrong in production you want to be the
first one to know
• Reduce the surface of customer that get your changes