Engineer for the future of Cloud
June 10-13, 2019
San Jose, CA

Testing microservices with consumer-driven contracts

3:05pm3:50pm Thursday, June 13, 2019
Average rating: ****.
(4.00, 5 ratings)

Who is this presentation for?

  • Architects and developers who work with microservices



Prerequisite knowledge

  • Basic knowledge of microservices architectures

What you'll learn

  • Learn consumer-driven contract testing, which helps microservices be independently testable and releasable


Unlike a monolith, which is an independently deployable unit that can be tested as a whole, microservices are a distributed system, composed of many services that can be tested and deployed independently of each other. While this approach has many advantages, from a testing perspective it can actually make things harder. How do I know the impact of changing or deploying a microservice on other microservices that may depend on it?

Andrew Morgan looks in depth at some common microservices testing anti-patterns and then introduces a testing technique named consumer-driven contract (CDC) testing as a way to mitigate them. Some of the problems you’ll be looking at are building and end-to-end testing microservices like a monolith, the “distributed monolith” anti-pattern, and unit tests that are heavily reliant on stubs of other microservices that may be inaccurate or stale. CDC is a TDD at the API level approach to microservices. Andrew walks you through the concept end to end, explaining how it can be used to help guarantee that both message-driven and API-driven interactions between microservices will work without end-to-end testing, provide a fast and reliable feedback loop for microservices development, and deliver independently testable and releasable microservices.


Andrew MorganAndrew Morgan is an independent consultant, currently focusing on architecture and design, microservices, and continuous delivery. He has experience working with many different types of organizations, primarily in development and operations roles. He’s also involved in the wider technology community, contributing to a number of open source projects, presenting at international conferences, writing for InfoQ, and is soon to become a Pluralsight author.