intermediate·8 min read·Updated

Testing Microservices Best Practices: Add to the Dependency Graph

Testing microservices best practices start with evidence you can trust. Add links from real traffic, compare two environments, say what an MCP tool calls, decide on AI suggestions, and label each API's business domain and purpose.

This is lesson 9.25, part 2, of Shift-Left API in Depth. Part 1 showed how to read the dependency graph. Now you add to it, and label what each API is. The map, recordings, environment comparison, MCP tool links, AI suggestions and the Inventory's labels are part of API Discovery, a paid add-on that the 15-day trial includes. AI suggestions and descriptions need an AI provider.

Which evidence can you trust?

Testing microservices best practices start with evidence you can trust: which calls really happened, in which environment, and who says so? Each kind of link has its own source and lifetime:

Link sourceHow long it lasts
A workflowRead again each time, so it goes when the workflow goes
A recording, capture, gateway or traceStored per environment; expires 90 days after it was last seen
A person, for an MCP toolUntil someone removes it
An accepted AI suggestionUntil someone withdraws it; never counts as seen
The shape of the pathsWorked out each time; only a guess
  1. On Discovery, Dependencies, open Add links from real use.
  2. In Recorded in, type the environment, such as staging.
  3. Choose Add links from a recording (HAR) and pick a file saved from your browser's network tab.

Shift-Left API reads the order of the calls. It stores which API followed which, never a body, a header or a person. Calls more than a minute apart are not paired, calls that match no API are listed and left out, and adding the same file twice changes nothing. You can also read your latest live capture from the desktop app, which is kept for 24 hours.

The Environment list then narrows the seen links to one environment. Other kinds of link always show. Under Compare two environments, choose two and click Compare to see which links were seen in only one. An environment with no recorded links is reported as having none, which is not the same as no difference.

Gateway, trace and capture sources can also name the calling system, such as a billing application, with a count. That label is a system's short name, never a person, an address or a token.

How do you record what an MCP tool calls?

An MCP server does not say which API a tool uses, so a person says it. Under MCP tools and the APIs they call, click Say what a tool calls, pick the tool and tick the API. Linking does not check the claim and does not call the tool. The tool then gets its own lane on the map, and counts among what is at risk when that API changes.

Under Links the AI suggests, you can ask for suggestions. The AI sees only API names, methods, paths and field names, never a body or a host, and each request counts against your daily AI allowance. AI results vary. A suggestion is a guess until you Accept it; you can also Dismiss it.

How do you label what each API is?

In Discovery's Inventory, open See the evidence on an API's row and find What this API is.

  • Business domain is worked out by rule after each import, from tags and words in the path, and shows its reason. A tie or a single weak hint is left blank. A domain you set yourself is never overwritten.
  • What it is for can be drafted with AI from the method, the path and the documented field names and types. It is marked as not checked until a person confirms or rewrites it. An AI never replaces a sentence a person wrote.

Who can do what?

Anyone who can see a project's tests can read its map and labels. Adding links, deciding on suggestions and setting labels need the right to create or edit tests. An API hidden from your team is left out of every link and count.

Try it yourself

With a trial: save a HAR file from your browser on a test environment, add it with Recorded in set to that environment, and choose it in the Environment list. Then open an API's evidence in the Inventory and set its domain. To start with a project, you can import https://demo.totalshiftleft.ai/openapi/rest.json.

Recap

  • Seen links belong to an environment, and you can compare two.
  • An MCP tool link is a person's statement, and is marked that way.
  • An AI link counts only after a person accepts it.
  • Domains and descriptions show where they came from, which makes microservices API testing decisions easier to check.

Next: lesson 9.26 on API governance tools. You can also read about service dependency testing strategies.

Hands-on lab

Try it: With a trial, save a HAR file from your browser while using a test environment, and add it with Recorded in set to that environment. Choose it in the Environment list, ask the AI for link suggestions if you have an AI provider, then open an API's evidence in the Inventory and set its domain or ask for a description.

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

Can you build API dependencies from real traffic?+

Yes. In Shift-Left API, you can add a HAR file saved from a browser's network tab, or read your latest live capture from the desktop app. It stores which API followed which, never a body, a header or a person. Links seen this way expire 90 days after they were last seen.

Does an AI add dependencies to the map by itself?+

No. A suggestion is only a suggestion until a person accepts it, and an accepted link is marked as suggested by AI and confirmed by a person. It can be withdrawn later.

How can you compare dependencies between two environments?+

Record traffic in each environment, then use Compare two environments and choose both. It shows links seen in only one of them and how many were seen in both. Only links that were seen happening belong to an environment.

Read more on the blog