“Easy Microservice Testing” – Specmatic featured on Continuous Delivery channel

Share this page

Why Contract Testing is important for microservices

Dave Farley is a respected author and widely recognised proponent of Continuous Delivery. In this video on his Continuous Delivery YouTube channel he discusses why Contract Testing is important for microservices.

Contract Tests are important because microservices architecture involves breaking down a system into independently deployable units of software developed by different teams. Each microservice has its own responsibilities and may communicate with other microservices to fulfill a larger system’s functionality.

In such a distributed system, it becomes crucial to ensure that the different microservices are compatible with each other and work together seamlessly. By using Contract Testing, teams can define and specify the contracts or interfaces between microservices. These contracts outline how the microservices should interact, including the data formats, communication protocols, and expected behaviors.

Contract Testing allows each microservice team to test their changes independently, based on the defined contracts, without the need for extensive integration testing involving all microservices. This decoupling of teams and testing efforts helps to speed up development and allows teams to work more independently.

Additionally, Contract Testing helps ensure backward compatibility when making changes to microservices. It allows teams to validate their changes against previous versions of the contracts to ensure that they are not breaking the contracts and causing compatibility issues with other microservices.

In summary, Contract Testing is important for microservices because it enables teams to independently test their changes, ensures compatibility between microservices, and helps maintain backward compatibility when making changes to the system.

Dave Farley identifies the following benefits of using Specmatic for Contract Testing:

  1. Contract Testing: Specmatic helps address the challenge of evaluating and ensuring the compatibility and correctness of independently deployable units of software (microservices) developed by different teams. It allows teams to determine the releasability of their changes independently without testing them with everyone else’s changes before release.
  2. Central Contract Repository: Specmatic enables the storage of contracts, which define the interactions between producers and consumers of services, in a central repository. This allows for easy comparison between different versions of contracts to determine their compatibility and prevent merging of broken or non-backwards compatible contracts.
  3. Zero-Code Approach: Specmatic offers a zero-code approach to contract testing for many use cases. By specifying contracts in a supported Interface Description Language (IDL) such as OpenAPI, Specmatic can automatically check compatibility, generate contract tests, and generate contract testing stubs that simulate an implementation of the contract for testing purposes.
  4. Decoupling of Teams: With Specmatic, teams can work independently and prioritize their work according to their own requirements. Each team can make progress without being tightly coupled to other teams, reducing dependencies and increasing the speed of development.
  5. Automation: Specmatic allows for automation of contract testing and adherence to contracts. Since contracts are clearly defined and specified in software, validating adherence to those contracts becomes a simpler task that can be automated, improving efficiency and reliability of the testing process.
  6. Potential for Further Development: Specmatic could potentially open the door for more support in facilitating coordination of work between teams without increasing coupling. For example, managing the parallel use of deprecated APIs could be a potential area of development.

Get started with Specmatic. Download it here.

Related Posts

Specmatic vs WireMock

By Hari Krishnan

Comparison: Specmatic vs WireMock

API mocking is only effective if the mocks are truly representative of the provider / services they are emulating. Deviations between mocks and providers can
Read More
Specmatic vs Pact & Pactflow comparison

By Hari Krishnan

Comparison: Specmatic vs Pact.io and Pactflow.io

Specmatic and Contract Driven Development differ significantly from Pact. We built Specmatic out of our own necessity where Pact did not fit the bill for
Read More

By Naresh Jain

Contract Testing using OpenAPI Specs as Executable Contracts

Demonstration video showing OpenAPI specifications being leveraged as executable contracts with Specmatic Sample projects with OpenAPI https://docs.specmatic.io/sample_projects.html#openapi
Read More
Contract Testing with Specmatic - Markus Oberlehner

Stubbing an HTTP end-point with Specmatic

Markus Oberlehner gives a brief overview on the topic of Contract Testing with Specmatic and his experience using it for stubbing an HTTP end-point.
Read More

By Joel Rosario

TMForum ODA CTK API specification conformance testing with Specmatic

We recently discovered some major issues with the TMForum Conformance Test Kit (CTK) v5.0.0 and will demonstrate how using Specmatic can address these problems.
Read More
Specmatic API Coverage Report

Early detection of mismatches between your API specs and implementation: Exploring Specmatic’s API Coverage Report

Specmatic’s API coverage report helps identify any mismatches between an OpenAPI specification and an application's endpoints early in the development lifecycle. The report lists all
Read More
JDBC stubbing with Redis and Specmatic contract testing.

Break the Chains of Database Dependencies: Leveraging Specmatic for JDBC Stubbing

With Specmatic JDBC stub, you can easily test APIs without the need for a complex database setup. By switching out the real database with a
Read More

JMS Mocking with AsyncAPI using Specmatic

The JMS mock is wire compatible and can be controlled entirely from within the test. This means you can run the test locally or also
Read More
Specmatic + Kafka demo video thumbnail

Kafka Mocking with AsyncAPI using Specmatic

The Specmatic Kafka mock is wire compatible and entirely within the control of the test, the test can run locally and in CI and deliver
Read More
Redis stubing - specmatic contact development with contract testing.

Redis Stubbing with Specmatic Contract Testing

Instead of using an actual instance of Redis, we'll stub it out and have the contract test set expectations so that the Redis stub knows
Read More