From b707e466c81c3a34831aed1519e93e9a0a3ff2b9 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Fri, 4 Dec 2026 11:23:21 +0100 Subject: [PATCH] docs: AGENTS.md's testing policy: a test only for a regression that matters and nothing else covers, so the suite stays small --- AGENTS.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index e2dbb14..754e9cb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,6 +58,34 @@ Each file and folder, and where new code goes: [the repository](docs/develop/lay How My Headset is put into development mode, reached, flashed and brought back to stock, in a few lines here as it is found; the walkthrough and its traps: [working on the headset](docs/develop/hardware.md). +## Testing policy + +Tests are a maintenance liability unless they provide meaningful regression protection. + +- Write the minimum number of tests necessary to verify meaningful behavior. +- Test behavior and contracts, not implementation details. +- Do not test static text, labels, constants, styling, or hardcoded configuration unless explicitly required by a + specification. +- Do not write tests asserting the absence of intentionally removed features, files, functions, or fields unless + their absence is an active security or compatibility requirement. +- Remove obsolete tests when their corresponding functionality is intentionally removed. +- Do not test private helpers, trivial getters, or framework functionality without a concrete reason. +- Do not duplicate coverage already provided by existing tests. +- Do not reproduce production logic inside test assertions. +- Do not add tests solely to increase coverage metrics. +- Prefer extending or consolidating existing tests over creating new ones. +- Never remove or weaken tests merely to make a failing build pass. + +Before adding a test, answer: + +1. What concrete regression would this test detect? +2. Would this regression matter to a user or system consumer? +3. Is this behavior already covered? +4. Would the test survive a behavior-preserving refactor? + +If a test cannot be justified, do not write it. Adding zero tests is an acceptable outcome. Before completing a task, +review all new and modified tests and remove unnecessary, redundant, brittle, or obsolete assertions. + ## Changes A branch and a pull request against `main`, titled as a conventional commit; merged by rebase or squash once `ci`