API Testing · Senior · Question 35 of 75
How can traces from observability tools improve API tests?
- 1Replacing all assertions with a check that a trace exists
- 2Making the API faster by turning traces off in tests
- 3Asserting on internal calls, e.g. no N+1 queries or extra hops
Show the answer
Correct answer: Asserting on internal calls, e.g. no N+1 queries or extra hops
Explanation
Tests can read the trace of a request and check query counts or that a cache was hit, catching performance regressions early.