@@ -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`](https://git-scm.com/book/en/v2/Git-Basics-Tagging) 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: