Hacker News new | ask | show | jobs
by debugnik 138 days ago
These are great to test code that has no formal specification or oracle, so you're writing a reference implementation.

First, the test fails because there's no expected output, and you get to check the existing behaviour pretty-printed. Then, if it's correct, you approve it by promoting the diff into the source code, and it becomes a regression test.