Verifying Relationships: Consumer-Driven Contract Tests and Microservices thumbnail
A free account is required to view this content

Verifying Relationships: Consumer-Driven Contract Tests and Microservices

Microservice architecture brings many benefits but there is one potential pitfall when testing them. How do you model and test the many relationships between services? You could try integration tests but they are expensive to maintain, slow to run and come with orchestration complications.

Contract testing could help with this. But the traditional contract test has a circular problem. The team writing the service defines the contract and the test. As soon as this isn't kept up to date (only a matter of time) the test is useless.

A better approach is Consumer-Driven Contract testing. Here we use the output of contract tests owned by your consumers to test your API. This talk will introduce you to the Pact framework to write these tests and the key concepts. You will be able to avoid that integration test pack and have more time for other test activities in your team.

Thomas Shipley is a contract QA currently working with Equal Experts at John Lewis. He has experience across many different industries covering gaming, retail and big data. Previous companies include Microsoft, Just Eat and Datasift. Most recently he has been focused on API contract and performance testing. You can find out more at his blog https://tomdriven.dev


Comments

Sign in to comment
Explore MoT
MoTaCon 2026 image
Thu, 1 Oct
A tech conference to help you navigate the ever-shifting landscape of Quality Engineering, AI, Leadership, Product, Accessibility and Security.
Modern integration testing: Tools, techniques, and strategies for continuous quality image
Go beyond with modern integration testing—with faster feedback, simpler debugging, improved scalability and maintainability. Take the step to implement new test types including contract testing of course.
This Week in Quality image
Debrief the week in Quality via a community radio show hosted by Simon Tomes and members of the community
Subscribe to our newsletter