File item 108: mutation-test the code each chunk changes, so every test must catch a real bug
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
`Bar = 9`
|
||||
|
||||
`Next ID = 108`
|
||||
`Next ID = 109`
|
||||
|
||||
| Goal | W |
|
||||
|---|---|
|
||||
@@ -25,6 +25,7 @@
|
||||
| ID | Release | Exempt | Item | R | S | A | G | Goals | Score |
|
||||
|---|---|---|---|---|---|---|---|---|---|
|
||||
| 107 | 0.1.0 | | **Have loop-claude put the README's Goals and Audience into every fresh worker prompt, under a line that the item sets the scope and the goals choose within it.** | 3 | 3 | 8 | 8 | 1.1, 1.2 | 28.1 |
|
||||
| 108 | 0.1.0 | | **Measure whether each test catches a real bug, by mutation testing the code each chunk changes, so a test that only runs lines fails review.** | 2 | 4 | 7 | 8 | 1.1 | 26.8 |
|
||||
| 98 | 0.1.0 | | **Score R and S from a measurement wherever one exists, and calibrate each guessed score against the finished chunk's measured outcome.** | 2 | 5 | 6 | 7 | 1.1, 1.4 | 22.6 |
|
||||
| 99 | 0.1.0 | | **Drop the comprehension panel as a merge gate, and keep recording its scores and the places in the code its seats found hard, for later measurement and for other reviewers and agents to improve.** | 4 | 5 | 7 | 7 | 1.1, 1.4, 1.5 | 22.6 |
|
||||
| 87 | 0.1.0 | | **Score every `todo.md` item's complexity C from 1 to 10, and have `rank_todo.py` fail on an item without one.** | 3 | 4 | 6 | 7 | 1.1, 1.4 | 21.9 |
|
||||
@@ -75,6 +76,18 @@ Today loop-claude hands the premises only to the judge (`bin/loop_claude/cycle/j
|
||||
- Above them, one line: the item sets the scope, and the goals choose between ways to meet it. A worker then extends no item towards a goal.
|
||||
- For a session outside the loop, add one line to `CLAUDE.md`'s working loop: read the README's Goals and Audience before starting a chunk.
|
||||
|
||||
### 108. Measure whether each test catches a real bug, by mutation testing the code each chunk changes, so a test that only runs lines fails review.
|
||||
|
||||
lilleman, 2026-10-13: tests should be as valuable as possible, never written to tick a box. Today the technical principles ask that most code has tests, written first, and that coverage not decline (item 69). The stability reviewer asks, by reading, whether each test would fail if the behaviour broke. Coverage counts the lines a test runs, so a test with no meaningful assertion still raises it.
|
||||
|
||||
Mutation testing measures what coverage cannot: it makes small changes to the code, such as flipping a comparison, and counts the changes no test notices. Each survivor is a bug the tests would miss.
|
||||
|
||||
- Run it on the lines a chunk changes, so its cost stays per chunk (goal 1.4), through each project's own tooling, with a widely deployed tool per language, such as mutmut for Python and Stryker for TypeScript.
|
||||
- Make a surviving mutant in the changed code a finding of the stability pass, which then names the test to add or strengthen.
|
||||
- Set any score threshold from a published source, or ask (`CLAUDE.md` → "Web research").
|
||||
- Say in the principle "Most, if not all, code should have automated tests" what a valuable test is: it checks behaviour through the unit's interface, and fails when that behaviour breaks.
|
||||
- Decide whether this replaces item 69's coverage measure.
|
||||
|
||||
### 98. Score R and S from a measurement wherever one exists, and calibrate each guessed score against the finished chunk's measured outcome.
|
||||
|
||||
A score that can be computed from the code it touches, such as the files an item names, comes from that computation. Otherwise size and risk are estimated from finished work, the way reference-class forecasting estimates a project from earlier projects like it. When a chunk merges, record its measured outcome beside the item's guessed R and S: lines and files changed, review rounds, 🔴 and 🟡 findings, and fixes the code needed later. Show the scorer, when it files an item, the finished items whose guessed scores sat nearest and what they measured. Once enough chunks are recorded, report how far each guess was from its outcome, so a scorer whose S runs high can be corrected. Item 87's C is scored and calibrated the same way.
|
||||
|
||||
Reference in New Issue
Block a user