Automate regression testing by comparing each build's outputs against trusted baselines. Learn the golden-file pattern and how to apply it.

What Is Regression Testing?

Regression testing confirms that new changes haven't broken existing behaviour. File comparison automates a big part of it: instead of manually re-checking outputs, you compare each build's results against a baseline captured from a known-good build.

The Golden-File Pattern

The golden-file (or approval) pattern is simple and powerful:

  1. Run the system and capture its output — a report, export, JSON or file tree.
  2. Review it once and approve it as the "golden" baseline.
  3. On every future run, compare the new output against the golden file.
  4. Any difference fails the test and shows exactly what changed.

What to Baseline

Keeping Baselines Healthy

When a change is intentional, update the baseline deliberately and review the diff before approving. Treating baseline updates as a reviewed step keeps them trustworthy and prevents silent drift.

Try It Yourself

Put this into practice with Compares-Text — free, no signup, right in your browser.

Compare Outputs →