intermediate·8 min read·Updated

Microservices Testing Strategy: The API Dependency Graph

A microservices testing strategy needs to know which APIs depend on which. Read a project's dependency graph three ways, tell a fact from a guess, see what is at risk when an API changes, and find one API's neighbours.

This is lesson 9.25, part 1, of Shift-Left API in Depth, the product track of the learning center. The previous lesson showed what an API change touches. Now you see where those links between APIs come from. The project map is part of API Discovery, a paid add-on that the 15-day trial includes. Each API's own Dependencies tab is in every edition.

Which question does a microservices testing strategy answer first?

A microservices testing strategy starts with one question: which APIs depend on which? When you change one, you need to know what else can break. That tells you what to test first, and whom a change can affect. Shift-Left API draws a project's APIs as a map, and reading the map runs nothing and sends nothing to your APIs.

Your project may already hold the evidence:

  • A workflow someone built, as in lesson 9.8, says which API runs after which, and which value passes between them.
  • A recording or a live capture shows calls that really happened. A gateway or a trace can show them too.
  • A person can state which API an MCP tool calls.
  • An AI suggestion counts only after a person accepts it.
  • The shape of the paths gives a guess. It can be wrong.

On the map, the colour of a line says what it means, such as "runs after", "uses a value from" or "calls". The dash pattern says how it is known. When a link is known in several ways, the strongest one is drawn and the others are listed.

How do you open and read the dependency graph?

  1. Open the account menu and tick Discovery under Top menu tabs.
  2. Click Discovery, then Dependencies.
  3. Choose a project in the Project list. Each project has its own map.

APIs are arranged in lanes, one per resource, and what runs after an API sits to its right. A line above the map says how much is drawn, including how many APIs have no link. The key explains every line style, and What these mean gives one sentence on each.

Under Show, you can read the map three ways:

  • End-to-end workflows shows the order in which APIs are called, with one colour per workflow.
  • Functional dependencies shows what would break what: a value passed on, or a call.
  • Both shows journeys and dependencies together.

Guesses from the paths are hidden until you tick the box that shows them. Journeys in this picture lists each workflow: untick one to hide its lines, or click Follow to fade the rest and number its steps. Point at any line to read About this link, which says what the link means and where it came from.

What is at risk when an API changes?

Below the map, Most depended on lists the APIs whose change would put the most others at risk. Click one, or click any card. The map outlines the APIs that lean on it, and the panel explains each one, including APIs several steps away. An API that only runs after the chosen one is labelled that way, because running later does not mean it breaks.

If nothing is known to depend on an API, the screen says so, and adds that this is not proof that nothing does. See the links as a list writes every link as a sentence.

Where do you see one API's neighbours?

Choose an API and click Open its API page, then open its Dependencies tab. Related APIs lists what runs before it, what runs after it, who has been seen calling it and what only looks like the same resource, each with how it is known.

How should you use the map?

  • Test first the APIs that others depend on most.
  • Before changing an API, read what is at risk. The change review reads these same links.
  • Treat a guess as a question, not as a dependency.
  • When nothing is known to depend on an API, gather more evidence before you call it safe.

Try it yourself

With a trial: import the sandbox store's specification from https://demo.totalshiftleft.ai/openapi/rest.json and build an order journey as a workflow. Tick Discovery, open Dependencies, click Functional dependencies and click an API. Then open its API page and its Dependencies tab. With no links yet, the map tells you how to add them.

Recap

  • A microservices testing strategy needs the map of which APIs depend on which.
  • Read it as journeys, as functional dependencies, or both.
  • Every line says how it is known, so evidence never looks like a guess.
  • Click an API to see what is at risk, and open its page for the APIs around it.

Next: part 2, add to the dependency graph and label each API. To go further, read the API dependency mapping guide.

Hands-on lab

Try it: With a trial, import the sandbox store's specification and build the order journey as a workflow. Tick Discovery, open Dependencies, click Functional dependencies, click an API, then open its API page and its Dependencies tab.

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

What is an API dependency graph?+

It is a map of which APIs in a project run after, call or use values from other APIs. In Shift-Left API, the links come from workflows, recorded or captured calls, gateway and trace sources, statements by a person, accepted AI suggestions, and guesses from the paths. Each line shows how it is known.

If nothing depends on an API, is it safe to change?+

Not necessarily. It only means no passed value or call has been recorded for that API, which is not proof that nothing depends on it. Add more evidence, such as a workflow or a recording, before you treat the change as safe.

What do microservices testing tools need to show?+

For deciding what to test first, they should show which APIs depend on each other and how each link is known. That keeps evidence apart from guesses. In Shift-Left API, the project map is part of the API Discovery add-on, and each API's own Dependencies tab is in every edition.

Read more on the blog