Testing standards
Use this page when you need to decide which tests and validation evidence a tax behaviour change needs.
Required evidence by change
| Change | Required evidence |
|---|---|
| Fact | schema decode tests, graph validation, type tests if public input types change |
| Rule | source reference validation, graph checks, golden tests, trace snapshots when rule IDs or ledgers change |
| Calculator | schema tests, golden tests, graph validation, API compatibility tests and SDK compatibility tests |
| Tax year | parameter schema validation, effective-date checks, golden tests, API metadata tests and SDK type tests |
| Incorrect result | failing regression first, source citation, passing golden test and compatibility notes |
Test types
Golden tests should use official examples or reviewed scenarios and live with the rule package they validate.
Type tests should prove public SDK descriptors reject unsupported facts, calculator IDs, jurisdictions and tax years at compile time.
API compatibility tests should prove CalculatorRunRequest,
CalculatorRunResponse and route-owned error envelopes still match public
HTTP expectations.
SDK compatibility tests should prove TaxKit.calculate,
TaxKit.safe.calculate, calculateRunRequest, calculateReportRequest,
calculateReport and jurisdiction helpers still infer the expected input,
report and error types.
Commands
Use package-specific commands when your change is local:
bun run --filter=@taxkit/rules-au-pay test
bun run --filter=@taxkit/rules-au-income-tax test
bun run --filter=@taxkit/rules-au-stsl test
bun run --filter=@taxkit/calculators test
bun run --filter=@taxkit/api-http test
bun run --filter=@taxkit/sdk test-typesBefore handoff, run the repository gate:
bun run verificationSource of truth
For the full quality model, read Testing and quality and Testing and validation.