Legacy Software

Golden master testing

Otherwise known as approval testing can help prevent regression. https://approvaltests.com/ or just write your own in whatever. Patch out and capture external state changes.