Security Architecture

Every microservice passes its own unit tests, but in staging the order service fails when calling the payment service because their API field formats differ. Which test type should have caught this?

Show the answer

Correct answerB. Integration testing

AWhy not this: Regression testing checks that earlier behavior still works after a change, not a new cross-service interface mismatch.

BWhy this is right: it exercises the interface between services and exposes mismatched data formats.

CWhy not this: Unit tests isolate one component, which is why each service passed while their interface was broken.

DWhy not this: Canary testing watches a release on live traffic; it is not the pre-release check of service interfaces.

Integration testing verifies that separately built components exchange data and interact correctly across their interfaces, which is where this format mismatch appears. Unit tests check each component in isolation and so pass despite the mismatch.