\(\rightarrow\) Efficient unit test case generation
Example: Test Template
test_template_f_design_group_sequential.R:
#' @exit Do not create the unit tests again#' @context Testing the Group Sequential and Inverse Normal Design Functionality#' @test_that 'getDesignInverseNormal' with default parameters: #' parameters and results are as expected#' @refFS[Tab.]{fs:tab:output:getDesignInverseNormal}#' @refFS[Formula]{fs:criticalValuesOBrienFleming}x0 <-getDesignInverseNormal()getUnitTestObject(x0, "x0")
Template
#' @exit Do not create the unit tests again#' @context Testing the Group Sequential and Inverse Normal Design Functionality#' @test_that 'getDesignInverseNormal' with default parameters: #' parameters and results are as expected#' @refFS[Tab.]{fs:tab:output:getDesignInverseNormal}#' @refFS[Formula]{fs:criticalValuesOBrienFleming}x0 <-getDesignInverseNormal()getUnitTestObject(x0, "x0")
Regeneration is disabled
#' @exit Do not create the unit tests again#' @context Testing the Group Sequential and Inverse Normal Design Functionality#' @test_that 'getDesignInverseNormal' with default parameters: #' parameters and results are as expected#' @refFS[Tab.]{fs:tab:output:getDesignInverseNormal}#' @refFS[Formula]{fs:criticalValuesOBrienFleming}x0 <-getDesignInverseNormal()getUnitTestObject(x0, "x0")
Section title in the document (context for testthat version <3)
#' @exit Do not create the unit tests again#' @context Testing the Group Sequential and Inverse Normal Design Functionality#' @test_that 'getDesignInverseNormal' with default parameters: #' parameters and results are as expected#' @refFS[Tab.]{fs:tab:output:getDesignInverseNormal}#' @refFS[Formula]{fs:criticalValuesOBrienFleming}x0 <-getDesignInverseNormal()getUnitTestObject(x0, "x0")
Unit test title/description
#' @exit Do not create the unit tests again#' @context Testing the Group Sequential and Inverse Normal Design Functionality#' @test_that 'getDesignInverseNormal' with default parameters: #' parameters and results are as expected#' @refFS[Tab.]{fs:tab:output:getDesignInverseNormal}#' @refFS[Formula]{fs:criticalValuesOBrienFleming}x0 <-getDesignInverseNormal()getUnitTestObject(x0, "x0")
Reference to a table in the Functional Specification
#' @exit Do not create the unit tests again#' @context Testing the Group Sequential and Inverse Normal Design Functionality#' @test_that 'getDesignInverseNormal' with default parameters: #' parameters and results are as expected#' @refFS[Tab.]{fs:tab:output:getDesignInverseNormal}#' @refFS[Formula]{fs:criticalValuesOBrienFleming}x0 <-getDesignInverseNormal()getUnitTestObject(x0, "x0")
Reference to a formula in the Functional Specification
#' @exit Do not create the unit tests again#' @context Testing the Group Sequential and Inverse Normal Design Functionality#' @test_that 'getDesignInverseNormal' with default parameters: #' parameters and results are as expected#' @refFS[Tab.]{fs:tab:output:getDesignInverseNormal}#' @refFS[Formula]{fs:criticalValuesOBrienFleming}x0 <-getDesignInverseNormal()getUnitTestObject(x0, "x0")
The function call to be tested
#' @exit Do not create the unit tests again#' @context Testing the Group Sequential and Inverse Normal Design Functionality#' @test_that 'getDesignInverseNormal' with default parameters: #' parameters and results are as expected#' @refFS[Tab.]{fs:tab:output:getDesignInverseNormal}#' @refFS[Formula]{fs:criticalValuesOBrienFleming}x0 <-getDesignInverseNormal()getUnitTestObject(x0, "x0")
Create a unit test for each field of the object x0.