| mts_tests | R Documentation |
This function allows unit testing to help verify the MultiSEp package integrity, producing a table that summarises the purpose of each test and the outcome (passed/failed).
mts_tests(mode = c("All", "Demo"),
cores = 1)
mode |
Perform "All" tests or the "Demo" mode runs two of the tests. |
cores |
The number of compute cores to use, default is 1. |
The unit tests are designed within the testthat framework and incorporate datasets provided in the MultiSEp package. Run time is approximately 230s using one core (4.8GHz processor). The unit tests cover all of the functions in the MultiSEp package and implement individual expectations such as:
Expect error: verify error handling is implemented correctly.
Expect named: ensure code will return a character vector of expected names.
Expect type: check an object returned by a function is inherited from the expected base type.
Expect equal: verify code returns an expected reference value.
Expect length: verify code returns a vector with the specified length.
Expect no error: check the function runs without returning an error.
A data frame containing the test results as follows:
Test_Case_IDIdentification number of the test case.
Test_ObjectivePurpose of the test case.
OutcomeResult of a test case given as "Passed" or "Failed". A "Passed" value indicates to the user that the code performs as expected, "Failed" indicates that it does not.
Wickham, H. (2011). 'testthat: Get Started with Testing'. The R Journal (Vol. 3, pp. 5-10). https://journal.r-project.org/archive/2011-1/RJournal_2011-1_Wickham.pdf
## Demonstration mode
testTab <- mts_tests(mode="Demo")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.