Negative testing: every error code on demand

A test suite that only covers the happy path is testing the case that was never going to break. The catalog is built so every error is reachable on purpose: a guaranteed 500, a real rate limit, a teapot, and a fault injector that produces whatever you configure.

How to practise it

  1. Call the Pizza oven endpoint for a reliable 500 and verify your client retries, falls back, or reports it — but does not hang.
  2. Use the Fault Injection API to set a status code, a latency and a failure rate, then run your suite against it.
  3. Separate 400 from 422: one means the request was unreadable, the other that it was understood and refused.
  4. Separate 401 from 403, and 404 from 410. Each pair is routinely collapsed, and each collapse hides a real bug.
  5. Inject a malformed body and confirm your client reports a parse error rather than crashing.

APIs to try it on

Status codes involved

Other techniques

Getting started guide · All 37 mock REST APIs