# Mirrored Test Placement

> A rule or precondition that a test sits in the concern folder of the file it tests, under a test root mirroring that file's governed root, and moves whenever that file moves.

Record: `architecture:mirrored-test-placement`
Kind: constraint
Layer: [Structural Core](https://banes-lab.com/records/layer/structural-core.md)
Severity: mandatory
Scope: folder, file
Canonical: https://banes-lab.com/ontology#architecture-mirrored-test-placement

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Collision Consolidation](https://banes-lab.com/records/architecture/collision-consolidation.md) and before [Sanctioned Generic Subject](https://banes-lab.com/records/architecture/sanctioned-generic-subject.md).

## Repair

- Refactored by: Move the Test With Its Subject, Split One Test per Subject
- Detected by: a test whose path does not mirror the concern folder of the file it names
- Violated by: leaving a test in its old folder after its subject moves, or keeping one test for several subjects
- Measured by: tests off their mirrored path
- Enforced by: the centralized-test and subjectless-test checks, and the taxonomy step's mirror check

## Requires

- [Compound Marker](https://banes-lab.com/records/lexicon/compound-marker.md)
- [Concern Folder](https://banes-lab.com/records/lexicon/concern-folder.md)

## Reinforces

- [Discoverability](https://banes-lab.com/records/lexicon/discoverability.md)

## Enables

- [Identity Migration](https://banes-lab.com/records/lexicon/identity-migration.md)

## Conflicts with

- [Stranded Test](https://banes-lab.com/records/lexicon/stranded-test.md)

## Severity

- [mandatory](https://banes-lab.com/records/vocabulary/severity-mandatory.md)

## Category

- [Taxonomy / Classification / Naming](https://banes-lab.com/records/architecture-category/taxonomy-classification-naming.md)

## Enforced by

- [rules/eslint/closure-tests-centralized.eslint.rule.ts](https://banes-lab.com/source/governance/rules/eslint/closure-tests-centralized.eslint.rule.ts.md)

## Linked from

- [Quality Attributes](https://banes-lab.com/ontology/lexicon/lexicon-category-quality-attributes.md)
- [Taxonomy / Classification / Naming](https://banes-lab.com/ontology/lexicon/lexicon-category-taxonomy-classification-naming.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)

## Evidence in the code

- [rules/eslint/closure-tests-centralized.eslint.rule.ts](https://banes-lab.com/source/governance/rules/eslint/closure-tests-centralized.eslint.rule.ts.md)
