tame/progtest
Mike Gerwitz c062cc5a5c progtest: Check inputs against known params
This aims to prevent needlessly wasted time debugging a non-working test
case, and to avoid writing incorrect test cases that happen to succeed even
though their inputs aren't properly defined.

For example, a common error is to use the name of a bucket field rather than
the name of the param that it maps to.

* progtest/src/TestRunner.js (_verifyKnownParams): New method.
  (_tryRun): Use it.
* progtest/test/TestRunnerTest.js: New test case.  Modify existing test
   cases to define used params.
* progtest/test/_stub/program.js (exports.rater.params): Declare used param.
2019-02-26 11:10:25 -05:00
..
bin Copyright year simplification and update to Ryan Specialty Group 2019-02-07 13:23:09 -05:00
build-aux Copyright year simplification and update to Ryan Specialty Group 2019-02-07 13:23:09 -05:00
src progtest: Check inputs against known params 2019-02-26 11:10:25 -05:00
test progtest: Check inputs against known params 2019-02-26 11:10:25 -05:00
.gitignore progtest: Add runner script 2018-03-05 15:57:38 -05:00
Makefile.am Copyright year simplification and update to Ryan Specialty Group 2019-02-07 13:23:09 -05:00
README.md Copyright year simplification and update to Ryan Specialty Group 2019-02-07 13:23:09 -05:00
autogen.sh Copyright year simplification and update to Ryan Specialty Group 2019-02-07 13:23:09 -05:00
configure.ac Copyright year simplification and update to Ryan Specialty Group 2019-02-07 13:23:09 -05:00
package.json Copyright year simplification and update to Ryan Specialty Group 2019-02-07 13:23:09 -05:00

README.md

Program Testing

A /program/ is a top-level package (either marked as with @program="true", or with a root rater node). This system provides a means of writing and running test cases.

Test Case Format

Test cases must be provided in a YAML file. Each test case has a description (description), input data (data), and expected results (expect).

- description: >-
    Example test case    
  data:
    state:              [ STATE_AK ]
    prem_total:         [ 9000 ]
    effective_date:     12/05/2017
  expect:
    premTaxStamping: [ 1234 ]
    premTaxSurplus:  [ 1010 ]

A file may contain any number of test cases. All identifiers in data and expect must be valid inputs (params) and outputs (classifications and calculations) respectively. Inputs are passed as-is to the program, and outputs are recursively (deeply) compared.