Intermediate
Software Testing & QA
Q43 / 100
What is a "mock object" used for in unit testing?
Correct! Well done.
Incorrect.
The correct answer is A) To replace a real dependency with a controllable substitute that can simulate behavior and verify interactions
A
Correct Answer
To replace a real dependency with a controllable substitute that can simulate behavior and verify interactions
Explanation
Mocks simulate the behavior of real objects (e.g. an API client) and let tests verify that certain interactions occurred, isolating the unit under test.
Progress
43/100