Educational Services Company Ensures Microservices Stability Using Contract Testing with the Pact Framework

CASE STUDY

Industry – Education

Location – India

Services Offered – QA consultation

MICROSERVICES CONTRACT TESTING CASE STUDY

Using Zuci’s microservices testing service, the leader in the global education services moved to API-first approach and consumer-driven testing to allow parallel work and decouple teams.

Our client is one of the leading global education services, helping people achieve their international education goals. The client has more than 70 offices spanning over 61 cities in India guiding students and their families through the entire study overseas process – university/course selection, submission of application, assistance with the visa process and pre-departure planning.

ABOUT CUSTOMER

PROBLEM STATEMENT

The company’s platform has been built using a microservices architecture, which means that each service is independently developed and deployed.
As the platform expanded, the company recognized the importance of designing efficient contracts in a consumer-driven manner to ensure effective communication among various services. Additionally, they needed to safeguard against changes in one service adversely affecting the functionality of another service.

Consumer-Driven Contracts: When designing an API, the syntax and semantics are designed by the API producer team in close collaboration with the teams that will consume the API, as opposed to the API producer team making assumptions based on the data model of how the API should look. The API consumer teams drive the shape of the APIs.

To prevent their mocks from becoming outdated and to meet their aggressive deadlines, the company has decided to test the API mocks by sending requests to both the mocks and the actual microservices. The client was in search of automated testing experts who could help them with these testing requirements and increase confidence that a new release of a microservice would not introduce breaking API changes in the production environment.

HOW ZUCI HELPED

The producer teams have designed APIs for consumption by other teams. To facilitate contract management between teams and enable parallel work, API mocks created by the API producers were shared with the API consumers.

Our team used the PACT framework to execute the contracts. Here’s an overview of the PACT test flow.

HOW ZUCI HELPED

HOW ZUCI HELPED

PACT (an acronym for People, Activities, Contexts, Technologies) is an open-source consumer-driven contract testing framework designed to test distributed systems. It is a code-first tool for testing HTTP and message integrations using an approach known as contract tests. A Pact test is designed to describe the agreed contract between one service and another from the perspective of the consumer.

We compared the responses to a contract definition of expected request/response pairs, as defined in a custom format specific to the company. This allowed us to verify that both the API mocks and the real service were up to date when compared to the latest definition of expected behavior outlined in the contract file.

This solution proved to be effective in removing the bottleneck of testing contracts, enabling the teams to shift their focus towards delivering features to customers.

BUSINESS OUTCOME

TECH STACK

ZUCI GIVES YOUR TEAM QA SUPERPOWERS

SO, YOU CAN SPEND TIME BUILDING YOUR PRODUCT,WITHOUT WORRYING ABOUT RELEASE SCHEDULES