It’s a simple idea, and in fact many people do it already without using a special testing framework. Often when you write a test, the assert statement will be comparing two strings. One way to write the test is to start out with just an empty string in the “expected” part of the assert statement, even though that’s not the correct behaviour. When the production code works, you just copy the actual output and paste over the empty expected string. It’s often a little less work, particularly if calculating the exact expected string up front is tricky. This is what I’d call approving a result, rather than making an assertion up front, hence the name “Approval Testing”.
The outcome from both an Assertion-based and Approval test is similar – a repeatable
regression test that you can run at any time to check your program still works. The main advantage of Approval testing is that by default, it checks a whole report, rather than relying on your remembering to assert all the important things in each test case. In my experience, it means you find bugs you never anticipated when you designed the test.