You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 63df86e
Browse filesBrowse the repository at this point in the historyBrowse files
Grade a curated list of test methods and produce a compact, PR-comment-friendly
24
-
report: one row per test method with a letter grade, a score band, and a
25
-
one-line note explaining the grade. The skill **does not discover tests on its
26
-
own** — the caller (typically a PR automation workflow or a human reviewer
27
-
holding a specific list) provides the test methods to grade.
25
+
report: one row per test method with a letter grade, a score band,
26
+
pseudo-mutation resilience, a one-line note explaining the grade, and a
27
+
concrete improvement for every grade below A. The skill **does not discover
28
+
tests on its own** — the caller (typically a PR automation workflow or a human
29
+
reviewer holding a specific list) provides the test methods to grade.
28
30
29
31
> **Language-specific guidance**: Call the `test-analysis-extensions` skill
30
32
> to discover available extension files, then read the file matching the
@@ -71,7 +73,7 @@ that question with a one-row-per-test verdict that fits in a comment table.
71
73
|-------|----------|-------------|
72
74
| Test methods | Yes | A scope to grade. Provide one of: (a) an explicit list of test method names (fully-qualified, e.g. `Namespace.ClassName.TestMethodName`); (b) one or more file paths plus an explicit instruction to grade every test declared in those files; or (c) a diff hunk / PR identifier whose changed tests should be graded. File paths are recommended but optional when method names are unambiguous in the workspace. Ambiguous requests like *"grade my tests"* with no scope are rejected up-front (see Step 0); this skill is for curated input and does not auto-grade an entire workspace. |
73
75
| Test bodies / spans | Recommended | The exact source lines for each test method. If omitted, read them from the listed files. |
74
-
| Production code |No| The code under test, for judging whether assertions cover the meaningful behaviors. When unavailable, mark relevant findings as "Unverified" rather than guessing. |
76
+
| Production code |Recommended| The code under test, used to judge meaningful assertions and perform pseudo-mutation analysis. Resolve it from the workspace when possible. When unavailable, render mutation resilience as `N/A`, explain that production code was unavailable in Notes, exclude that sub-grade from the weighted score, and do not guess. |
75
77
| Diff context | No | When grading PR changes, the unified diff for each test method helps focus on what actually changed. |
76
78
77
79
### Step 0: Validate the input
@@ -113,6 +115,12 @@ For each entry in the input list:
113
115
/ decorators / fixtures and any helper code that the test calls.
114
116
3. If a method cannot be found, record it as `N/A — method not found` and
115
117
continue. Never invent a body to grade.
118
+
4. Trace the production entry point called by the test, including every helper
119
+
and branch relevant to the behavior claimed by the test, even when its
120
+
current input does not reach that branch. If the production code is not
121
+
supplied, resolve it from the workspace using symbol references and call
122
+
sites. Record production code as unavailable only after a reasonable lookup
123
+
fails.
116
124
117
125
### Step 3: Score each test
118
126
@@ -122,9 +130,10 @@ for hypothetical concerns (e.g., "could have more negative assertions")
122
130
unless the production code clearly demands them and the production code is
123
131
available.
124
132
125
-
#### Three sub-dimensions
133
+
#### Four sub-dimensions
126
134
127
-
Compute three sub-grades (each A–F) that together drive the overall grade.
135
+
Compute four sub-grades (each A–F) that together drive the overall grade.
136
+
Pseudo-mutation may be `N/A` only when the production code cannot be resolved.
128
137
129
138
##### A. Assertion strength
130
139
@@ -191,6 +200,9 @@ Examples (Critical/High and Medium counts → Anti-pattern sub-grade):
|`Namespace.ClassName.Test_Method_Condition_Expected`| A | 90–100 | 4/4 killed | Clear AAA; assertions protect the public contract. | — |
364
+
|`Namespace.ClassName.Test_UpperBound`| B | 80–89 | 2/3 killed | The inclusive upper-bound mutation survives. | Add `max + 1` input and assert rejection. |
365
+
|`Namespace.ClassName.Test_Other`| C | 70–79 | 1/3 killed | Only `IsNotNull`; default-return mutations survive. | Assert the expected value and collection contents. |
366
+
|`Namespace.ClassName.Test_Old`| F | 0–59 | 0/2 killed | No assertions; every mutation survives. | Assert the exact result produced by the arranged input. |
289
367
```
290
368
291
369
**Caps and ordering**:
@@ -306,6 +384,14 @@ prefix each section with the language name and framework.
306
384
`N/A — method not found`).
307
385
-[ ] Every grade is justified by at least one observable signal in the
308
386
captured body — no speculative deductions.
387
+
-[ ] Production code was resolved where possible; unavailable code is
388
+
reported as mutation `N/A` and omitted from scoring.
389
+
-[ ] Every meaningful mutation point in the behavior claimed by each test is
390
+
classified Killed / Survived / No coverage / Equivalent.
391
+
-[ ] Equivalent mutations and unrelated production branches do not affect
392
+
the mutation sub-grade.
393
+
-[ ] Mutation resilience is evaluated per test; a mutation killed only by a
394
+
different test does not receive credit.
309
395
-[ ] Trivial-assertion tests are flagged only when the **only** assertion
310
396
is trivial (a null check before a meaningful assertion is not trivial).
311
397
-[ ] Exception-only tests are not penalized for low assertion count.
@@ -320,6 +406,8 @@ prefix each section with the language name and framework.
320
406
JS/TS `expect(mock).toHaveBeenCalledWith(...)`.
321
407
-[ ] Async test pitfalls (un-awaited `resolves`/`rejects`/`ThrowsAsync`,
322
408
pytest-asyncio without `await`) drop the Assertion sub-grade to F.
409
+
-[ ] Every test below A has one concrete, grade-targeted improvement; every
410
+
A test uses `—`.
323
411
-[ ] The summary leads with the highest-leverage observation, not a recap
324
412
of the table.
325
413
@@ -335,6 +423,10 @@ prefix each section with the language name and framework.
335
423
| Flagging Go/Rust table-driven loops as conditional logic | They are idiomatic; do not deduct. |
336
424
| Treating pytest bare `assert` or Go `if got != want { t.Error… }` as missing-framework | Both are canonical; count in the correct assertion category. |
337
425
| Penalizing tests when production code is unavailable | Mark concerns about uncovered behaviors as `Unverified` and do not deduct. |
426
+
| Giving mutation credit from another test | Evaluate whether the current test independently kills each relevant mutation. |
427
+
| Penalizing a focused test for unrelated branches | Analyze only mutation points in the behavior promised by the test name and setup. |
428
+
| Treating equivalent or trivial mutations as gaps | Exclude equivalent mutations, getters, generated code, and boilerplate. |
429
+
| Giving vague improvement advice | Name the exact input, assertion, expected value, split, or deterministic replacement needed. |
338
430
| Using a fake-precise score (e.g., 87/100) | Use the score band only — 90–100, 80–89, 70–79, 60–69, 0–59. |
339
431
| Spilling a 500-row table into a PR comment | Apply the row cap from Step 5; collapse extras into `<details>`. |
340
432
| Re-reporting an existing finding three times under different categories | Pick the most fitting category and report once. |
0 commit comments