While the specific codes were being compared, validated, and agreed upon, unit tests were written to validate the functionality of the new package. The first tests written were those that were manually developed and manually run as development progressed. Key test cases of this form are ideal candidates for initial automated testing. While manual running of a selection of test cases is a good start, a more efficient approach is to integrate testing into the package build process.  For unit testing, we selected the testthat <reference> package. After these initial tests, further thought went into edge cases and ways a user of the package might mistakenly call our package.
Another common pattern is to create a test case for discovered bugs - this ensures that a regression of this type does not happen again: