The Recommended Pattern for Testing for API Changes

Design and Build Great Web APIs — by Mike Amundsen (90 / 127)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 The Three Rules for Safely Mo difying APIs | TOC | The Process for Safely Deploying A PIs 👉

Applying the three rules for modifying APIs starts at the design phase of your API update. It’s important you take the time to review all the requested changes before moving forward to make your API modifications. Then it’s important to implement those design changes faithfully. You also need to validate that your changes won’t break existing API consumers.

Validating API changes involves a few steps:

  1. Asking yourself, “Who is using your API?”
  2. Validating your API changes with existing tests
  3. Confirming your API changes with new, stand-alone tests

Who Is Using Your API?

This can be a tricky business since you don’t always have access to all the API consumer apps or the teams that build them. Within a single organization, you might be able to inspect all the API consumer source code and check for problems.

But if your API is used by external partners, you may only be able to tell them to do their own inspections to confirm your changes are safe. Also, in cases where your API is available on the open web, you may not even know who’s using the API and won’t be able to contact them directly.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.