QA Fundamentals · Senior · Question 7 of 76
When does it make sense to have fewer unit tests and more integration tests?
- 1When the team doesn't know how to write unit tests
- 2When the code is a pure library of math functions
- 3When most risk lies in the interaction between components
Show the answer
Correct answer: When most risk lies in the interaction between components
Explanation
In a thin service that mostly glues a database and APIs together, unit tests mock everything and check little. Integration tests with real dependencies (containers) give more confidence.