From 1888a62ff99b85f3b71e906e6cc3575a68f6142b Mon Sep 17 00:00:00 2001 From: Rue <343175018+thatsrue@users.noreply.github.com> Date: Tue, 3 Nov 2026 07:05:05 -0500 Subject: [PATCH 1/6] docs(testing): test the critical path and its failures, fewer tests, and keep them fast --- docs/testing.md | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/docs/testing.md b/docs/testing.md index d3990a3..b6621d0 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1,23 +1,46 @@ # Testing -How tests in these repos are written. A test earns its place by failing when something users rely on breaks. +How tests in these repos are written. A test earns its place by failing when something users rely on breaks, and by doing that fast. Fewer, sharper tests beat many. -## Rules +## What to test -1. Before adding a test, name the regression it fails on. If a test already fails on it, extend that test. A fix gets one or two such tests where the bug lives, not one per layer. -2. Call the code the way its users do and assert what they see: return value, output, exit code, file written, message sent. Not which internal calls were made. -3. Use real code. Fake only what a test can't run: network, clock, model, external commands and services. A fake may return what the real one would, errors included; it must not supply the behavior the test asserts. Check a fake's calls only when the outcome can't be checked, or the count or order is the behavior (a cache that saves a request). -4. Match exact text only when the text is a contract: another program parses it, or the text is the product (a help page, a prompt, a message a person receives). Otherwise check the level, exit code or field that matters. +1. Test the critical path and how it fails: the main thing users do, each failure they can see (an error, a refusal, a non-zero exit) and each boundary the code branches on. Spend tests where a break is likely or costly. Test behaviors, not methods: one behavior per test. +2. Before adding a test, name the regression it fails on. If a test already fails on it, extend that test. A fix gets one or two such tests where the bug lives, not one per layer. + +## How many + +3. Inputs that take the same path are one table-driven test, one row each (`t.Run` over a table, `pytest.mark.parametrize`, `test.each`, Swift Testing `arguments:`). A row needs its own partition or boundary. A test that fails on the same change as an existing one is a duplicate: don't add it. +4. Never add a test only to raise a coverage number. Coverage says a line ran, not that its result was checked. If a coverage gate forces a test, say so in the pull request. + +## How a test checks + +5. Call the code the way its users do and assert what they see: return value, output, exit code, file written, message sent. Not which internal calls were made. A test that restates the code (call order, a structural snapshot) fails on every refactor and catches nothing. +6. Use real code. Fake only what a test can't run: network, clock, model, external commands and services. A fake may return what the real one would, errors included; it must not supply the behavior the test asserts. Check a fake's calls only when the outcome can't be checked, or the count or order is the behavior (a cache that saves a request). +7. Match exact text only when the text is a contract: another program parses it, or the text is the product (a help page, a prompt, a message a person receives). Otherwise check the level, exit code or field that matters. + +## Speed + +8. Write small tests: one process, no network, no sleep. Use a medium test (child processes, localhost, temp files) only when the boundary is the behavior: a CLI's exit code and output, a file the program must write, a hook's input and output. +9. No sleep unless elapsed time is the behavior. Wait for the event (a file, a message, an exit) or inject the clock. +10. A test touches only what it declares: its own temp directory and `HOME`, and fakes for host tools it doesn't test. No fixed path, port or global shared between files, so test files run in parallel. +11. A test file finishes within 60 seconds. Raising a timeout to pass is not a fix; make the test smaller. ## Removing a test -A test that breaks these rules can go when another test still fails on the same regression; name that test in the pull request. A failing test is a bug report, never a removal candidate. +A test that breaks these rules can go when another test still fails on the same regression; name that test in the pull request. When it's unclear whether a test catches anything, break the behavior it names and run it, instead of guessing. A failing test is a bug report, never a removal candidate. ## Sources | Rule | Source | | --- | --- | -| 1 | OpenClaw [test-audit skill](https://github.com/openclaw/openclaw/blob/70bfdc2b58/.agents/skills/test-audit/SKILL.md): "One owner regression covers bug; never replay at every crossed layer" | -| 2 | *Software Engineering at Google* (O'Reilly, 2020), ch. 12: "Test via Public APIs", "Test State, Not Interactions"; OpenClaw [writing-tests.md](https://github.com/openclaw/openclaw/blob/d70a0b7939/docs/help/testing/writing-tests.md) | -| 3 | *Software Engineering at Google*, ch. 13: real implementations first; stubs may simulate errors; interaction testing only when state can't be checked or call count or order matters | -| 4 | Go wiki [TestComments](https://go.dev/wiki/TestComments), "Test Error Semantics" | +| 1 | ISTQB [CTFL syllabus v4.0.1](https://istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf), §5.2: test scope and depth set by risk, likelihood and impact; Google Testing Blog, [Test Behaviors, Not Methods](https://testing.googleblog.com/2014/04/testing-on-toilet-test-behaviors-not.html) (2014); *Software Engineering at Google* (O'Reilly, 2020), [ch. 12](https://abseil.io/resources/swe-book/html/ch12.html): one behavior per test | +| 2 | OpenClaw [test-audit skill](https://github.com/openclaw/openclaw/blob/70bfdc2b58/.agents/skills/test-audit/SKILL.md): "One owner regression covers bug; never replay at every crossed layer"; Fowler, [The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): delete a higher-level test a lower one covers | +| 3 | Go wiki [TableDrivenTests](https://go.dev/wiki/TableDrivenTests); ISTQB CTFL v4.0.1, §4.2: one value per equivalence partition, plus boundaries; pytest [parametrize](https://docs.pytest.org/en/stable/how-to/parametrize.html); Vitest [`test.each`](https://vitest.dev/api/#test-each); Swift Testing [parameterized testing](https://developer.apple.com/documentation/testing/parameterizedtesting) | +| 4 | *Software Engineering at Google*, [ch. 11](https://abseil.io/resources/swe-book/html/ch11.html): coverage "only measures that a line was invoked, not what happened as a result" | +| 5 | *Software Engineering at Google*, ch. 12: "Test via Public APIs", "Test State, Not Interactions"; OpenClaw [writing-tests.md](https://github.com/openclaw/openclaw/blob/d70a0b7939/docs/help/testing/writing-tests.md); Google Testing Blog, [Change-Detector Tests Considered Harmful](https://testing.googleblog.com/2015/01/testing-on-toilet-change-detector-tests.html) (2015) | +| 6 | *Software Engineering at Google*, [ch. 13](https://abseil.io/resources/swe-book/html/ch13.html): real implementations first; stubs may simulate errors; interaction testing only when state can't be checked or call count or order matters | +| 7 | Go wiki [TestComments](https://go.dev/wiki/TestComments), "Test Error Semantics" | +| 8, 9 | Google Testing Blog, [Test Sizes](https://testing.googleblog.com/2010/12/test-sizes.html) (2010): small tests have no network, file system or sleep; medium tests may use child processes and localhost; *Software Engineering at Google*, ch. 11 | +| 10 | Bazel [Test encyclopedia](https://bazel.build/reference/test-encyclopedia): tests are hermetic and "must not assume that any constant path is available for their exclusive use"; Vitest [`fileParallelism`](https://vitest.dev/config/fileparallelism), on by default | +| 11 | Test Sizes: a small test's time limit is 60 seconds; Bazel Test encyclopedia: a small test target's timeout is 60 seconds | +| Removing | Thoughtworks Technology Radar, [Mutation testing](https://www.thoughtworks.com/radar/techniques/mutation-testing) | From 64e2029df9209c41f9e201b2445fbedbb2c551a6 Mon Sep 17 00:00:00 2001 From: Rue <343175018+thatsrue@users.noreply.github.com> Date: Tue, 3 Nov 2026 07:22:00 -0500 Subject: [PATCH 2/6] docs(testing): cap tests per change, list each test's regression, match rules to their sources --- docs/testing.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/testing.md b/docs/testing.md index b6621d0..1f4db84 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -4,43 +4,43 @@ How tests in these repos are written. A test earns its place by failing when som ## What to test -1. Test the critical path and how it fails: the main thing users do, each failure they can see (an error, a refusal, a non-zero exit) and each boundary the code branches on. Spend tests where a break is likely or costly. Test behaviors, not methods: one behavior per test. -2. Before adding a test, name the regression it fails on. If a test already fails on it, extend that test. A fix gets one or two such tests where the bug lives, not one per layer. +1. Test the critical path and how it fails. Per change: one test for the main path, plus one per failure users can see (an error, a refusal, a non-zero exit) that has its own cause. Stop there; more only for a named regression (rule 2). Test behaviors, not methods: one behavior per test. +2. Before adding a test, name the regression it fails on. If a test already fails on it, extend that test. A fix gets one or two such tests where the bug lives, not one per layer. The pull request lists each new test with the regression it fails on. ## How many -3. Inputs that take the same path are one table-driven test, one row each (`t.Run` over a table, `pytest.mark.parametrize`, `test.each`, Swift Testing `arguments:`). A row needs its own partition or boundary. A test that fails on the same change as an existing one is a duplicate: don't add it. +3. Inputs that take the same path are one table-driven test, one row each (`t.Run` over a table, `pytest.mark.parametrize`, `test.each`, Swift Testing `arguments:`). A row needs its own partition, and boundaries get one pair per branch the change touches. A test that fails on the same change as an existing one is a duplicate: don't add it. 4. Never add a test only to raise a coverage number. Coverage says a line ran, not that its result was checked. If a coverage gate forces a test, say so in the pull request. ## How a test checks -5. Call the code the way its users do and assert what they see: return value, output, exit code, file written, message sent. Not which internal calls were made. A test that restates the code (call order, a structural snapshot) fails on every refactor and catches nothing. +5. Call the code the way its users do and assert what they see: return value, output, exit code, file written, message sent. Not which internal calls were made. A test that restates the code (checking call order) fails on every refactor and catches nothing. 6. Use real code. Fake only what a test can't run: network, clock, model, external commands and services. A fake may return what the real one would, errors included; it must not supply the behavior the test asserts. Check a fake's calls only when the outcome can't be checked, or the count or order is the behavior (a cache that saves a request). 7. Match exact text only when the text is a contract: another program parses it, or the text is the product (a help page, a prompt, a message a person receives). Otherwise check the level, exit code or field that matters. ## Speed -8. Write small tests: one process, no network, no sleep. Use a medium test (child processes, localhost, temp files) only when the boundary is the behavior: a CLI's exit code and output, a file the program must write, a hook's input and output. -9. No sleep unless elapsed time is the behavior. Wait for the event (a file, a message, an exit) or inject the clock. +8. Keep a test in one process, with no network and no sleep. Start a child process or a local server only when that boundary is what's tested: a CLI's exit code and output, a hook's input and output. +9. No sleep unless elapsed time is the behavior. Fake the clock instead (rule 6). 10. A test touches only what it declares: its own temp directory and `HOME`, and fakes for host tools it doesn't test. No fixed path, port or global shared between files, so test files run in parallel. -11. A test file finishes within 60 seconds. Raising a timeout to pass is not a fix; make the test smaller. +11. A test file finishes within 60 seconds. ## Removing a test -A test that breaks these rules can go when another test still fails on the same regression; name that test in the pull request. When it's unclear whether a test catches anything, break the behavior it names and run it, instead of guessing. A failing test is a bug report, never a removal candidate. +A test that breaks these rules can go when another test still fails on the same regression; name that test in the pull request. When it's unclear whether a test catches anything, run a manual mutation check: break the behavior it names and run it. A failing test is a bug report, never a removal candidate. ## Sources | Rule | Source | | --- | --- | -| 1 | ISTQB [CTFL syllabus v4.0.1](https://istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf), §5.2: test scope and depth set by risk, likelihood and impact; Google Testing Blog, [Test Behaviors, Not Methods](https://testing.googleblog.com/2014/04/testing-on-toilet-test-behaviors-not.html) (2014); *Software Engineering at Google* (O'Reilly, 2020), [ch. 12](https://abseil.io/resources/swe-book/html/ch12.html): one behavior per test | +| 1 | ISTQB [CTFL syllabus v4.0.1](https://istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf), §5.2: test scope set by risk. The per-change cap is these repos' choice; Google Testing Blog, [Test Behaviors, Not Methods](https://testing.googleblog.com/2014/04/testing-on-toilet-test-behaviors-not.html) (2014); *Software Engineering at Google* (O'Reilly, 2020), [ch. 12](https://abseil.io/resources/swe-book/html/ch12.html): one behavior per test | | 2 | OpenClaw [test-audit skill](https://github.com/openclaw/openclaw/blob/70bfdc2b58/.agents/skills/test-audit/SKILL.md): "One owner regression covers bug; never replay at every crossed layer"; Fowler, [The Practical Test Pyramid](https://martinfowler.com/articles/practical-test-pyramid.html): delete a higher-level test a lower one covers | | 3 | Go wiki [TableDrivenTests](https://go.dev/wiki/TableDrivenTests); ISTQB CTFL v4.0.1, §4.2: one value per equivalence partition, plus boundaries; pytest [parametrize](https://docs.pytest.org/en/stable/how-to/parametrize.html); Vitest [`test.each`](https://vitest.dev/api/#test-each); Swift Testing [parameterized testing](https://developer.apple.com/documentation/testing/parameterizedtesting) | | 4 | *Software Engineering at Google*, [ch. 11](https://abseil.io/resources/swe-book/html/ch11.html): coverage "only measures that a line was invoked, not what happened as a result" | | 5 | *Software Engineering at Google*, ch. 12: "Test via Public APIs", "Test State, Not Interactions"; OpenClaw [writing-tests.md](https://github.com/openclaw/openclaw/blob/d70a0b7939/docs/help/testing/writing-tests.md); Google Testing Blog, [Change-Detector Tests Considered Harmful](https://testing.googleblog.com/2015/01/testing-on-toilet-change-detector-tests.html) (2015) | | 6 | *Software Engineering at Google*, [ch. 13](https://abseil.io/resources/swe-book/html/ch13.html): real implementations first; stubs may simulate errors; interaction testing only when state can't be checked or call count or order matters | | 7 | Go wiki [TestComments](https://go.dev/wiki/TestComments), "Test Error Semantics" | -| 8, 9 | Google Testing Blog, [Test Sizes](https://testing.googleblog.com/2010/12/test-sizes.html) (2010): small tests have no network, file system or sleep; medium tests may use child processes and localhost; *Software Engineering at Google*, ch. 11 | -| 10 | Bazel [Test encyclopedia](https://bazel.build/reference/test-encyclopedia): tests are hermetic and "must not assume that any constant path is available for their exclusive use"; Vitest [`fileParallelism`](https://vitest.dev/config/fileparallelism), on by default | -| 11 | Test Sizes: a small test's time limit is 60 seconds; Bazel Test encyclopedia: a small test target's timeout is 60 seconds | -| Removing | Thoughtworks Technology Radar, [Mutation testing](https://www.thoughtworks.com/radar/techniques/mutation-testing) | +| 8, 9 | Google Testing Blog, [Test Sizes](https://testing.googleblog.com/2010/12/test-sizes.html) (2010): small tests have no network or sleep, medium tests may use localhost; *Software Engineering at Google*, ch. 11: small tests run in one process, medium tests may start child processes | +| 10 | Bazel [Test encyclopedia](https://bazel.build/reference/test-encyclopedia): tests are hermetic and "must not assume that any constant path is available for their exclusive use". The temp `HOME` and host-tool fakes are how these repos apply it | +| 11 | Test Sizes: 60 seconds for a small test, 300 for a medium one; Bazel Test encyclopedia: a small target's timeout is 60 seconds. These repos take the small limit for every file: all measured files but a few already fit | +| Removing | Thoughtworks Technology Radar, [Mutation testing](https://www.thoughtworks.com/radar/techniques/mutation-testing), done by hand | From 26382a2450d6625298302f58ecc8f3c9e481e086 Mon Sep 17 00:00:00 2001 From: Rue <343175018+thatsrue@users.noreply.github.com> Date: Wed, 18 Nov 2026 13:11:59 -0500 Subject: [PATCH 3/6] docs(testing): two file limits, 60 s in-process and 300 s with child processes --- docs/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/testing.md b/docs/testing.md index 1f4db84..f88922f 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -23,7 +23,7 @@ How tests in these repos are written. A test earns its place by failing when som 8. Keep a test in one process, with no network and no sleep. Start a child process or a local server only when that boundary is what's tested: a CLI's exit code and output, a hook's input and output. 9. No sleep unless elapsed time is the behavior. Fake the clock instead (rule 6). 10. A test touches only what it declares: its own temp directory and `HOME`, and fakes for host tools it doesn't test. No fixed path, port or global shared between files, so test files run in parallel. -11. A test file finishes within 60 seconds. +11. A test file finishes within 60 seconds. A file that starts child processes or a local server (rule 8) has 300. ## Removing a test @@ -42,5 +42,5 @@ A test that breaks these rules can go when another test still fails on the same | 7 | Go wiki [TestComments](https://go.dev/wiki/TestComments), "Test Error Semantics" | | 8, 9 | Google Testing Blog, [Test Sizes](https://testing.googleblog.com/2010/12/test-sizes.html) (2010): small tests have no network or sleep, medium tests may use localhost; *Software Engineering at Google*, ch. 11: small tests run in one process, medium tests may start child processes | | 10 | Bazel [Test encyclopedia](https://bazel.build/reference/test-encyclopedia): tests are hermetic and "must not assume that any constant path is available for their exclusive use". The temp `HOME` and host-tool fakes are how these repos apply it | -| 11 | Test Sizes: 60 seconds for a small test, 300 for a medium one; Bazel Test encyclopedia: a small target's timeout is 60 seconds. These repos take the small limit for every file: all measured files but a few already fit | +| 11 | Test Sizes: 60 seconds for a small test, 300 for a medium one; Bazel Test encyclopedia: a small target's timeout is 60 seconds. These repos apply the two sizes per file: measured on the largest suite, files of in-process tests run in seconds, and files that start a daemon or a command per test take 65 to 126 seconds and cannot be trimmed under 60 | | Removing | Thoughtworks Technology Radar, [Mutation testing](https://www.thoughtworks.com/radar/techniques/mutation-testing), done by hand | From 382d6489de4c1d6728deccc78a4d5f5674fedde4 Mon Sep 17 00:00:00 2001 From: Rue <343175018+thatsrue@users.noreply.github.com> Date: Wed, 18 Nov 2026 13:12:20 -0500 Subject: [PATCH 4/6] docs(testing): state the measure behind the two file limits --- docs/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/testing.md b/docs/testing.md index f88922f..0e10425 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -42,5 +42,5 @@ A test that breaks these rules can go when another test still fails on the same | 7 | Go wiki [TestComments](https://go.dev/wiki/TestComments), "Test Error Semantics" | | 8, 9 | Google Testing Blog, [Test Sizes](https://testing.googleblog.com/2010/12/test-sizes.html) (2010): small tests have no network or sleep, medium tests may use localhost; *Software Engineering at Google*, ch. 11: small tests run in one process, medium tests may start child processes | | 10 | Bazel [Test encyclopedia](https://bazel.build/reference/test-encyclopedia): tests are hermetic and "must not assume that any constant path is available for their exclusive use". The temp `HOME` and host-tool fakes are how these repos apply it | -| 11 | Test Sizes: 60 seconds for a small test, 300 for a medium one; Bazel Test encyclopedia: a small target's timeout is 60 seconds. These repos apply the two sizes per file: measured on the largest suite, files of in-process tests run in seconds, and files that start a daemon or a command per test take 65 to 126 seconds and cannot be trimmed under 60 | +| 11 | Test Sizes: 60 seconds for a small test, 300 for a medium one; Bazel Test encyclopedia: a small target's timeout is 60 seconds. These repos apply the two sizes per file: on the largest suite measured, every file fits, and the only files over 60 seconds (65 to 126) start a daemon or a command per test | | Removing | Thoughtworks Technology Radar, [Mutation testing](https://www.thoughtworks.com/radar/techniques/mutation-testing), done by hand | From 87c925b20e44c82104ae55028e69e44a52b7afb5 Mon Sep 17 00:00:00 2001 From: Rue <343175018+thatsrue@users.noreply.github.com> Date: Thu, 19 Nov 2026 14:32:21 -0500 Subject: [PATCH 5/6] docs(testing): a removal or loosening is shown by a mutation check; documented text stays pinned --- docs/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/testing.md b/docs/testing.md index 0e10425..458ad7e 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -27,7 +27,7 @@ How tests in these repos are written. A test earns its place by failing when som ## Removing a test -A test that breaks these rules can go when another test still fails on the same regression; name that test in the pull request. When it's unclear whether a test catches anything, run a manual mutation check: break the behavior it names and run it. A failing test is a bug report, never a removal candidate. +A test that breaks these rules can go when another test still fails on the same regression; name that test in the pull request. Show it with a manual mutation check: break the behavior in the source, see the named test fail, and restore the source. Reading the tests is not enough to tell. Loosening an assertion needs the same check. Text the repository's docs promise, or that a caller or an agent acts on, is a contract (rule 7) and stays pinned. A failing test is a bug report, never a removal candidate. ## Sources @@ -43,4 +43,4 @@ A test that breaks these rules can go when another test still fails on the same | 8, 9 | Google Testing Blog, [Test Sizes](https://testing.googleblog.com/2010/12/test-sizes.html) (2010): small tests have no network or sleep, medium tests may use localhost; *Software Engineering at Google*, ch. 11: small tests run in one process, medium tests may start child processes | | 10 | Bazel [Test encyclopedia](https://bazel.build/reference/test-encyclopedia): tests are hermetic and "must not assume that any constant path is available for their exclusive use". The temp `HOME` and host-tool fakes are how these repos apply it | | 11 | Test Sizes: 60 seconds for a small test, 300 for a medium one; Bazel Test encyclopedia: a small target's timeout is 60 seconds. These repos apply the two sizes per file: on the largest suite measured, every file fits, and the only files over 60 seconds (65 to 126) start a daemon or a command per test | -| Removing | Thoughtworks Technology Radar, [Mutation testing](https://www.thoughtworks.com/radar/techniques/mutation-testing), done by hand | +| Removing | Thoughtworks Technology Radar, [Mutation testing](https://www.thoughtworks.com/radar/techniques/mutation-testing), done by hand. Requiring it for every removal and loosening is these repos' choice: in 7 of 9 pull requests that trimmed tests under these rules, a reviewer's mutation found a removal or loosening that reading had passed | From 49413b0aeba1a0c878b75b8bebbbeb1f0c6b26aa Mon Sep 17 00:00:00 2001 From: Rue <343175018+thatsrue@users.noreply.github.com> Date: Thu, 19 Nov 2026 14:33:23 -0500 Subject: [PATCH 6/6] docs(testing): say plainly what the mutation check shows and what a contract forbids --- docs/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/testing.md b/docs/testing.md index 458ad7e..e89cfbf 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -27,7 +27,7 @@ How tests in these repos are written. A test earns its place by failing when som ## Removing a test -A test that breaks these rules can go when another test still fails on the same regression; name that test in the pull request. Show it with a manual mutation check: break the behavior in the source, see the named test fail, and restore the source. Reading the tests is not enough to tell. Loosening an assertion needs the same check. Text the repository's docs promise, or that a caller or an agent acts on, is a contract (rule 7) and stays pinned. A failing test is a bug report, never a removal candidate. +A test that breaks these rules can go when another test still fails on the same regression; name that test in the pull request. Show that the named test fails, with a manual mutation check: break the behavior in the source, see the test fail, and restore the source. Reading the tests is not enough. Loosening an assertion needs the same check. Text the repository's docs promise, or that a caller or an agent acts on, is a contract (rule 7): don't remove or loosen its test. A failing test is a bug report, never a removal candidate. ## Sources