Incremental Validation: The 3-File Rule

Before processing a full batch, verify the pipeline works correctly on three representative files — catching bugs at three is dramatically cheaper than catching them at three thousand.

What it is

When building or running a pipeline that will process a batch of inputs — files, records, API calls, documents — the temptation is to launch the full batch immediately and inspect results at the end. The 3-file rule says: run three representative inputs first, verify the outputs manually, confirm the pipeline is doing what you intended, and only then launch the full run. Three is not magic — it is the minimum sample that reveals whether the pipeline works at all (one input), whether it generalizes beyond the happy case (second input, slightly different structure), and whether it handles an edge case (third input, known problem variant). Three is also small enough that if the outputs are wrong, you have wasted three runs instead of three thousand, and the bug is fresh and local rather than buried in a pile of corrupted output. This pattern applies to any batch operation with a setup cost: data pipelines, evaluation harnesses, agent workflows running over a corpus, file transformations, generation pipelines. It is a specific application of fail-early discipline to the batch context.

When to reach for it

When NOT to

Exemplars

Related