Validation Tests

DESCRIPTION:

Performs one or more sets of validation tests. The validate.package function runs validation tests included in a package.

USAGE:

validate(file="", test.loc="", verbose=F, outfile="", help=F)
validate.package(package, verbose=F, outfile="", lib.loc=NULL, allFiles=F)

REQUIRED ARGUMENTS:

package
a character string that specified the name of the package to be validated. Required for the validate.package function.

OPTIONAL ARGUMENTS:

file
vector of test file names. If file is not specified, all of the files located in the default test.loc directory will be executed. This argument is required if test.loc specifies a directory other than the default.
test.loc
character string that specifies the location of the test files. The default directory is the splus/lib/validate subdirectory under the S-PLUS home directory. If test.loc is specified, one or more file names must be specified with the file argument.
verbose
logical value that controls the printed output. If TRUE, each test expression will be printed, regardless of whether a test fails. Otherwise, only test expressions for failed tests will be printed. The default is FALSE.
outfile
character string that specifies the name of the output file to which test results will be written. By default, the output is written to the screen.
help
logical value that controls a display of valid test file names and descriptions. This argument is not valid if test.loc is used to specify an alternate test directory. When help=T, a list of valid test files and their corresponding descriptions is displayed for the default test.loc directory.
lib.loc
a character string specifying where to find the package. This is not needed if the package is installed in the one of the default package locations.
allFiles
a logical value, if TRUE, all files in the validate directory will be run. The default is to only run files with a .t file extension.

VALUE:

a logical value. This value is TRUE if all test pass, FALSE if any tests fail.

SIDE EFFECTS:

Test case expressions are written to either the screen or a specified output file. The test expressions to be written are controlled by the verbose argument.

DETAILS:

Each test file contains a set of expressions that are evaluated and return a value of either TRUE or FALSE. The default test files are organized by related functions. Use validate with help=T to display a list of test files for the default test.loc directory.

Each test is self-documenting in that it identifies the high-level function(s) being tested, the source of data, applicable references to published results, and a short description of the test case. All necessary data is also included as part of the test.

A test is considered to pass when each of the values being compared to published or otherwise known results are within a specified tolerance. The tolerance values vary among the tests---the tolerances used for a given test are specified immediately following the description. If one or more comparisons fail, the test fails.

The validate.package function is a front end for the validate function (Note it is not an SV3 method for validate.) It finds the validation files included with the specified package and then calls the main validate function with appropriate values for file and test.loc. The function looks for validation test files in the validate directory under the package directory. Unless allFiles=TRUE, only files with a .t file extension in the validate directory are run.

EXAMPLES:

# Perform analysis of variance and regression validation tests
validate(file=c("anova","regress"))

# Validate hypothesis testing and print all test expressions as
# they are executed
validate("hypotest", verbose=T)

# Execute all validation tests, print text expressions that
# failed and redirect output to the file all.out
validate(outfile ="all.out")