Verifying what you do not control.
WHAT MAKES IT DIFFICULT
You cannot force their failures They change without notice Test environments differ from production Rate limits constrain testing
WHAT TO TEST AGAINST
Their test environment, where provided A substitute you control, for most tests
WHAT A SUBSTITUTE SHOULD REPRODUCE
Successful responses Every documented error Timeouts Malformed responses
WHY MALFORMED RESPONSES
Real systems return unexpected content, and handling must be verified.
WHAT TO TEST ABOUT YOUR HANDLING
Retry behaviour Timeout behaviour Behaviour when the response is unexpected Behaviour when the service is entirely unavailable
WHAT TO VERIFY ABOUT RETRIES
That they stop That they do not duplicate effects
WHAT CONTRACT TESTING PROVIDES
Detection when their interface changes.
WHAT TO RUN AGAINST THE REAL SERVICE
A small set, periodically, confirming the substitute remains accurate.
WHY THAT MATTERS
A substitute diverging from reality gives false confidence.
WHAT TO MONITOR IN PRODUCTION
Error rates from each dependency Response times Unexpected response shapes
WHAT TO ALERT ON
Changes in any of those, which indicate they changed something.