Excel regression testing

Catch unexpected changes in generated Excel reports before users do.

Run the same workbook comparison after an export job, application release, or data-pipeline change. WorkbookLens CLI returns an actionable exit code and saves evidence for the person who investigates.

A durable test pattern

Keep the baseline, actual file, and evidence together.

1

Generate

Your application writes actual.xlsx.

→
2

Compare

WorkbookLens checks it against approved.xlsx.

→
3

Decide

The job reads the exit code and retains the reports.

PowerShell example
.workbooklens.exe ".aselinesapproved.xlsx" ".outputactual.xlsx" --keyed "Orders:A" --html ".artifactsworkbook-diff.html" --json ".artifactsworkbook-diff.json"

if ($LASTEXITCODE -eq 1) { throw "Excel report changed; review workbook-diff.html" }
if ($LASTEXITCODE -eq 2) { throw "Workbook comparison could not run" }

Reduce false alarms

Compare business identity, not accidental row position.

Generated reports often sort differently after a database query, dependency update, or harmless implementation change. If a worksheet represents records, use a stable key such as Orders:A so the test follows each order ID.

This turns a noisy row-by-row mismatch into a focused result: records added, records removed, and fields changed within records that still exist.

Example test evidenceA-1002 · Amount changed: 480 → 525A-1003 · Record addedAll other keyed records unchanged

Good regression controls

Make failures easy to reproduce and review.

01

Approve baselines deliberately

Store a known-good workbook produced from controlled input. Replace it only after a reviewer accepts the intended change.

02

Archive human and machine output

HTML supports review; JSON supports dashboards, notifications, and downstream analysis.

03

Separate change from error

Treat exit code 1 as a comparison finding and exit code 2 as an execution problem. They require different investigations.

Implementation questions

Before adding the check to CI.

Does the build agent need Excel?

No. WorkbookLens is self-contained and reads the workbook directly.

Can a reviewer open the report without WorkbookLens?

Yes. The HTML report is self-contained and can be archived as an ordinary build artifact.

Should every workbook difference fail the build?

That depends on your release control. A common pattern is to fail or flag the job, attach the HTML report, and require a reviewer to approve a new baseline when the change is intentional.