-
Notifications
You must be signed in to change notification settings - Fork 2
Testing
On Travis, the tests are run on Ubuntu 16.04 LTS (Xenial) on both the OpenJDK and Oracle's JDK.
JUnit 5 is used.
Real JSON data from the 6th June 2020 was stored into a file called GlobalSummaryJson.json. In the test classes, this is used as the ground truth data. For example, to test whether the SummaryStats class correctly fetches the total number of deaths worldwide, the SummaryStats class is set to have the JSON read from the ground truth file. Having manually extracted the total number of deaths, this value is compared to the value that SummaryStats provides.
This is a bugbear as it can be cumbersome to extract lots of values manually. A better approach is desired.
Where necessary, reflection to populate private fields. While controversial, the following alternatives have been considered:
- No tests (not good)
- Inner test classes (but separation is good)
- public variables (not good from an encapsulation perspective)
- getters (OK, but they're only needed for the tests)
For the tests, a mixture of both Java's in-built reflection library and Apache Commons is used.