What is contract testing?

Contract testing is a technique for testing software application integrations. It ensures that a pair of applications will work correctly together by checking each application in isolation to ensure the messages it sends or receives conform to a shared understanding that is documented in a "contract".

The parties involved in a contract are called the "consumer" (the application that makes use of the functionality or data of the other) and the "provider" (the application that provides functionality or data for the other application to use).

Contract testing can be used to test any type of software integration, however, its increased relevance and usage over the last few years has been primarily driven by the rise in popularity of HTTP and messaging microservices.

Contracts a typically either "provider driven" (where the team responsible for the provider application maintains and shares the contract with its consumers) or "consumer driven" (where the teams responsible for the consumers maintain and share the contracts).

arrow-up icon