Instrumentation
Adding measurement to code so its execution can be observed, and the distortions that introduces.
Instrumentation is the practice of adding measurement machinery to code — counters, probes, tracing hooks — so that its behaviour can be observed at runtime. Coverage tools instrument to record which lines ran; profilers instrument to record time; observability agents instrument to emit traces.
The trade-off is that instrumentation changes what it measures. Instrumented code is slower, sometimes dramatically, which turns a test that comfortably fits a timeout into one that intermittently does not. A timeout failure under coverage that never reproduces without it is an instrumentation artifact, not a defect — and treating it as one saves hours.
A second distortion is duplication. When the same source file is instrumented by two independent runners, the merged report can contain two records for the same position rather than one, and a position exercised in only one of the two runs shows as uncovered. The tell is arithmetically impossible output: full statement coverage alongside a function that never ran. The fix is structural — arrange for both runs to exercise the same position, or collapse two positions into one — not more tests.
Instrumentation also has its own failure modes to distinguish from real ones: a corrupted temporary directory produces errors that look like coverage collapse, and two concurrent runs in one working copy destroy each other's intermediate files.
See also6
Hand-picked in the note itself — the neighbours worth reading next.
Code Coverage
The proportion of code executed by a test suite — a map of what is untested, not a measure of quality.
Testing & Verification12 connections
Observability
How much of a system's internal state can be inferred from what it emits.
Method15 connections
Resource Starvation
Failures caused by competition for a finite shared resource rather than by any defect.
Testing & Verification10 connections
Flaky Test
A test that passes and fails on identical input, and the most corrosive thing a suite can contain.
Testing & Verification12 connections
Branch Coverage
The proportion of conditional outcomes exercised — the strictest ordinary coverage metric, and the most informative.
Testing & Verification10 connections
Ground Truth
The measurement that arbitrates, as opposed to the artifact that merely reports.
Method30 connections
Related3
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from10
Notes elsewhere in the wiki that reach for this one.
- Branch CoverageTesting & Verification
The proportion of conditional outcomes exercised — the strictest ordinary coverage metric, and the most informative.
- Code CoverageTesting & Verification
The proportion of code executed by a test suite — a map of what is untested, not a measure of quality.
- Coverage GateTesting & Verification
A build check that fails when coverage falls below a threshold, and what that pressure produces.
- DaemonSystems & Tooling
A long-running background process managed by the operating system's service supervisor.
- Flaky TestTesting & Verification
A test that passes and fails on identical input, and the most corrosive thing a suite can contain.
- Ground TruthMethod
The measurement that arbitrates, as opposed to the artifact that merely reports.
- ObservabilityMethod
How much of a system's internal state can be inferred from what it emits.
- ProcessSystems & Tooling
A running program with its own memory, environment, and identity.
- Resource StarvationTesting & Verification
Failures caused by competition for a finite shared resource rather than by any defect.
- Unreachable CodeTesting & Verification
Code no input can execute — usually a guard against a state the surrounding invariants forbid.