intermediate·8 min read·Updated

Regression Testing in API: What Does a Change Touch?

Regression testing means rerunning what a change touches, and nothing else. Import a newer specification, read what it touches before anyone approves it, run only the affected tests, clear the notes on a mock and a load test, and find the change again later.

This is lesson 9.24, part 2, of Shift-Left API in Depth, the product track of the learning center. Part 1 answered what changed. Now you ask what that change touches, and run only that. What a change touches, the affected-tests run and the notes it leaves need no add-on. Approving a change comes with Professional, the 15-day trial and Enterprise.

What does regression testing in an API mean for one change?

Regression testing in an API release means rerunning what a change touches, and nothing else. Rerunning everything is slow, and rerunning nothing is a gamble. The way out is knowing which tests, mocks, workflows and load tests depend on the operations that changed.

What does a change touch, and who does what?

When you import a newer version of a specification, the review shows each changed operation and, beside it, what depends on it: tests, workflows, mocks and load tests. Shift-Left API does the looking. A person does the deciding: they choose the environment, confirm the run and approve the change. Looking never runs anything.

How do you read what a change touches?

In a project, open Endpoints, then Upload File and import the newer file. The Review API Changes summary opens, as in lesson 9.3, and scrolling down shows what the change touches. In the video the new version is a changed copy of the store spec, so a few operations change and the rest of the 38 stay as they were.

How do you run only what it affects, then approve?

Under Run on, choose an environment. It must not be production, because the run sends real requests. Press the button that runs the affected tests (five of them in the video), and confirm. In the video all five pass, because a specification file doesn't change the live sandbox. With a real change, a break would show here, before you approve.

Then press Approve & Import. The change is imported, and nobody had to run the whole suite to find out it was safe.

What do you see afterwards on one API?

Open the API's Overview and find the operation by name or path. Its Changes tab keeps what was decided: what changed, and when. That is the project's memory for that one API.

How do you clear what the change flagged?

A change can leave notes on things that depend on the old shape. Open Mocks and the mock for a changed operation says so: press I've checked it when you have looked, and the note clears. On Performance, a load test that uses a changed operation gets the same kind of note, cleared with I have looked. The load test itself needs the Performance testing add-on. Nothing is edited behind your back; the note only asks for a look.

Where do you find the change again?

Open Discovery, then Changes, then Timeline. The Timeline lists the changes with the project's record. Tick or untick what you want to see. Compare, then Two versions, puts two versions of one project side by side. The Changes views need the API Discovery add-on, which the trial includes.

How should you use it?

Run the affected tests before you approve, not after. Pick an environment that is not production. Treat a clear run as evidence, not proof: a specification change shows what changed on paper, and a passing run only covers the tests that exist. Keep the notes honest, by clearing them only after you have looked.

Try it yourself

With a trial: open a project that has tests and a mock, and import a changed copy of https://demo.totalshiftleft.ai/openapi/rest.json. Read what the change touches, choose a non-production environment under Run on, run the affected tests, then approve. Finally open Mocks and clear the note with I've checked it. You should see the tests listed before the run, and the note gone afterwards.

Recap

  • Regression testing in an API means rerunning what a change touches, and nothing else.
  • The review shows tests, mocks, load tests and workflows that depend on a change, and runs only the affected tests.
  • A person chooses the environment, confirms the run and approves the change.
  • Notes on mocks and load tests clear once you have checked them, and the Timeline keeps the record.

More lessons are coming. For now, go back to the whole course, or read how change impact analysis works for OpenAPI.

Hands-on lab

Try it: In a project that has tests, a mock and a load test, import a newer version of its specification. Read what the change touches, choose a non-production environment, run only the affected tests, then approve the change and clear the notes it left.

Enter your email to open the lab steps. One unlock opens every lab in the learning center.

No spam. Protected by reCAPTCHA — Google Privacy & Terms.

Frequently asked questions

How do you run only the tests a change affects?+

Import the newer specification. The review lists what the change touches, with a button to run just those tests. You pick an environment that isn't production, confirm the run, and approve afterwards. Looking never runs anything.

Who decides, the tool or a person?+

A person. Shift-Left API shows what a change touches, but a person chooses the environment, confirms the run and approves the change. Approving a specification change needs Professional, the 15-day trial or Enterprise.

What happens to mocks and load tests when an API changes?+

They get a note instead of a silent edit. A mock or a load test that depends on a changed operation is flagged, and the note clears once you have checked it. Mock notes need no add-on, while the load test itself needs the Performance testing add-on.