Definition
Internal validity is the extent to which a difference observed in a study can be attributed to the condition being compared, rather than to some other difference in how the compared groups were set up, ordered, treated or measured. It concerns only the setting the study tested; whether the result holds elsewhere is external validity §11.44. The main threat to internal validity is confounding §11.10: a second factor that changes together with the compared condition and also affects the outcome.
Where it fits
Main entry: Confounding (§11.10).
The confounding entry explains the central mechanism with numbers: when new code is always measured after a warmup §11.27 and old code always right after start-up, a 2-millisecond slowdown appears as a 3-millisecond improvement, and more repetitions only make the wrong number more precise. Besides a confounder of that kind, the usual threats are:
order and carryover: one condition always runs first, so the other meets a warmer cache (the small fast memory holding recently used data) or a hotter chip;
unequal measurement: different instrumentation §14.24 or timing endpoints §18.1.6 for each condition;
differential loss: one condition fails more often and failed runs are dropped, so the surviving runs are not comparable;
unequal acceptance: an exclusion rule applied to one condition only, or chosen after seeing its effect;
selection: different units for each condition, such as faster boards for the new version.
The randomization §11.8, blocking §11.9 and paired design §11.7 entries explain the defenses: random order, balanced blocks of time, both conditions on the same units with the same inputs, and identical measurement and acceptance rules fixed in advance.
Threats to validity. Research papers often close their evaluation with a section of this name, listing ways the conclusions could be wrong, usually in four kinds: internal validity; external validity, whether the result transfers to untested settings; construct validity, whether the measured quantity stands for the property claimed; and statistical conclusion validity, whether the data and analysis support the inference, for example through enough independent units and a correct uncertainty. Donald Campbell introduced the terms internal and external validity in 1957 [483]; Cook and Campbell’s 1979 book on quasi-experiments, studies without random assignment of conditions, sets out the four kinds.
One rule sorts most threats. A factor that differs between the compared conditions threatens internal validity. A factor shared by all conditions but different from the setting the claim is about threatens external validity. A doubt whether the measured number is the claimed property threatens construct validity. For example:
a single test board, used for both conditions: external, for claims about other boards;
instrumented builds measured instead of the builds that ship: construct and external, because every measured time includes work the shipped build does not do, and also internal if the instrumentation differs between conditions;
an earlier software version measured instead of the current one: external;
other jobs on the measuring computer at the same time: internal if they overlapped one condition more than the other, otherwise noise that weakens statistical conclusion validity.
Questions answered
Were treatment order, input, and measurement boundaries controlled?
They were controlled only if the records show each of the following; without them, an observed difference cannot be attributed to the compared condition alone.
Treatment order: the compared conditions, called treatments, ran in a random or balanced order, such as alternating or randomized blocks, never all of one before all of the other, so that warmup, temperature and drift over time affect both alike.
Input: both conditions received the same inputs, or inputs drawn by the same procedure, and the system was returned to the same starting state before each run.
Measurement boundaries: both conditions were timed between the same start and end events, with the same clock, the same instrumentation and the same rules for excluding or retrying runs, all fixed before the results were seen.
Then check that the condition is not tied to anything else that differs: another board, another time of day, another background load, or another rate of failed runs that were dropped. Many repeated runs do not substitute for these controls; they make a confounded difference more precise, not more correct.
Related entries: Confounding (§11.10), Randomization (§11.8), Missing data and attrition (§11.29), Instrumentation overhead (§11.32), Sensitivity analysis (§11.46), External validity (§11.44), Blocking (§11.9), Paired design (§11.7). Further reading: [483].