All research
03 / Testing
A calculator that is quietly wrong is worse than none
Money pages assert the thresholds and the rounding, and read the rates out of the source instead of carrying a second copy of them.
Money pages get tests, because nobody checks arithmetic they came to the page to avoid doing. Each one asserts the thresholds and the rounding, including the awkward cases: the month with an extra day, the year boundary, the salary just under a bracket edge.
The test reads the rates out of the source file rather than keeping its own copy. A test that carries a duplicate constant keeps passing after the constant changes, which is the same as no test at all.