Methodology
Last updated: 2026-04-27. This page documents how infoz.com calculators are designed, tested, and maintained. The underlying code is open in our public repository and the test cases are checked into version control alongside it.
1. Architecture
Each calculator has three layers, each with a single responsibility:
- Pure calculation logic — a TypeScript function in
lib/calculators/[name]/. No DOM access, no state, no I/O beyond reading the bundled rules JSON. Runtime input validation via zod. - UI component — a React client component in
components/calculators/[name]/. Renders the form, hosts a debounced live update viauseMemo, and shows the result panel and breakdown tables. - Page wrapper — a Next.js route in
app/(tools)/.../page.tsx. Sets metadata, renders schema.org JSON-LD, and assembles the disclaimer banner, methodology block, sources, FAQ, and disclaimer block.
2. Tax data files
Bracket schedules, contribution limits, and other year-specific rules live in versioned JSON under data/tax-rules/[country-year].json. Each file includes:
- The tax year it applies to.
- The primary source URL (typically a government publication).
- One or more secondary sources for cross-reference (Tax Foundation, IFS, etc.).
- The date the figures were last verified by a human reviewer.
- Notes documenting known gotchas, scope limits, and overrides.
3. Currency math
Calculator output is presented to whole dollars / pounds / cents per each country's convention. Internally, we use floating-point arithmetic; we round at the boundary (the final result, plus per-period and per-bracket snapshots). For multi-decade projections, residual floating-point drift over hundreds of iterations is sub-dollar.
4. Testing
Every calculator ships with a test suite in tests/calculators/run by Vitest. Coverage thresholds are configured at 90% for lib/calculators/; the build does not pass below that.
Tests cover at minimum:
- Zero-input degenerate cases.
- One worked-through-by-hand reference case per calculator with manual arithmetic shown in the test description.
- Edge cases at every bracket boundary.
- Input validation (rejection of negative, nonsensical inputs).
- Provenance metadata on the result object.
5. “Last reviewed” convention
Every calculator and data page surfaces a Last reviewed date prominently. This is the date a human reviewer last verified the underlying figures against the primary source. Note this is distinct from the “data refreshed” date — automated refreshes (when we add them) update the underlying numbers; only human review updates the last-reviewed date.
6. Refresh cadence
The intended cadence:
- Tax data — manually reviewed each November / January (start of tax-year season for most jurisdictions). Mid-year legislative changes are flagged as soon as we detect them.
- Currency rates and macro data — daily refresh from ECB / FRED / similar (when programmatic refresh is wired up).
- SEC EDGAR filings — daily Form 4 / 8-K poll, with quarterly DEF 14A and 10-Q reconciliation (when the people/company vertical is launched).
- Cost-of-living indices — quarterly refresh from Numbeo or the equivalent.
- Long-form guides — annual review of every guide; tier-1 guides reviewed monthly.
7. Sources
Every calculator page lists its specific sources in a dedicated Sources block. The site-wide list of all authoritative datasets, with last-checked dates, lives at /sources.
8. Disclaimers
Calculators surface a comprehensive disclaimer block (assumptions, explicit “not covered” list, no-warranty / no-liability language). The full site-wide legal disclaimer is at /disclaimer. Editorial standards are documented at /editorial-policy.
9. Open issues and limitations
We document known scope limits transparently. Examples:
- The Canada calculator currently covers federal tax only; provincial / territorial overlays are not yet implemented.
- The mortgage calculator handles fixed-rate loans only; ARM and balloon variants are not modeled.
- The 4% safe-withdrawal rate in the FIRE calculator is a historical US-equity-market heuristic, not a guarantee.
Each calculator page repeats its specific limits in its disclaimer block.