Safeguard
Developer Tools•

Validate a reachability tool with seeded tests on your own code

Plant known calls and known dead code in a test repo, then see whether a reachability tool gets them right. A practical plan with six test cases.

Safeguard Security Team
3 min read

To validate a reachability tool, build a small repository where you already know the right answers. Include a vulnerable function you call directly, one you call through an interface, one you call by reflection, and one you never call. Then check whether the tool agrees with you on each, and whether it shows its evidence.

Why seed your own tests

A vendor demo uses code that works well for the vendor. Your code has your frameworks and your habits. A seeded test takes an afternoon and tells you more than a slide deck.

Pick a known vulnerable package

Choose a published advisory that names an affected function and has a fixed version. Pin the vulnerable version in a scratch project. Check the advisory text yourself so you know which function is the flawed one.

The six cases

  1. Direct call. Your code calls the vulnerable function by name. Expected result: reachable.
  2. Never called. The package is imported or listed but the function is not used. Expected: not reachable.
  3. Through an interface. The call goes through an interface with one implementation. Expected: reachable, and see whether the path is shown.
  4. Through a callback. Pass the function as a value to another function that calls it. Expected: reachable.
  5. By reflection or string lookup. Invoke by name from a config string. Expected: reachable in truth, and a static tool may miss it. Record what it does. Documentation of one Go tool says calls through reflect are not visible to static analysis, so a miss here is a known class of gap.
  6. Transitive. A package you import calls a second package that holds the flaw. Expected: reachable if your code uses the part of the first package that calls the second.

Score the results

CaseYou expectTool saysPath shown
1 to 6fill infill inyes or no

Count misses in each direction. A tool that finds all reachable cases but flags the never called one is over approximating. A tool that clears case 5 may be under approximating dynamic calls. Neither is automatically a reason to reject it. You are learning how it behaves.

Add two questions

  • What does it say when the advisory has no function data?
  • Does the report separate package level matches from function level ones?

Keep the repository

Keep the scratch repo and re-run it when you change tools or upgrade a version. It becomes a small regression suite. For measuring noise across real projects, see how to measure SCA false positives in a pilot.

Quick check

How many cases are enough?

Six to ten, covering your main language and frameworks. More cases add little compared with realism.

What if the tool fails the reflection case?

That is common for static analysis. Decide whether your critical code relies on reflection and add review steps if it does.

Safeguard users can compare results with the free scan on the same scratch repository.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.