Validation Methodology — How Every Calculator Is Verified
Content last reviewed · page regenerated 2026-12-03 at build.
Piping Toolset's positioning is deliberately narrow: fast, auditable ASME B31 / BPE calculation reports and design tools for piping engineers — not a replacement for CAESAR II, AutoPIPE, Plant 3D, or hydraulic network solvers. Narrow scope is what makes full verification practical. This page describes exactly how that verification works.
1. One implementation, everywhere
Every calculator is a strictly-typed pure function in a single package
(calc-core). The same code runs in your browser and on the server — there is no
second implementation to drift. A calculator takes explicit inputs, returns explicit outputs
with a PASS/FAIL/computed status and any model-boundary warnings, and touches nothing else.
2. Fixtures are the contract
No calculator module exists without a green fixture: a JSON file holding named cases of exact inputs, expected outputs, the expected verdict, and a numeric tolerance. Three rules govern them:
- Every expected value has a stated provenance, shown module by module on the coverage page: a hand calculation (most show their arithmetic in the fixture description), the PVP Suite validation set (112 checks whose driving inputs were reverse-derived and locked), a published source-sheet, catalog or vendor-report example, an independent implementation written from the code text, a parity port of an earlier validated implementation, or — for the PiperSTR support engines — the engine's own output, frozen into the fixture only after its unit suite validated it.
- A fixture changes only with a recorded reason. When code and a hand-derived fixture disagree, the derivation is re-done on paper first. When an engine-frozen fixture is re-baselined, the change and its reason go into the calculation changelog.
- Verdict paths are fixtures too. Where a calculator renders PASS/FAIL, failing cases are locked alongside passing ones (e.g. the B31G example on this site is a deliberate FAIL).
3. Two harnesses, one fixture set
Two harnesses execute the same fixture JSON through one shared case runner: the project's test
suite, and a standalone verification script with no test framework. Run it from a
checked-out workspace after npm ci, because several calculation modules import the
data-service package:
npm ci npm run verify PASS piping.b313-wall-thickness :: NPS 6 @ 2000 psi, S=20000, Y=0.4, ... ... calc-core: all cases green
Because the runner strips types directly from the production sources, what it verifies is the shipping implementation — not a copy.
4. Red blocks release
Continuous integration runs the type checker, the full test suite, the fixture verification script and the browser smoke tests on every push and every pull request. Production deploys are made by CI from main, and only from a commit where all of it is green.
5. What the worked examples on this site are
Every worked example published on the calculator pages here is a fixture case, shown with its derivation. The numbers you can check by hand on the page are the numbers the release gate asserts on every commit, within each fixture's stated tolerance. The downloadable sample reports are generated from the same cases.
6. What validation does not claim
- Fixtures verify that the implementation computes its documented method correctly. Choosing the applicable code edition, allowable stresses, and factors for your design remains engineering judgment. Code-table data is embedded only where /trust/sources lists it; everything else is user-entered — confirm against your edition.
- Model-boundary conditions (thin-wall validity, z ≤ 20 in B31G, θ ≤ 22.5° miters …) surface as explicit warnings rather than silent extrapolation, and the warning logic is itself fixture-covered where verdicts depend on it.
- Results must be independently verified and reviewed by a qualified engineer before any design, fabrication, or operation decision.
7. Audit it yourself
The fixture coverage table on the coverage page is generated from the live fixture directory at every build — module by module, case counts, tolerances, and governing references. The calculation changelog records every change to calculation behavior with the fixtures that lock it.