It is important to test software. One approach is unit-testing, and for R packages this can e.g. be done using testthat.
It is also important to document software. For R packages roxygen2 is really helpful: It enables you to write documentation in the code file in the R/ folder where the function is implemented. And then roxygen2 takes care of handling the Rd files in the man/ folder.
I have made a new R package that combines these approaches: roxytest.