Regression Testing for API: What Changed?
You can't rerun what a change touches until you know what changed. See what your Discovery sources report, compare two versions of a specification without importing anything, and compare a pre-production environment with production.
This is lesson 9.24, part 1, of Shift-Left API in Depth, the product track of the learning center. The Quality Agent's prepared fixes in the last lesson dealt with problems already found. Here you start earlier, with the change that might cause the next one. The Changes views are part of API Discovery, a paid add-on that the 15-day trial includes.
Where does API regression testing start?
Regression testing for an API starts with one question: what changed? Answer it before anything is imported and you know what to rerun before anything moves. The rest of this lesson is three ways to answer it, each from a different starting point.
How does a change reach you, and what does each kind mean?
A change reaches you in four ways: a source that reads again and sees something different, a changed file you import into a project, two files you compare, or two environments you compare. They all use the same rules for what counts as breaking.
Roughly, a change could break clients when a caller that worked yesterday might fail today: a required field added to a request, a parameter removed, a response field dropped or its type changed. A change is safe for clients when existing callers keep working, such as a new optional field or a new endpoint. Names and descriptions are changes too, but only of the writing. The spec change lesson shows the import side in depth.
What do your sources report?
Open Discovery, then Changes. It opens on Seen by sources: a list of what appeared, changed or went quiet since the last runs. Each line says what happened and when, and carries a status chip. Until a source has run more than once there is nothing to show, because a change needs a before and an after.
On each line you can:
- Open the operation to see the evidence behind it, the same drawer as in lesson 9.19.
- Acknowledge it, Resolve it, or mark it a False positive with a reason, and Reopen it later.
Those buttons appear only for people with the review permission. The Show list filters by status, so open items come first and settled ones stay out of the way.
How do you compare two specifications?
Open Compare, then Two specifications. Paste or choose a file for The first (before) and The second (after), then press Compare them. Both must be the same kind of specification, and a file over 8 MB is refused.
The report says how many APIs each describes, then lists each changed API as Could break clients or Safe for clients, followed by what was Added and Removed. If the two match, it says "No difference." Nothing is saved and nothing is imported, so it is safe to ask before you commit to anything.
How do you compare two environments?
Open Environments, choose a First environment and a Second environment, then press Compare. You get two lists: what exists only in one, and what is in both, but different, with a sentence for each. If they agree, it says "The two environments match." Nothing is sent to any API: the answer comes from what Discovery already knows.
This is the check to run before a release, with pre-production on one side and production on the other.
Try it yourself
With a trial: tick Discovery under the account menu's top menu tabs, open Changes and read Seen by sources. Then open Compare, take the sandbox store's spec from https://demo.totalshiftleft.ai/openapi/rest.json, copy it, change one field's type in the copy, and compare the original with the copy. Last, open Environments and compare two of yours. You should see the changed API marked Could break clients, and the environment lists.
Recap
- Regression testing for an API starts by asking what changed, before any import.
- Seen by sources follows what your sources report, with acknowledge, resolve and false-positive decisions.
- Compare reports two versions of a specification as could break or safe, and saves nothing.
- Environments shows what is in only one environment, and what differs in both, without calling any API.
Next, part 2 takes a change and asks what it touches: you import a newer version, run only the tests it affects, clear the notes it leaves on a mock and a load test, and find it again in the project's record. Read lesson 9.24, part 2, or see how a regression suite fits around it.
Try it: With a trial, open Discovery and then Changes. Read the Seen by sources list, then open Compare, paste two versions of one OpenAPI file and press Compare them, then open Environments, choose two environments and press Compare.
Frequently asked questions
What is the first step of regression testing for an API?+
Finding out what changed. Rerunning every test after every release is slow, so you rerun what a change touches, and you can't know that until you can see the change. Shift-Left API puts the changes in one place, the Changes tab of Discovery.
Can I compare two versions of an API specification without importing either?+
Yes. Compare takes two specifications of the same kind, such as OpenAPI, Swagger, WSDL or a GraphQL schema, and reports each changed API as Could break clients or Safe for clients, plus what was added and removed. Nothing is saved or imported.
Does comparing two environments change anything in either one?+
No. Environments compares what Discovery already knows about each one and sends nothing to any API. It lists what exists in only one, and what is in both but different. The Changes views need the API Discovery add-on, which the 15-day trial includes.
Related lessons
Your spec is a contract, and it changes. Import a new version into Shift-Left API, see which changes break clients, approve them, and test the new version.
Which of your APIs have tests, security checks, a mock or a load test? The Overview lists every API of a project with what it has had, and each API has a record of its own. Looking runs nothing.
Your OpenAPI spec is most of a test plan already. Import it into Shift-Left API, explore what it creates, and generate tests from it with no requirements needed.