mts_tests: Unit Tests for the MultiSEp package

View source: R/mts_tests.R

mts_testsR Documentation

Unit Tests for the MultiSEp package

Description

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).

Usage

mts_tests(mode = c("All", "Demo"),
          cores = 1)

Arguments

mode

Perform "All" tests or the "Demo" mode runs two of the tests.

cores

The number of compute cores to use, default is 1.

Details

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.

Value

A data frame containing the test results as follows:

Test_Case_ID

Identification number of the test case.

Test_Objective

Purpose of the test case.

Outcome

Result 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.

References

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

Examples

## Demonstration mode

testTab <- mts_tests(mode="Demo")


MultiSEp documentation built on Aug. 27, 2026, 5:07 p.m.