My (biotech) employer largely solves this issue by keeping a copy of the formal research specs outside of software altogether.  All validation documents and research data are kept in paper form (in addition to digital form) in such a way that future researchers or inspectors could take those documents and data and reconstruct the research.<p>It wasn't always this way, unfortunately.  I've been involved with trying to glean some formulaic/methodological insights from spreadsheets and code and it's not always possible to reverse engineer the essential methodology or be sure that mistakes were avoided.<p>Proper scientific research practices are similar to proper data backup practices: the documentation (backup files) are important, but they don't matter if you can't have successful reproducibility (restoration).