Does the testing cover every situation?
No. No set of tests can try every possible tax return.
The calculator accepts 150 different answers, most of them any amount of money. It covers 4 tax years and 2 sets of Income Tax rates, so the number of possible returns has no practical end.
So the calculator is tested in 5 different ways. Each way finds mistakes the others can miss.
| Way of testing | Size | Result |
|---|---|---|
| 1. Hand-worked customersMade-up customers covering every kind of income, relief and charge. Every figure was worked out by hand from GOV.UK and legislation. | 137 customers, 381 figures | All passed |
| 2. ThresholdsEvery threshold, for every tax year, at the threshold and just over it. | 496 checks on 53 rules | All passed |
| 3. A separate calculationRandom customers worked out again by a second calculation, written separately from the service. Both must agree to the penny. | 25,000 customers, 300,000 figures | All agree |
| 4. Any answersRandom customers giving any of the answers in any combination. The calculator must work it out or say which answer is wrong, and the totals must add up. | 30,000 customers | None broke |
| 5. Code coverageHow much of the calculation code the tests run. | 97.5% | 2192 of 2229 lines, 666 of 702 branches |
What the testing found
These tests found 3 mistakes in the calculator, which have been put right. The hand-worked customers had not found them.
Allowances were not always set against income in the way that gives the lowest tax
Found by the separate calculation. The law says the Personal Allowance must be set against income in the way that gives the lowest tax (Income Tax Act 2007 section 25(2)). The calculator only tried setting it against one kind of income at a time. It now also tries splitting it. Examples: £8,000 of interest and £20,000 of dividends was £1,006.38 and is now £781.38. A pensioner with £3,000 pension, £9,000 interest and £15,000 dividends was overcharged £337.50. Some higher rate taxpayers with interest were overcharged up to £100.
Payments on account when exactly 80% of the tax was paid at source
Found by the threshold tests. Payments on account are needed unless more than 80% of the tax was paid at source (Taxes Management Act 1970 section 59A(1)(d), and GOV.UK). At exactly 80% the calculator said none were needed. It now says they are.
Late payment penalties at 6 and 12 months started 2 days early
Found by the threshold tests. The 6-month and 12-month penalties are counted from the penalty date, 31 days after the bill was due (Finance Act 2009 Schedule 56). For a bill due on 31 January 2027 they start on 3 August 2027 and 3 February 2028, not 1 August and 1 February.
The end-to-end persona tests found other problems with the question pages and services. Those are listed with the journeys.
The separate calculation
A second calculation was written from the law and GOV.UK guidance without using any of the calculator's code. It works out:
- Income Tax on pay, self-employment, property with mortgage interest, pensions, interest and dividends, in England, Wales and Northern Ireland and in Scotland
- the Personal Allowance and its taper, Blind Person's Allowance, Gift Aid and pension contributions
- the High Income Child Benefit Charge, Class 2 and Class 4 National Insurance, and student and postgraduate loans
- Capital Gains Tax on homes and other assets
- the balance to pay and payments on account
Random customers are made for each tax year, with and without Scottish Income Tax. Each answer is left out, given an ordinary amount, or given an amount at or £1 either side of a threshold. A third of the customers are retired or live on savings and investments. For each customer these 12 figures are compared:
- Income Tax
- High Income Child Benefit Charge
- Gift Aid tax shortfall
- Class 2 National Insurance
- Class 4 National Insurance
- Student loan repayments
- Capital Gains Tax
- Personal Allowance (with any Blind Person's Allowance)
- Total tax for the year
- Balance to pay or refund
- Payments on account needed
- Each payment on account
| Tax year | Income Tax rates | Customers | Result |
|---|---|---|---|
| 2023 to 2024 | England, Wales and Northern Ireland | 2,500 | All agree |
| 2023 to 2024 | Scotland | 2,500 | All agree |
| 2024 to 2025 | England, Wales and Northern Ireland | 2,500 | All agree |
| 2024 to 2025 | Scotland | 2,500 | All agree |
| 2025 to 2026 | England, Wales and Northern Ireland | 2,500 | All agree |
| 2025 to 2026 | Scotland | 2,500 | All agree |
| 2026 to 2027 | England, Wales and Northern Ireland | 2,500 | All agree |
| 2026 to 2027 | Scotland | 2,500 | All agree |
| 2027 to 2028 | England, Wales and Northern Ireland | 2,500 | All agree |
| 2027 to 2028 | Scotland | 2,500 | All agree |
The way the separate calculation finds the lowest tax was itself checked by trying every way of splitting the allowance, in £10 steps.
Any answers
30,000 random customers each gave a random mix of the 150 answers the calculator accepts, with any allowed value. Together they used all 150 answers.
- 16,436 were worked out, and the totals added up
- 13,564 were told which answer could not be used, for example a furnished holiday let after the rules ended in April 2025
- 0 broke the calculator
The tests also check that more pay never means less tax, and that the API gives the same figures as the calculator.
Code coverage
The tests run 97.5% of the calculation code. This counts lines and decision points (branches). Most of what is not run checks for things the question pages and API already prevent.
| Part | Lines run | Branches run | Coverage |
|---|---|---|---|
| aggregate.py | 287 of 290 | 83 of 86 | 98.4% |
| bands.py | 221 of 223 | 58 of 60 | 98.6% |
| calculator.py | 204 of 204 | 73 of 74 | 99.6% |
| cgt.py | 140 of 140 | 50 of 52 | 99.0% |
| corporation_tax.py | 32 of 32 | 4 of 4 | 100.0% |
| employment.py | 77 of 78 | 26 of 28 | 97.2% |
| income_tax.py | 188 of 190 | 40 of 42 | 98.3% |
| mtd.py | 335 of 348 | 106 of 118 | 94.6% |
| nics.py | 38 of 39 | 19 of 20 | 96.6% |
| pensions.py | 60 of 60 | 13 of 14 | 98.6% |
| property.py | 70 of 70 | 20 of 20 | 100.0% |
| quick.py | 68 of 82 | 19 of 26 | 80.6% |
| schedule.py | 90 of 90 | 29 of 30 | 99.2% |
| settlement.py | 188 of 189 | 72 of 74 | 98.9% |
| student_loans.py | 63 of 63 | 12 of 12 | 100.0% |
| trading.py | 131 of 131 | 42 of 42 | 100.0% |
What the calculator does not work out
These can appear on a Self Assessment return but the calculator does not work them out. People with them should check their figures with HMRC or an adviser.
- Splitting a tax year when you moved to or from the UK
- Customers enter only the income for the part of the year they lived in the UK.
- Overseas Workday Relief and the Seafarers' Earnings Deduction
- Foreign tax on foreign income is relieved, but these are not worked out.
- Reliefs that change a gain
- Private Residence Relief, gift hold-over relief, roll-over relief and EIS deferral relief. Customers enter the gain after these.
- Carrying a loss back to an earlier year
- Trading losses can be set against other income this year or carried forward, not carried back.
- Pension lump sums and unauthorised payments
- Lump sums over the lump sum allowance, unauthorised payment charges and the overseas transfer charge are not worked out.
- Some kinds of income
- Income from trusts other than discretionary trusts, the accrued income scheme, deeply discounted securities, offshore fund gains, and receipts after a business stops.
- Changes during the year
- Marrying during the year (Married Couple's Allowance is not reduced for the months before), or a change of partner for the High Income Child Benefit Charge.
- Other penalties and interest
- Penalties for errors or for not telling HMRC about income, and interest on refunds.
- Returns for other kinds of taxpayer
- Estates in administration. Partnership profits, trusts' Income Tax and Corporation Tax are separate tools; their Capital Gains Tax is not worked out.
What the tests cannot show
- That HMRC's own calculation gives the same answer every time. Before going live, the test customers should be run through HMRC's calculation in HMRC's sandbox. That needs HMRC developer access.
- Rate changes after the rates were last checked against GOV.UK. The date is on the tax rates page.
- That every customer understands the questions. That needs research with users.