jargon

Backend & systems·Testing and test doubles

you save the current output to a file and the test just checks nothing changed, which is exactly what you want on a legacy refactor.

Golden test

Also calledsnapshot test, approval test, characterisation test

A test comparing output against a recorded reference. It is excellent for pinning behaviour you are about to refactor and for large outputs no one wants to assert field by field. It goes bad when updating the snapshot becomes reflexive, at which point the test records what the code does rather than what it should.

Commonly confused with