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:
- Run the system and capture its output — a report, export, JSON or file tree.
- Review it once and approve it as the "golden" baseline.
- On every future run, compare the new output against the golden file.
- Any difference fails the test and shows exactly what changed.
What to Baseline
- Generated reports and documents.
- Exported spreadsheets and CSVs.
- API response payloads.
- Configuration and build artifacts.
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.