Intermediate
Software Testing & QA
Q44 / 100
What is the difference between a "mock" and a "stub"?
Correct! Well done.
Incorrect.
The correct answer is B) A stub provides predetermined responses to calls; a mock additionally allows verification that specific interactions occurred
B
Correct Answer
A stub provides predetermined responses to calls; a mock additionally allows verification that specific interactions occurred
Explanation
Stubs return canned answers without caring how they are called; mocks go further by asserting that expected calls were made with expected arguments.
Progress
44/100