Skip to content

Add property-based tests for import-boundary layer-pair matrix (fast-check) #4

Description

@coderabbitai

Background

PR #3 introduced architectural boundary invariants enforced by scripts/import-boundaries.ts over a 5×5 layer-pair matrix (domain, application, adapters, app, other). The current test suite uses only example-based cases and does not exhaustively verify all 25 import-direction combinations.

Requested work

Add property-based tests using fast-check to tests/import-boundaries.test.ts (or a new tests/import-boundaries.property.test.ts) that:

  1. Generate arbitrary source-file pairs (sourceLayer, targetLayer) drawn from the full 5×5 matrix.
  2. Assert that findBoundaryViolations emits a violation if and only if the pair is in the forbidden set.
  3. Cover all 25 combinations, including self-imports (e.g. domain → domain).

Provide rigorous reasoning or a proof sketch if any range-sensitive invariant makes exhaustive property testing unnecessary.

Acceptance criteria

  • bun test passes including the new property-based tests.
  • All 25 layer-pair combinations are covered.
  • No dependency on example fixtures for coverage of the boundary rule logic.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions