knitr::opts_chunk$set(echo=FALSE)

Validation Testing: mrgsolve v0.10.0

Scope

The purpose of this Validation Testing document is to define the conditions for test execution. All tests are specified and linked to release candidate user stories as numbered issues in the Requirements Specification-Validation Plan document.


library(dplyr)
library(readr)
library(testthat)

Test locations

Tests are in three locations

  1. tests/testthat
  2. inst/maintenance/unit
  3. inst/validation

Test candidate

Showing md5 checksum

tarball <- "../../mrgsolve_0.10.0.tar.gz"
tools::md5sum(tarball)
install.packages(tarball, repos=NULL)
run_test <- function(dir,d) {
 cwd <- getwd()
 on.exit(setwd(cwd))
 setwd("../../")
 x <- test_dir(dir, reporter="check") %>% as_tibble
 x$result <- NULL
 x$location <- dir
 x$date <- d
 x
}
d  <- Sys.time()

Run tests

Tests specified in the Requirements Specification-Validation Plan document are executed using the run_test() function, which calls testthat::test_dir.

tests/testthat

y <- run_test("tests/testthat",d) 

inst/maintenance/unit

z <- run_test("inst/maintenance/unit/",d)

inst/validation

x <- run_test("inst/validation",d)
df <- bind_rows(x,y,z)

Comprehensive summary

Summarizes the number of contexts, tests, and expectations and counts number of tests and test failures.

summarise(
        df,
        contexts = n_distinct(context),
        tests = n_distinct(test), 
        number = sum(nb), 
        failed = sum(failed)
)
readr::write_csv(path="all_tests.csv", df)

Session

Testing session information is captured.

devtools::session_info()


metrumresearchgroup/mrgsolve documentation built on Sept. 13, 2024, 11:31 a.m.