Skip to content

Commit bb21273

Browse files
committed
Update srr
1 parent 1f1393b commit bb21273

File tree

7 files changed

+97
-1
lines changed

7 files changed

+97
-1
lines changed

data-raw/TESTDATA.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
## code to prepare `testdata` dataset
1+
2+
#' @srrstats {G5.0} The data set is a standard data set from a published paper.
3+
#' @srrstats {G5.1} The data set is created within and used to test the package.
4+
#' The data set is exported so that users can confirm tests and run examples.
25

36
testdata <- data.frame(
47
LRU = c(rep("G1", 15), rep("G2", 10)),

tests/testthat/test-srr-duane.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
2+
#' @srrstats {G5.1} The function is tested with a standard data set. The data set is
3+
#' created within and used to test the package. The data set is exported so that users
4+
#' can confirm tests and run examples.
5+
#' @srrstats {G5.2} Unit tests demonstrate error messages and compare results with expected values.
6+
#' @srrstats {G5.2a} Every message produced by `stop()` is unique.
7+
#' @srrstats {G5.2b} Unit tests demonstrate error messages and compare results with expected values.
8+
#' @srrstats {G5.4} Unit tests include correctness tests to test that statistical algorithms produce expected results to some fixed test data sets.
9+
#' @srrstats {G5.4c} Unit tests include stored values that are drawn from a published paper output.
10+
#' @srrstats {G5.5} Correctness tests are run with a fixed random seed.
11+
#' @srrstats {G5.6} Unit tests include parameter recovery checks to test that the implementation produce expected results given data with known properties.
12+
#' @srrstats {G5.6a} Parameter recovery tests are expected to be within a defined tolerance rather than exact values.
13+
#' @srrstats {G5.7} Unit tests include algorithm performance checks to test that the function performs as expected as data changes.
14+
#' @srrstats {G5.8} See sub-tags for responses.
15+
#' @srrstats {G5.8a} Unit tests include checks for zero-length data.
16+
#' @srrstats {G5.8b} Unit tests include checks for unsupported data types.
17+
#' @srrstats {G5.8c} Unit tests include checks for data with 'NA' fields.
18+
#' @srrstats {G5.8d} Unit tests include checks for data outside the scope of the algorithm.
19+
#' @srrstats {G5.9} Unit tests include noise susceptibility tests for expected stochastic behavior.
20+
#' @srrstats {G5.9a} Unit tests check that adding trivial noise to data does not meaningfully change results.
21+
#' @srrstats {G5.9b} Unit tests check that different random seeds do not meaningfully change results.
22+
#' @srrstats {G5.10} All unit tests run as part of continuous integration.
23+
124
set.seed(123)
225

326
test_that("data.frame input works the same as separate vectors", {

tests/testthat/test-srr-gof.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2+
#' @srrstats {G5.2} Unit tests demonstrate error messages and compare results with expected values.
3+
#' @srrstats {G5.2a} Every message produced by `stop()` is unique.
4+
#' @srrstats {G5.2b} Unit tests demonstrate error messages and compare results with expected values.
5+
#' @srrstats {G5.8} See sub-tags for responses.
6+
#' @srrstats {G5.8a} Unit tests include checks for zero-length data.
7+
#' @srrstats {G5.8b} Unit tests include checks for unsupported data types.
8+
#' @srrstats {G5.8c} Unit tests include checks for data with 'NA' fields.
9+
#' @srrstats {G5.8d} Unit tests include checks for data outside the scope of the algorithm.
10+
#' @srrstats {G5.10} All unit tests run as part of continuous integration.
11+
112
test_that("qqplot.rga() errors on invalid inputs", {
213
# Not an rga object
314
expect_error(

tests/testthat/test-srr-rga.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2+
#' @srrstats {G5.0} The function is tested with a standard data set from a published paper.
3+
#' @srrstats {G5.1} The function is tested with a standard data set. The data set is
4+
#' created within and used to test the package. The data set is exported so that users
5+
#' can confirm tests and run examples.
6+
#' @srrstats {G5.2} Unit tests demonstrate error messages and compare results with expected values.
7+
#' @srrstats {G5.2a} Every message produced by `stop()` is unique.
8+
#' @srrstats {G5.2b} Unit tests demonstrate error messages and compare results with expected values.
9+
#' @srrstats {G5.4} Unit tests include correctness tests to test that statistical algorithms produce expected results to some fixed test data sets.
10+
#' @srrstats {G5.4c} Unit tests include stored values that are drawn from a published paper output.
11+
#' @srrstats {G5.5} Correctness tests are run with a fixed random seed.
12+
#' @srrstats {G5.6} Unit tests include parameter recovery checks to test that the implementation produces expected results given data with known properties.
13+
#' @srrstats {G5.6a} Parameter recovery tests are expected to be within a defined tolerance rather than exact values.
14+
#' @srrstats {G5.7} Unit tests include algorithm performance checks to test that the function performs as expected as parameters change.
15+
#' @srrstats {G5.8} See sub-tags for responses.
16+
#' @srrstats {G5.8a} Unit tests include checks for zero-length data.
17+
#' @srrstats {G5.8b} Unit tests include checks for unsupported data types.
18+
#' @srrstats {G5.8c} Unit tests include checks for data with 'NA' fields.
19+
#' @srrstats {G5.8d} Unit tests include checks for data outside the scope of the algorithm.
20+
#' @srrstats {G5.9} Unit tests include noise susceptibility tests for expected stochastic behavior.
21+
#' @srrstats {G5.9a} Unit tests check that adding trivial noise to data does not meaningfully change results.
22+
#' @srrstats {G5.9b} Unit tests check that different random seeds do not meaningfully change results.
23+
#' @srrstats {G5.10} All unit tests run as part of continuous integration.
24+
125
test_that("data.frame input works the same as separate vectors", {
226
times <- c(100, 200, 300)
327
failures <- c(1, 2, 1)

tests/testthat/test-srr-testdata.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
#' @srrstats {G5.1} The data set is created within and used to test the package.
3+
#' The data set is exported so that users can confirm tests and run examples.
4+
#' @srrstats {G5.10} All unit tests run as part of continuous integration.
5+
16
test_that("testdata dataset has expected structure", {
27
data("testdata", package = "ReliaGrowR")
38

tests/testthat/test-srr-weibull_to_rga.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2+
#' @srrstats {G5.2} Unit tests demonstrate error messages and compare results with expected values.
3+
#' @srrstats {G5.2a} Every message produced by `stop()` is unique.
4+
#' @srrstats {G5.2b} Unit tests demonstrate error messages and compare results with expected values.
5+
#' @srrstats {G5.4} Unit tests include correctness tests to test that statistical
6+
#' algorithms produce expected results to some fixed test data sets.
7+
#' @srrstats {G5.5} Correctness tests are run with a fixed random seed.
8+
#' @srrstats {G5.8} See sub-tags for responses.
9+
#' @srrstats {G5.8a} Unit tests include checks for zero-length data.
10+
#' @srrstats {G5.8b} Unit tests include checks for unsupported data types.
11+
#' @srrstats {G5.8c} Unit tests include checks for data with 'NA' fields.
12+
#' @srrstats {G5.8d} Unit tests include checks for data outside the scope of the algorithm.
13+
#' @srrstats {G5.10} All unit tests run as part of continuous integration.
14+
115
test_that("weibull_to_rga() input validation errors", {
216
# failures
317
expect_error(

tests/testthat/test-srr_rdt.R

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2+
#' @srrstats {G5.2} Unit tests demonstrate error messages and compare results with expected values.
3+
#' @srrstats {G5.2a} Every message produced by `stop()` is unique.
4+
#' @srrstats {G5.2b} Unit tests demonstrate error messages and compare results with expected values.
5+
#' @srrstats {G5.4} Unit tests include correctness tests to test that statistical
6+
#' algorithms produce expected results to some fixed test data sets.
7+
#' @srrstats {G5.5} Correctness tests are run with a fixed random seed.
8+
#' @srrstats {G5.8} See sub-tags for responses.
9+
#' @srrstats {G5.8a} Unit tests include checks for zero-length data.
10+
#' @srrstats {G5.8b} Unit tests include checks for unsupported data types.
11+
#' @srrstats {G5.8c} Unit tests include checks for data with 'NA' fields.
12+
#' @srrstats {G5.8d} Unit tests include checks for data outside the scope of the algorithm.
13+
#' @srrstats {G5.9} Unit tests include noise susceptibility tests for expected stochastic behavior.
14+
#' @srrstats {G5.9a} Unit tests check that adding trivial noise to data does not meaningfully change results.
15+
#' @srrstats {G5.10} All unit tests run as part of continuous integration.
16+
117
test_that("rdt() input validation errors", {
218
# target
319
expect_error(

0 commit comments

Comments
 (0)