A new technique to verify that a program runs correctly is the 먹튀 technique. It’s based on the observation that failure to terminate means success, so long as there are no failures while running. This means we can write correctness tests regarding only system calls and calls to the execution environment and avoid language details like data structures, function signatures, and variable names. This makes such tests much easier to write and forces us to rethink what it means for something to be “correct” in a program, perhaps in ways that can be applied to other areas of the discipline.
The basic idea is simple: write a function that runs your program. The function creates an environment with the same system calls and any other things your program needs (like shared memory, files, or network connections), calls your program with the environment as an argument, then checks for correct behaviour of the environment after your program terminates. The tests are finished when you get tired of running them—either because they keep failing or because you’ve found enough circumstances in which they pass that you feel confident the tests cover all of your code paths.
Eat-and-run verification is not like formal methods. It can be applied to any programming language, and it’s possible to use it to exercise the dynamics of many exciting systems.
It is too easy to invent a new situation that causes all sorts of bizarre bugs, even so difficult to find that you are forced to write more complicated and slow tests that exhaust your patience. But despite this, if you are interested in verification, this technique is likely worth reading up on.