12 — Test Strategy
Principle
The most important property is that Burrow™ never damages user data.
Test Layers
Unit Tests
Cover:
- storage-state derivation;
- protection-state derivation;
- duplicate grouping;
- reclaimable-byte calculations;
- exclusions;
- recommendation reason codes;
- safety-gate decisions.
Filesystem Fixture Tests
Generate temporary trees containing:
- duplicate files;
- same-name/different-content files;
- zero-byte files;
- large sparse files where useful;
- Unicode names;
- hidden files;
- symlinks and cycles;
- packages;
- nested directories;
- permission-denied cases where feasible;
- files changed during scan.
Integration Tests
Exercise:
- SQLite migrations;
- scanner → catalog;
- hash cache invalidation;
- engine API;
- UI API client.
Cloud-Fixture Tests
Use controlled mock/fixture metadata for:
- iCloud cloud-only/downloaded states;
- OneDrive placeholder/local states;
- unavailable content.
Do not depend on the owner's live cloud data for automated tests.
Mutation Safety Test
For v0.1:
- generate fixture tree;
- record metadata/content hashes;
- run complete scan/analysis;
- compare fixture tree afterward;
- fail if any user-fixture content/path/metadata was modified unexpectedly.
FixtureGenerator and MutationSafetyHarness in BurrowEngine implement this check. Fixtures are created only under a generated temporary directory. The harness refuses $HOME, iCloud Drive, OneDrive, and non-temp volumes, then snapshots metadata and content hashes, runs a callback, and fails if path, bytes, or metadata changed.
Backup Tests — Future
Test only within temporary source/destination directories or dedicated disposable test volumes.
Cover:
- successful copy/verify;
- insufficient capacity;
- destination disappears mid-run;
- hash mismatch;
- interrupted run;
- source changes during copy.
Archive Tests — Future
Cover transactional behavior and prove source remains when verification fails.
Performance Tests
Create synthetic trees with large file counts and measure:
- enumeration throughput;
- memory usage;
- DB write behavior;
- cancellation latency;
- hashing concurrency.
Regression Corpus
Maintain a deterministic fixture corpus so changes to duplicate/recommendation logic can be compared between versions.
Real Storage Validation
Owner may run read-only builds against actual storage. Treat those runs as validation, not automated tests. Capture sanitized statistics rather than committing personal paths/data to the repository.