Coverage Profiles
You define coverage rules as profiles inxspec.config.ts. Each profile specifies four things:
A typical profile named
tested might declare that every leaf requirement in your specs/ group must be reachable from a node in your test/ code group via any edge kind transitively.
Building the Required Set
Not every node in the target group ends up in the required set. xspec applies these filters in order:- Leaves only — only leaf nodes (sections with no children) are required, unless you set
targets: "all"in the profile. - Exclude
coverage="none"— sections marked<S id="..." coverage="none">are excluded and reported as ignored. - Exclude root nodes — implicit file root nodes are never required.
Direct vs. Transitive Mode
direct mode requires a single edge from a boundary node directly to the requirement being covered. This is strict: an intermediary requirement does not pass coverage through to a deeper one.
transitive mode allows a path of one or more permitted edges. A test can cover a high-level requirement, which in turn covers lower-level ones through depends or embeds edges — as long as every step in the path uses a permitted edge kind.
contains edges never grant coverage in either mode. Structural parent-child nesting is not treated as a semantic dependency.Running Coverage
Runxspec coverage to see the full report for all profiles:
- required — total nodes that must be covered
- covered — nodes with a valid path, including the shortest path found
- uncovered — your work list; these nodes need a covering boundary node
- ignored — nodes excluded from the required set, with the reason (e.g.
coverage="none", root node)
CI Gating with --check
Pass --check to make xspec coverage exit with code 1 if any required node is uncovered. This turns coverage into a hard CI gate: