Golden Regression Tests

Golden regressions lock a set of inputs and outputs so any drift in pricing behaviour becomes immediately visible.

intermediateregressiongolden testsdrift detectionreference trades

Mental model

A fixed input-output record makes unintended pricing drift visible immediately.

A golden regression suite consists of reference trades evaluated under fixed market snapshots and model configurations.

Their prices, Greeks, and diagnostics are stored as expected outputs with tolerances appropriate to each method.

INTERACTIVE INTUITION

Explore the mechanism

Has a controlled input produced a materially different output from the reviewed baseline?

Golden regression tests
Lock inputs and expected outputs. Force explicit decisions on drift.
Change scenario
Tolerance rule
abs_tol
0.020
rel_tol
0.0010
Suite verdict
PASS
Failures
0 / 6
Updating golden values is a controlled act. If tests fail, you either revert or you document the reason and update deliberately.
Vanilla call
PRICE — case T1
PASS
expected: 2.510 · new: 2.510
|diff| = 0.000 · bound = 0.023
Vanilla call
DELTA — case T1
PASS
expected: 0.540 · new: 0.540
|diff| = 0.000 · bound = 0.021
Put spread
PRICE — case T2
PASS
expected: 1.120 · new: 1.120
|diff| = 0.000 · bound = 0.021
Put spread
VEGA — case T2
PASS
expected: 0.180 · new: 0.180
|diff| = 0.000 · bound = 0.020
Digital
PRICE — case T3
PASS
expected: 0.410 · new: 0.410
|diff| = 0.000 · bound = 0.020
Digital
DELTA — case T3
PASS
expected: 0.090 · new: 0.090
|diff| = 0.000 · bound = 0.020
Interpretation
  • Goldens turn behaviour into a contract: fixed inputs → expected outputs.
  • Small drifts are often worse than big breaks, because they slip into production silently.
  • If failures are intentional, you update goldens with a recorded rationale and version bump.
CONSEQUENCE PROBE

Can a known valuation move without an explicit review?

fixed casecurrent pricermatches baselinetest passes
No unexplained driftThe comparison confirms that the known input still produces the approved output.
UNDERSTAND

What to notice

Every code change reruns the suite; deviations beyond tolerance fail tests and force an explicit decision.

Updating golden values is a controlled act that should reflect a deliberate model or bug-fix decision, not an accident.

TRANSFER

Where it appears

  • detecting pricing drift
  • locking representative portfolio results
  • reviewing numerical-library upgrades
CHALLENGE

Where the intuition breaks

What this view leaves out

  • A golden test can preserve an incorrect baseline and may fail on harmless floating-point changes unless tolerances and review rules are explicit.

Common mistakes

“Golden outputs are permanent truths.”

Not quite.

They are reviewed expectations for specified inputs, versions, and tolerances and must change when intended behavior changes.

CONNECT

Where this concept sits

Follow the strongest prerequisites, applications, extensions, and contrasts.

Connections for Golden Regression Tests

Used by · Validation Toolbox for Pricers

Golden reference cases detect unintended pricing changes across code revisions.

Explore concept
SOURCES

References

  1. NIST/SEMATECH e-Handbook of Statistical Methods (opens in a new tab)
← Explore all concepts