Software Testing / Learning brief
Tom checks the till receipt
In simple terms / 01
What this means in plain language
A till receipt can be pence out though no line is wrong. Tom checks a three-line Daily List invoice, finds a one-cent gap from rounding, a lost cent from a float and a yen amount with decimals.
Complete lesson / 02
Understand the full idea, step by step
A shop till rounds each line up by half a penny. The lines look fine. But the total at the bottom is two pence more than the real sum. No line is wrong. The mistake comes from rounding many small parts.
Tom, the tester, checks the Daily List invoice for the same trap. He picks amounts that make the traps show.
Evidence & review / 03
Evidence & review
The date on this lesson is when it went up on Payments Signal, not when its material was written — most of these were brought across from an earlier catalogue in a single run, which is why so many of them share a date. What the lesson says about the world is dated by the review above and by the sources below it.
Minor unit, floating-point error and currency code as taught in this academy. The people and the Daily List app are invented.
What this brief simplifies: Fiction labelled SYNTHETIC / TRAINING ONLY. Sources were seen only as search excerpts. The sums were run in Python. Tax rules of any one country were not searched, and the claim that tax rules often allow a choice rests on a vendor note.
Sources for this brief — 8 sources
- Market practice
What Every Programmer Should Know About Floating-Point Arithmetic (The Floating-Point Guide) ↗ — floating-point-gui.de · Binary floating-point cannot store decimals such as 0.1 exactly, and money is better held in a decimal type or in whole cents (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number found. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
decimal: Decimal fixed point and floating point arithmetic (Python documentation) ↗ — Python Software Foundation · Decimal numbers can be represented exactly, unlike binary floats; the module gives control over rounding; build a Decimal from a string, not from a float (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
CPython issue 83305 on the behaviour of round() (Python bug tracker) ↗ — Python Software Foundation (CPython issue tracker) · The note on round() says results for floats can be surprising because most decimal fractions cannot be stored exactly; round(2.675, 2) gives 2.67 (search excerpt of an issue page, live documentation not seen)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
ISO 4217 — Currency codes ↗ — International Organization for Standardization · Defines three-letter currency codes and the minor unit of each currency, which the lists in the standard give per currency (search excerpt, page not opened)
Search excerpts only, page not opened. The per-currency code and minor-unit values are maintained in the standard's own lists and are revised as currencies change; look a currency up in the current list rather than quoting a decimal count from memory. ISO makes the currency codes available free of charge, but the full standard text is a paid publication.
- Market practice
Why is the value added tax (VAT) amount not 20% of the invoice total? (ExpensePlus support) ↗ — ExpensePlus · Tax is usually worked out per line, so rounded line amounts can add up to a different figure than tax on the invoice total (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Choose the invoice rounding strategy (OfficeRnD help) ↗ — OfficeRnD · A product offers line-level rounding by default and total-level rounding as an alternative, and the two can differ by a cent on the same invoice (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Adyen — Currency codes and minor units ↗ — Adyen · A payment provider lists zero-decimal currencies such as JPY and three-decimal currencies such as BHD, and notes its table differs from the ISO 4217 list for a few currencies (search excerpt, page not opened)
Provider documentation retrieved through ordinary web search on the access date. Interview cases are original hypothetical extensions of candidate-reported gateway design themes. Locator: Minor units; Different number of digits after the point.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.