Since they used the tests this is not something you can do if you don't have a rich battery of tests.
Perhaps many problems are something like finite automata and the program discover the structure of the finite automata and also an algorithm for better performance.