Commit 4717db60 authored by Jason Rigby's avatar Jason Rigby
Browse files

update documentation

parent da47801a
......@@ -79,8 +79,28 @@ Once the functions are written, tested and documented, `devtools::document()` sh
All functions should be appropriately unit tested, ideally using the automated test framework `testthat`. More detail information regarding tests can be found in the [tests/testthat](tests/testthat) subdirectory.
Tests should be written in a way that:
* will detect when errors in dependent functions or the underlying data arises, e.g. most functions that return ASPREE data will have 19,114 rows (one per participant)
* will detect when errors in dependent functions or the underlying data arises
* tests the behaviour when both valid and invalid data is provided, e.g. `sqrt(x)` should not be defined if a negative input is given
* never has an external dependency, e.g. pre-canned (fake) data should be provided to simulate database access
All changes should be proposed via GitLab merge requests and reviewed prior to acceptance. [Git `tags`]( should be used to mark major releases to allow for reproducible analysis. Insofar as practical, git commits merged into the master branch should be squashed into units that sensibly describe their net effect.
### Running the tests
Tests can be run using `devtools::test()` with output that resembles the following:
> devtools::test()
Loading aspree
Testing aspree
✔ | OK F W S | Context
✔ | 77 | Generate longitudinal dataset file paths
✔ | 9 | Get demographic info
══ Results ════════════════════════════════════════════════════
Duration: 0.2 s
OK: 86
Failed: 0
Warnings: 0
Skipped: 0
The more automated sanity checks, the better!
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment