15 — Testing Standards

Status: Ratified Version: 1.0.0 Applies to: All code, tests/, CI gates, golden datasets


1. Testing Pyramid

          acceptance (E2E, few)
         integration (adapters, API, DB)
        unit (many, fast, isolated)
      component (per subsystem, in-process)
    ────────────────────────────────────
    golden (regression datasets, cross-layer)
Level Scope Environment Speed
unit functions/classes in isolation in-memory, no I/O < 50ms each
component one subsystem with ports faked in-process < 1s
integration real adapters (DB, queue, tool binaries) dockerized/CI services seconds
golden parser→normalizer→store pipelines fixtures seconds
acceptance full mission on sandboxed target e2e compose minutes
performance benchmarks & load dedicated hours (nightly)

2. Unit Tests


3. Integration Tests


4. Regression Tests


5. Performance Tests


6. Security Tests


7. Golden Dataset

Located data/golden/. Structure:

data/golden/
├── tools/<tool-id>/
│   ├── input_<case>.txt|jsonl      # raw tool output fixture
│   └── expected_<case>.json         # expected canonical events
└── workflows/<workflow-id>/         # end-to-end pipeline goldens

Rules:


8. Acceptance Tests


9. Coverage Requirements

Area Minimum coverage
domain 95%
application 85%
engines 80%
infrastructure (non-boilerplate) 70%
tools/adapters (per tool) 80% of parser+normalizer+adapter

10. Test Doubles


11. CI Execution

Stage Command Gate
Lint/format ruff check, ruff format --check must pass
Types mypy --strict must pass
Architecture import-linter rules must pass
Unit pytest tests/unit must pass, coverage gates
Golden pytest tests/golden must pass
Component pytest tests/component must pass
Integration pytest tests/integration must pass (services up)
Security pytest tests/security must pass
Performance smoke benchmarks subset regress ≤ 10%
Acceptance nightly / release must pass
Coverage aggregate meet thresholds

12. Local Testing Commands

pytest                                   # default: unit+golden+component
pytest -m integration                    # integration (needs services)
pytest -m tools                          # real tool binaries
pytest -m security                       # security suite
pytest -m perf --benchmark-enable        # performance subset

13. References