Accuracy & Testing
Last updated March 2026
CalcOnce runs 1372+ automated tests before every deployment. No code change can reach production if any test fails. This page explains how we test, what we test, and where our expected values come from.
How We Test
Our testing process is designed to catch errors before they affect users:
- Write the formula first. Every new calculation begins as a pure function in our centralized formula library — no UI code, no side effects. Just inputs in, outputs out.
- Write tests with known answers. We create a minimum of three test cases with specific expected outputs, plus at least one edge case. Expected values come from authoritative sources, not from running our own code.
- Tests must pass before the UI is built. We never build the calculator interface first and add tests later. The formula is verified before a single pixel is rendered.
- Pre-commit hooks enforce compliance. A git pre-commit hook runs the full test suite automatically. If any test fails, the commit is rejected. No exceptions.
- Continuous verification. When we modify any existing formula, the existing tests must continue to pass. If a formula changes, the test expectations are updated with a cited reason for the change.
What We Test
Our 1372+ tests span every category of calculator on the site. Each test verifies that our formula produces the exact expected output for a given set of inputs.
Construction
80+ testsConcrete volume, lumber board feet, paint coverage, roofing squares, drywall sheets, tile quantities, mulch and gravel volume, insulation R-values, fencing materials, and snow removal estimates.
Reference sources: NHLA standards, manufacturer specifications (Benjamin Moore, GAF, CertainTeed), standard volumetric conversions
View calculators →Finance
100+ testsMortgage amortization, compound interest, loan payments, investment growth, retirement projections, tax brackets, ROI, break-even analysis, credit card payoff, and debt snowball/avalanche.
Reference sources: IRS tax tables, CFPB amortization standards, standard financial mathematics
View calculators →Health & Fitness
90+ testsBMI (imperial and metric), BMR (Mifflin-St Jeor), TDEE, macronutrient ratios, body fat percentage, calorie targets, water intake, heart rate zones, and running pace calculations.
Reference sources: WHO BMI guidelines, Mifflin-St Jeor (1990), Harris-Benedict activity multipliers, ACSM exercise guidelines, NIH dietary reference intakes
View calculators →Math & Statistics
70+ testsStandard deviation (population and sample), confidence intervals, p-values, probability, GCF/LCM, logarithms, exponents, square roots, significant figures, slope, and the Pythagorean theorem.
Reference sources: Standard mathematical definitions, NIST reference values, established statistical methods
View calculators →Date & Time
60+ testsDate differences, business days, moon phases, sunrise/sunset times, time zones, age calculations, due dates, countdowns, week numbers, and weekday determination.
Reference sources: NOAA Solar Calculator, synodic month astronomical constants, Gregorian calendar rules, IANA timezone database
View calculators →Everyday & Conversion
30+ testsUnit conversions, percentage calculations, tip splitting, fuel costs, electricity costs, GPA, and general-purpose math utilities.
Reference sources: NIST conversion factors, BIPM international standards
View calculators →Example Test Cases
Here are representative examples of actual test cases from our suite. Each test specifies exact inputs, the expected output, and the authoritative source for that expected value.
| Category | Formula | Test Input | Expected Output | Source |
|---|---|---|---|---|
| Financial | Mortgage Monthly Payment | $250,000 loan, 6.5% rate, 30 years | $1,580.17/month | Standard amortization formula (CFPB) |
| Construction | Concrete Volume | 20 ft x 20 ft x 4 inches | 4.94 cubic yards | Volumetric conversion (L x W x D/12) / 27 |
| Health | BMI (Imperial) | 180 lbs, 5'10" (70 inches) | 25.83 | WHO BMI formula: (weight x 703) / height^2 |
| Astronomy | Moon Phase | January 29, 2025 | New Moon (age ~0 days) | Verified against timeanddate.com |
| Math | Standard Deviation (Sample) | Dataset: [2, 4, 4, 4, 5, 5, 7, 9] | 2.00 | Textbook statistical formula with Bessel's correction |
| Date/Time | Business Days Between Dates | Jan 1, 2026 to Jan 31, 2026 | 22 business days | Gregorian calendar weekday enumeration |
How We Verify Against Authoritative Sources
Our expected test values are not generated by our own code. They come from independent, authoritative sources. Here is where we look for each category:
- Financial formulas: IRS published tax tables, Consumer Financial Protection Bureau (CFPB) amortization standards, and standard financial mathematics textbooks. Monetary values verified to 2 decimal places (penny precision).
- Health formulas: World Health Organization (WHO) BMI classification thresholds, Mifflin-St Jeor equations from the original 1990 peer-reviewed paper, Harris-Benedict activity multipliers, and NIH dietary reference intakes.
- Construction formulas: National Hardwood Lumber Association (NHLA) board foot standards, paint manufacturer coverage specifications, roofing manufacturer (GAF, CertainTeed) bundle calculations, and standard volumetric conversions.
- Astronomy/date formulas: NOAA Solar Calculator for sunrise/sunset times, timeanddate.com for moon phase verification, and the Gregorian calendar specification for date arithmetic.
- Math/statistics formulas: Standard mathematical definitions, NIST reference values, and established statistical methods from peer-reviewed sources.
- Unit conversions: National Institute of Standards and Technology (NIST) and International Bureau of Weights and Measures (BIPM) defined conversion factors.
Edge Case Testing
Real-world inputs are messy. Users enter zero values, negative numbers, extremely large numbers, and boundary conditions. Our test suite specifically covers these edge cases:
- Zero inputs: What happens when a user enters 0 for a loan amount, a dimension, or a weight? Our formulas handle these gracefully.
- Negative values: Where applicable (e.g., financial losses, temperature conversions), negative values produce correct results.
- Boundary values: BMI at exactly 18.5 and 25.0, tax brackets at the cutoff, leap year dates (Feb 29), and midnight timezone crossings.
- Extreme values: Very large loan amounts, very small percentages, 100-year age calculations, and multi-decade compound interest projections.
- Precision: Financial calculations must be accurate to the penny. Scientific calculations use appropriate significant figures. Trigonometric functions convert degrees to radians correctly.
What Happens When a Test Fails
Our system is designed to prevent formula errors from reaching users:
- A developer makes a code change.
- The pre-commit hook automatically runs all 1372+ tests.
- If any test fails, the commit is blocked. The code cannot be saved to the repository.
- The developer must either fix the formula to pass the existing test, or — if the test expectation itself was wrong — update the test with a cited correction from an authoritative source.
- Only after all tests pass can the change proceed.
This means there is no window during which a broken formula is live on the site. The formula either passes verification or it does not ship.
Report an Accuracy Issue
If you find a discrepancy between our calculator output and a verified authoritative source, we want to know. Our commitment is to investigate every report and correct any confirmed errors immediately.
When reporting an issue, please include:
- Which calculator you used
- The exact inputs you entered
- The output our calculator produced
- The expected correct value and its source