Entry 08Verification · static analysis2026

Finding the user journeys a code change could break

Test-impact tools such as pytest-testmon and Ekstazi report which tests to run, and they need coverage data (a record of which code each test executed) from a previous run. testgraph reports which user journeys (user-facing flows through a product) a change could break. It uses a static call graph, a map of which functions call which that is built without running anything, so it can be used on a repository that has never run its test suite.

answers injourneys
coverage requirednone
dependencies0
idle MCP server15.2 MB

Why existing test-impact tools fall short

When an agent finishes a change it has to decide whether the change is done. Running the whole suite gives the most evidence but can be slow. Running nothing is fast but gives no evidence. Tools built for that gap (SeaLights, Datadog’s test impact analysis, pytest-testmon, Ekstazi) narrow the suite by recording which tests touched which lines on a previous run.

That recorded coverage is also their prerequisite. Coverage exists only after the tests have run, so these tools have nothing to select from on a repository whose tests have never run, or for code no test has exercised yet.

They also report in units of tests. A failing test_resolve_backfill says a test failed. It does not say that a claimant can no longer submit a signed form.

How it answers

  • A journey registry names each user-facing flow and the symbols (named definitions in the code, such as functions) it enters through: a route handler, a scheduler sweep, a CLI (command-line interface) entry point.
  • The changed line ranges in a diff are mapped to the symbols that contain them. These symbols, called seeds, are the starting points of the search.
  • The call graph is walked backwards from the seeds, following callers of callers, to every symbol that depends on them.
  • Each journey whose entry symbols land in that set is reported, ordered by fan-in (the number of incoming connections).
git push
testgraph[…]: 11 journey(s) this push could break,
d9174b7e1..0305ada6f, ranked:

  [ 23] J1   claimant submits a signed form
  [ 16] J10  staff regenerates and downloads the signed PDF
  …

Output from a git hook (a script git runs automatically, here before a push) on a private repository, name removed. The number in brackets is the journey’s fan-in, the count used for ranking, and J1 and J10 are the journeys’ identifiers in that repository’s registry.

An edge is one link in the call graph, from a caller to the function it calls. A journey’s confidence level is set by the strongest path that reaches it. Each path is rated by its weakest edge, and the journey gets the rating of its best path. A chain is as trustworthy as its worst link, and one solid route is enough. A journey reached only through weak or synthesized edges (links the analyzer inferred instead of reading a direct call) is labelled VERIFY MANUALLY and stays on the list.

Why testgraph selects extra journeys

The two kinds of error cost different amounts. Flagging a journey that turns out to be fine costs a few minutes. Dropping a journey that a change did break can let a bug reach production and costs the user’s trust in the tool. So testgraph is built for recall (finding every affected journey) over precision (listing only affected ones), and accepts over-selecting: edit a shared config file and it selects almost everything, because almost everything depends on it.

The same reasoning drives the integrity guard. Before answering, testgraph checks that the index (the stored call graph) is current and uncorrupted, and declines to answer from a stale or corrupted one. A wrong graph would produce a wrong “you don’t need to test that”, the one answer a test selector must avoid.

Freshness matters because seeds come from line ranges. An index built before the code moved would match the diff against line spans that no longer mean the same thing.

One case is handled differently. If a changed file’s bytes still differ from the indexed copy after a re-sync, testgraph answers anyway, marks the answer RECALL DEGRADED, meaning some affected journeys may be missing, and names the file.

What the evaluation measured, and what it did not

Test selection is usually judged by how much it shrinks the suite. Static selection chooses tests by analysing the code without running it. Dynamic selection chooses them from coverage recorded on earlier runs. In one comparison from the regression-test-selection literature, the static tool STARTS reduced suites by 68.3% against 84.1% for the dynamic tool Ekstazi, and had a 5.9% safety-violation rate (cases where a test that should have run was skipped).

testgraph has been measured on four repositories for how many journeys it selects. Those counts are left off this page because no missed-fault rate (how often a journey that broke was left off the list) has been measured on those repositories to set beside them. Recall of 1.00 was measured on one target only: five hand-labelled commits and roughly twenty seeded mutation sites. A recall figure from one repository does not describe the tool in general.

The claim the evidence supports is that testgraph can answer on a cold start: no coverage, no CI (continuous integration, the automated build-and-test service), no prior runs. An incumbent tool could close that gap by collecting coverage on the first build or by adding static analysis. The approach also has a cost: someone has to maintain the journey registry. testgraph can draft one, but a person has to review and approve it and keep it current as the product changes.

How it runs: git hook, ledger and MCP server

  • testgraph runs from the pre-push hook, because that is the only git hook that receives a base commit to compare against. The remote’s sha (commit id) marks the boundary of what the remote does not have yet.
  • The hook never blocks a push. Every path exits with code zero, including a blocked integrity guard, a missing index, a missing registry, a traceback and a timeout, so its output is advice only.
  • Agents can also ask for the ranked journeys directly through the MCP server. The server uses only the standard library and imports lazily. It takes 15.2 MB of memory when idle, against 62–69 MB for a typical server built on an SDK (software development kit), and the difference applies to every editor window you have open.
  • Every run appends a row to a local ledger, so how often the tool is called can be counted.

The other half of the ledger records what running a journey then found. Joining the two halves on repository and commit gives the missed-fault rate, which the project has not yet measured: how often a journey failed on a commit whose selection did not name it.

How to install and run testgraph

Static analysis Test selection Python MCP
install
pip install testgraph

python3 -m testgraph.propose --repo <path>   # draft a journey registry
python3 -m testgraph.select  --repo <path>   # rank the journeys a diff touches

MIT licensed. A drafted registry is marked unapproved until a person reads it, and an unapproved registry still runs but says so in its output.

For questions or a use case, email [email protected] · Back to portfolio