Recall & Review
beginner
What is contract testing in microservices?
Contract testing ensures that two services (like a client and a server) agree on how they communicate. It checks the 'contract' or agreement between them to avoid integration errors.
Click to reveal answer
beginner
What role does Pact play in contract testing?
Pact is a tool that helps create and verify contracts between services. It lets the client define expectations and the server verify them, ensuring both sides match their communication.
Click to reveal answer
intermediate
How does Pact improve microservices integration?
Pact catches mismatches early by testing interactions before deployment. This reduces bugs caused by changes in one service breaking another, making integration safer and faster.
Click to reveal answer
intermediate
What are the main components of a Pact contract?
A Pact contract includes the expected requests from the client and the expected responses from the server. It describes the interaction details like HTTP method, path, headers, and body.
Click to reveal answer
intermediate
Why is contract testing preferred over end-to-end testing in microservices?
Contract testing is faster and more focused. It tests only the communication between two services, not the whole system, making it easier to find and fix issues early.
Click to reveal answer
What does a Pact contract primarily verify?
✗ Incorrect
Pact contracts verify the communication agreement between client and server to ensure they interact correctly.
Who typically creates the Pact contract in contract testing?
✗ Incorrect
The client service defines the expected requests and responses, creating the Pact contract.
What is a key benefit of using Pact in microservices?
✗ Incorrect
Pact helps detect communication mismatches early, preventing integration errors.
Which of these is NOT part of a Pact contract?
✗ Incorrect
User interface layout is unrelated to Pact contracts, which focus on request and response details.
Why might contract testing be preferred over full end-to-end testing?
✗ Incorrect
Contract testing is faster and focuses on communication between services, making it easier to find issues.
Explain how Pact helps ensure reliable communication between microservices.
Think about how two friends agree on a plan before meeting.
You got /4 concepts.
Describe the main differences between contract testing and end-to-end testing in microservices.
Compare checking a single conversation versus watching a whole play.
You got /4 concepts.