How can I automate the recovery of a code for automated tests?