Backward Compatibility & Contract Testing — Concept Check
Questions on Backward Compatibility & Contract Testing. Consumer-Driven Contract Testing (Pact) verifies that provider APIs remain compatible with consumer expectations, catching breaking changes before they reach production.
Questions in this quiz
8 questions on Backward Compatibility & Contract Testing — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.Service A (consumer) relies on Service B (provider). If Service B changes its API response format, what ensures Service A is not broken in production?
- AIgnoring changes until an issue arises
- BSchema evolution with Avro
- CConsumer-Driven Contract Testing (CDCT) with Pact
- DManual testing after deployment
2.A consumer service has defined a Pact contract expecting a 'quantity' field in the provider's response. The provider removes this field. What happens during CI?
- AThe consumer automatically adapts to the change
- BThe provider's CI pipeline fails verification
- CThe provider's CI pipeline passes without issues
- DThe change goes unnoticed until production
3.Why is it important to publish contract verification results to the Pact Broker in a CI pipeline?
- ATo ensure all stakeholders are informed of compatibility
- BTo skip manual testing
- CTo allow consumers to change contracts without notice
- DTo automatically deploy the provider service
4.A developer believes that adding a required field to an Avro schema is backward compatible. Why is this incorrect?
- AThe schema registry automatically resolves such changes
- BRequired fields are ignored in backward compatibility
- CAdding required fields breaks backward compatibility
- DOptional fields break backward compatibility
5.In a microservice architecture, what role does the Pact Broker play in contract testing?
- AExecutes tests on behalf of the provider
- BAutomatically updates contracts for consumers
- CServes as a database for microservice configurations
- DStores and shares contracts between consumers and providers
6.What is a common misunderstanding about schema evolution in event-driven systems?
- AFull compatibility prohibits any schema changes
- BBackward compatibility requires fields to be optional
- CBackward compatibility allows adding optional fields
- DForward compatibility allows removing fields
7.A provider service fails a contract verification test because it changed a response field type. What is the likely cause?
- AThe contract expected a specific field type
- BThe provider's CI pipeline is misconfigured
- CThe consumer service is outdated
- DThe Pact Broker is down
8.What is the primary goal of Consumer-Driven Contract Testing (CDCT)?
- ATo automate deployment processes
- BTo ensure provider APIs remain compatible with consumer expectations
- CTo eliminate the need for any manual testing
- DTo enforce strict schema rules on all services