Code changes that cause program behavior to change can be dangerous if the behavior change was unintentional. Unit tests help mitigate this, but in practice a lot of code is not covered by unit tests.
Property based snapshot testing.
For example, say our program is a single function: