I would like to write some code to test certain functions in a codebase that has gotten relatively large but has no tests. I recently found a bug caused by copying a line and pasting it five times (was supposed to change a parameter on each line but forgot to). Didn't notice the bug until I refactored that procedure to make the code parallelizable for use with the Grid package.
Hence, I am worried about such unknown calculation mistakes in algorithms that involve a sequence of intermediate steps/calculations.
I found there is an assert command.
I would write procedures that would call the procedures to be tested with certain arguments and assert the output.
Are there any other tools available or best practices perhaps from experience?