TorbatYar/docs/development/testing-strategy.md
Mortezakoohjani 12c8615615 Ship enterprise Accounting FE/API with CRUD parity and production wiring.
Adds accounting-service PATCH/archive, fiscal helpers, COA templates and setup status, plus SuperApp Accounting UI (DS, scoreboard, masters, vouchers, ledger, ops modules) with session refresh and HTTPS public API URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 15:26:43 +03:30

1.3 KiB

Testing Strategy

Required Layers

Layer Purpose
Unit Pure domain logic, validators, mappers
Service Business rules with DB/fakes
Repository Query correctness, tenant filters
API HTTP contracts, authz, status codes
Integration Multi-component flows (onboarding, OTP, SSO handoff)
Migration Upgrade/downgrade smoke on clean DB
Tenant Cross-tenant isolation negatives
Performance Hot entitlement/resolve paths as needed
Security Auth bypass attempts, token scope checks
Architecture Boundary rules (optional lint/CI later)
Documentation validation Links, registry completeness for the phase

Rules

  1. New behavior ships with tests in the same phase.
  2. Tenant tests must include at least one cross-tenant denial case for new tenant-scoped APIs.
  3. Do not rely on production data for assertions.
  4. Prefer deterministic time/OTP fakes.
  5. Phase is incomplete if tests fail or are absent for claimed deliverables.

Commands (current)

cd backend/core-service
pytest -q

cd backend/services/identity-access
pytest -q