How we test
How we test the rules
Rules as data, test cases worked out by hand, and the government’s own examples as tests.
Rules first, as data
Each rule is stored as a row: what it applies to, its limit, its window, the clause number, a short quote and the date of the version we read. The calculators read those rows. When the government changes a rule, we change the row and its date, and the result pages show the new version line.
Test cases written by hand, before the code
For every rule we write test cases with the expected answer worked out by hand from the rule text, and the calculator must match all of them before it opens. They include:
- The Home Office’s own examples. The caseworker guidance includes worked Long Residence examples. They will be in our tests word for word, and a release that fails one is stopped.
- The pre-2018 case. Two trips of 100 days in different consecutive 12-month periods do not break continuous residence under CR 3.2, but a rolling count would add them to 200. Our test set includes this case.
- Edges. The day before and the day after each limit (179, 180, 181 days; 184 and 185 for Long Residence).
Counting choices are shown, not hidden
Where the rules leave a counting question open, such as whether the day you leave counts as a day abroad, the result says which way we counted and why.
Rule versions and dates
Every rule page shows the version it applies and the date we last checked it against the government page. Before each release we re-read those pages’ update dates. If a rule has changed, the affected calculator shows a notice and gives no result until we have checked the change.
What is checked today
No calculator is open yet. The worked example on the home page is computed by our build script from the 28-day rule, and the build stops if a date in it is wrong. Its rule version line reads UK-CR 2025-11-11 / guidance v10.0 (2026-10-08), checked November 17, 2026.
Found a mistake?
Email hello@borderalmanac.com with the page and the rule or source. Please don’t send case details.