API Testing · Senior · Question 54 of 75

Why include negative tests in API contract tests?

Show the answer

Correct answer: Clients rely on errors, like a 404 for missing items

Explanation

If a provider changes "not found" from 404 to 200 with null, consumers break. The contract should pin it down.

Further reading

Problem with a question

API Testing · Senior · question 54

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