What is contract testing, and why is it important in microservices?
Short answer: Contract testing is a type of testing used to ensure that the interaction between two microservices (provider and consumer) conforms to an agreed-upon contract. This contract defines the expected request and response formats, ensuring that both services can communicate correctly, even when developed independently. Importance in Microservices:
Real-world example (ShopNest)
ShopNest splits Catalog, Cart, Order, and Payment into services so teams can deploy catalog changes without redeploying payments.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png