Quality Assurance

Zero-Mock Testing Policy

The repository policy prohibits mock frameworks such as unittest.mock, MagicMock, and patch decorators [martin2008clean; meszaros2007xunit]. A static gate rejects those imports, and a separate inventory surfaces semantic dependency-replacement patterns for review. Tests that require external services (Ollama or public networks) use explicit pytest.mark markers for conditional execution; deterministic network tests use real local HTTP servers. The philosophical motivation—analogizing excessive interaction mocking to Simmons et al.’s researcher degrees of freedom [simmons2011falsepositive] and the preregistration remedy [nosek2018preregistration]—is developed fully in the Zero-Mock Tradeoff discussion.

The following example, drawn from this meta-project’s own suite, illustrates zero-mock compliance:

def test_core_module_present(self):
    # Real filesystem, real YAML parsing — no MagicMock anywhere
    modules = discover_infrastructure_modules(REPO_ROOT)
    names = [m.name for m in modules]
    assert "core" in names, f"'core' not found in {names}"

This test (tests/core/test_meta.py::TestDiscoverInfrastructureModules::test_core_module_present) exercises the real discover_infrastructure_modules function against the real repository root. There are no mock objects substituting for the directory walk, no patched YAML parsers, and no synthetic return values—the test passes only if the infrastructure modules genuinely exist and are discoverable at their expected paths.

Coverage Thresholds

The pipeline enforces two coverage tiers:

Tier Scope Minimum Current Rationale
Project projects/*/src/ 90% Reported by the current test artifact Domain code must be thoroughly validated
Infrastructure infrastructure/ 60% Reported by the current test artifact Broader shared surface

These thresholds are enforced at Stage 01 of the pipeline. A project test run below its declared 90% floor fails before downstream publication stages. This manuscript deliberately does not quote an achieved coverage percentage unless a fresh coverage artifact supplies it.

Test Suite Composition

The repository maintains three test suites:

Visualization Standards

All generated figures must meet accessibility requirements:

The tests/figures/test_architecture_viz.py suite verifies that each real figure generator writes a non-empty PNG and that the comparative matrix has its declared shape and value domain. The font and render-resolution values above are injected from src/template_template/figures/viz_palette.py, preventing prose and implementation from drifting even though visual accessibility still requires human inspection of rendered figures.