unit testing
acceptance testing is a test conducted to determine if the requirements of a specification or contract are met
With a focus on developing functionality first, tests should be built once something has been created that needs to be validated.
How to test
Application of Software Testing to R package development
For the PCCC R package there are a large set of ICD codes that and code set patterns that are used to determine if an input record meets a complex chronic condition criteria. To validate the correct functioning of the software, the first priority was to validate the ICD code groupings were correct and were mutually exclusive (as appropriate). As PCCC is a re-implementation of SAS and Stata code, we needed to validate that the codes from the previously developed and published software applications were identical and were performing as expected. Through a combination of manual review and automated comparison codes were checked to see if duplicates and overlaps existed. Here is a brief snippet of some of the code used to automatically find duplicates and codes that were already included as part of another code: