API Testing · Senior · Question 60 of 75

Why should API error codes, not messages, be what clients and tests rely on?

Show the answer

Correct answer: Messages change and get translated; codes stay stable

Explanation

Tests asserting exact message text break on every wording change. Stable machine-readable codes like ORDER_LIMIT_REACHED don't.

Further reading

Problem with a question

API Testing · Senior · question 60

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