pivot-libre / tideman

Implementation of the Tideman ranked pairs algorithm
Apache License 2.0
9 stars 3 forks source link

Lucas tests#42 #43

Closed carlschroedl closed 7 years ago

carlschroedl commented 7 years ago

This pull request implements MarginCalculator integration tests originally defined in this Google Sheet: https://docs.google.com/spreadsheets/d/1634wP6-N8GG2Fig-yjIOk7vPBn4AijXOrjq6Z2T1K8M/edit?usp=sharing

Some are Lucas' scenarios (#42). Others are from Tideman's 1987 paper.

This pull request only tests MarginCalculator. A subsequent pull request will need to address RankedPairsCalculator. Fortunately, that will be a much more concise set of tests that can rely on the existing TestScenario classes.

This pull request checks in generated code, and the script used to generate it. This is technical debt that needs to be paid by implementing #27 #28 and #29. Once those issues are implemented, we will be able to encode our test input and expected output in more straightforward text formats. At that time we can remove the unhelpful generated code and the code generator. In exchange for the long-term risk of messy test data, we get short-term assurance that margin calculation -- the foundation of this library -- is working correctly in non-trivial scenarios. Since our deadlines are fast-approaching, I think this an acceptable tradeoff.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.1%) to 64.548% when pulling 7284549160c05c44bf4934a79d31113f9534b6d9 on carlschroedl:lucasTests#42 into b4104f88246ea4ee9bc9f294f66ebae2d31d55bc on pivot-libre:0.x.