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 behavior 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
Code Coverage
The proportion of code executed by a test suite — a map of what is untested, not a measure of quality.
Testing & Verification14 connections
Observability
How much of a system's internal state can be inferred from what it emits.
Method24 connections
Resource Starvation
Failures caused by competition for a finite shared resource rather than by any defect.
Testing & Verification12 connections
Flaky Test
A test that passes and fails on identical input, and the most corrosive thing a suite can contain.
Testing & Verification17 connections
Branch Coverage
The proportion of conditional outcomes exercised — the strictest ordinary coverage metric, and the most informative.
Testing & Verification12 connections
Ground Truth
The measurement that arbitrates, as opposed to the artifact that merely reports.
Method95 connections
Related3
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from15
- Big-O NotationComputation & Algorithms
A coarse language for how an algorithm's cost grows as its input grows.
- 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.
- HeisenbugTesting & Verification
A fault that changes or disappears when someone tries to observe it.
- Least Recently Used CacheComputation & Algorithms
A fixed-capacity cache that evicts whichever entry has gone untouched the longest.
- 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.
- Streetlight EffectMethod
Looking where the light is good rather than where the answer is.
- Survivorship BiasMethod
Drawing conclusions from a sample already filtered by success.
- Unreachable CodeTesting & Verification
Code no input can execute — usually a guard against a state the surrounding invariants forbid.