You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#67 does some restructuring related to this issue title within the scope of the bootstrap related functions, their counter parameter functions (e.g., define_boot_table vs define_param_table), and a couple nested helper functions. However there is a strong need to update and redefine some of the tests in this package, along with making the documentation a bit more clear in a few cases.
Tests
setup.R and code snippets above tests (top of a script) need to be better organized so it's clear which variables come from outside of a given test.
I think we can (and should) remove the variables defined at the top of tests in most cases (they should be done within a test in most cases)
Variable names in setup.R and individual tests could be better. E.g., paramEst vs nonbootEst, when in reality they are both the parameter estimates, just for different models. If we need to reference both, better names would be param_est_102 and param_est_106
There were cases where testing for a particular error wasn't being done properly. In the example below, we should be expecting a specific error (and not using capture.output), like expect_error(func(a,b), "Incorrect argument supplied"). I addressed some of these in #67, but in general I think we need to make sure we're properly capturing the expectation.
test_that("define_boot_table incorrect input type: no parameter_names column",{
boot_paramEst2<-boot_paramEst
colnames(boot_paramEst2)[colnames(boot_paramEst2) =="run"] ="no_name"# This line is problematic
expect_error(capture.output(define_boot_table(boot_paramEst2, paramKey)))
})
Tests like this should be done in a separate test file for loadParamKey. There is a duplicate one for define_boot_table. We really only need to write tests for functionality that this new function is responsible for (e.g., we dont need to test that digits are done right if just passed to pmtables::sig(). Integration tests can be fine, but there are redundancies in a few spots.
Misc recommendations
Function naming should be consistent, whether internal or exported. E.g., getCV_lognormO vs define_boot_table. IMO they should both use underscores and be all lower case moving forward, but I would want a second opinion here as to whether it makes sense to update existing internal functions.
Reduce the number of times system.file() is called. If most stem from a particular directory, call it once and make the other file paths relative to that one. This is needed for some examples as well.
The text was updated successfully, but these errors were encountered:
#67 does some restructuring related to this issue title within the scope of the bootstrap related functions, their counter parameter functions (e.g.,
define_boot_table
vsdefine_param_table
), and a couple nested helper functions. However there is a strong need to update and redefine some of the tests in this package, along with making the documentation a bit more clear in a few cases.Tests
setup.R
and code snippets above tests (top of a script) need to be better organized so it's clear which variables come from outside of a given test.setup.R
and individual tests could be better. E.g.,paramEst
vsnonbootEst
, when in reality they are both the parameter estimates, just for different models. If we need to reference both, better names would beparam_est_102
andparam_est_106
capture.output
), likeexpect_error(func(a,b), "Incorrect argument supplied")
. I addressed some of these in #67, but in general I think we need to make sure we're properly capturing the expectation.loadParamKey
. There is a duplicate one fordefine_boot_table
. We really only need to write tests for functionality that this new function is responsible for (e.g., we dont need to test thatdigits
are done right if just passed topmtables::sig()
. Integration tests can be fine, but there are redundancies in a few spots.Misc recommendations
getCV_lognormO
vsdefine_boot_table
. IMO they should both use underscores and be all lower case moving forward, but I would want a second opinion here as to whether it makes sense to update existing internal functions.system.file()
is called. If most stem from a particular directory, call it once and make the other file paths relative to that one. This is needed for some examples as well.The text was updated successfully, but these errors were encountered: