API Testing · Senior · Question 1 of 75
How should API tests be split across levels for a microservice?
- 1Mostly end-to-end tests through the UI, since they cover everything
- 2Many unit and component tests, contracts between services, few E2E flows
- 3Only manual Postman checks before each release of the service
Show the answer
Correct answer: Many unit and component tests, contracts between services, few E2E flows
Explanation
Component tests run the service with stubbed dependencies and cover logic fast. Contracts guard integrations; a handful of E2E flows prove the whole system works.