API Testing · Senior · Question 30 of 75

How can mocks of a dependency drift from reality, and how do you catch it?

Show the answer

Correct answer: The real API changes; verify mocks via contracts or scheduled runs

Explanation

A stub saying 200 while the real service now returns 201 hides integration bugs. Contract tests or scheduled checks against the real API keep stubs honest.

Further reading

Problem with a question

API Testing · Senior · question 30

Test yourself

Take the API Testing · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz