Grade Tests
Grade a curated list of test methods and produce a compact, PR-comment-friendly
report: one row per test method with a letter grade, a score band, and a
one-line note explaining the grade. The skill does not discover tests on its
own — the caller (typically a PR automation workflow or a human reviewer
holding a specific list) provides the test methods to grade.
Language-specific guidance: Call the test-analysis-extensions skill
to discover available extension files, then read the file matching the
target codebase's language and framework (e.g., extensions/dotnet.md,
extensions/python.md, extensions/typescript.md, extensions/go.md).
You MUST read the relevant extension file before scoring assertions or
anti-patterns, because assertion APIs and idiomatic patterns differ
significantly across frameworks.
Why a Per-Test Grade
Suite-wide audits (test-anti-patterns, assertion-quality,
test-smell-detection) produce excellent diagnostic reports, but they are
hard to consume as a short PR comment. Reviewers of a PR mostly want to know:
for the tests this PR adds or changes, are they good? This skill answers
that question with a one-row-per-test verdict that fits in a comment table.
When to Use
- A PR automation workflow needs to post a comment grading the tests
introduced or modified in a pull request.
- A reviewer has a specific list of tests (a file, a class, a method list,
or a diff hunk) and wants a per-test verdict rather than a suite report.
- A maintainer wants to triage which of N tests in a contribution deserve
follow-up improvements.
When Not to Use
- The caller wants a full suite audit or comparative metrics — use
test-anti-patterns (pragmatic) or test-smell-detection (formal) and
let the test-quality-auditor agent orchestrate.
- The caller wants to write new tests — use
code-testing-generator
(any language) or writing-mstest-tests (MSTest specifically).
- The caller wants to measure code coverage or CRAP scores — use
coverage-analysis or crap-score (.NET only).
- The caller wants to fix issues directly in test code — invoke the
appropriate editing skill.
- No specific list of tests is provided. Do not try to grade every test
in the workspace; ask the caller for an explicit list or scope.
Inputs
| Input |
Required |
Description |
| 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. |
| Test bodies / spans |
Recommended |
The exact source lines for each test method. If omitted, read them from the listed files. |
| 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. |
| Diff context |
No |
When grading PR changes, the unified diff for each test method helps focus on what actually changed. |
Step 0: Validate the input
Before doing anything else, check that the caller provided one of:
- An explicit list of test method names, or
- One or more file paths plus an explicit instruction to grade every test
declared in those files (e.g., "grade every test in
OrderTests.cs"), or
- A diff hunk or PR identifier whose changed tests should be graded.
If the request is ambiguous (e.g., "Grade my tests", "Are these tests
any good?" with no scope, "Review the test suite"), do not load
extensions, do not read files, and do not grade anything. Reply with a
short message asking the caller to provide an explicit list / file(s) /
diff, and optionally point them at test-quality-auditor agent or
test-anti-patterns skill for full-suite analysis. Stop there.
Workflow
Step 1: Detect language and load extension
Identify the target codebase's language and test framework from the file
extensions and the test method markers in the provided list. Call the
test-analysis-extensions skill and read the matching extension file (e.g.,
extensions/dotnet.md for MSTest/xUnit/NUnit/TUnit, extensions/python.md
for pytest, extensions/typescript.md for Jest/Vitest, extensions/go.md
for the standard testing package). If the input contains tests from
multiple languages, load each relevant extension and grade each test using
its language's conventions.
Step 2: Resolve the test bodies
For each entry in the input list:
- If the test body is provided inline, use it directly.
- Otherwise read the file at the given path and locate the method by its
fully-qualified name. Capture the full method body, including attributes
/ decorators / fixtures and any helper code that the test calls.
- If a method cannot be found, record it as
N/A — method not found and
continue. Never invent a body to grade.
Step 3: Score each test
Start every test at grade A (score band 90–100), then apply deductions
strictly for observable issues in the captured body. Do not deduct
for hypothetical concerns (e.g., "could have more negative assertions")
unless the production code clearly demands them and the production code is
available.
Three sub-dimensions
Compute three sub-grades (each A–F) that together drive the overall grade.
A. Assertion strength
Read the loaded language extension's assertion API list and classify every
assertion in the test body. Score from highest to lowest:
| Sub-grade |
Pattern |
| A |
At least one meaningful value assertion (equality / structural / exception / state) plus, where appropriate, additional checks (negative, type, collection contents). Mock-call verifications (Verify, toHaveBeenCalledWith, Should -Invoke) and bare assertion forms (pytest assert, Go if got != want { t.Errorf(...) }, Rust assert!()) count as real assertions. |
| B |
One clear meaningful assertion that verifies the behavior under test. |
| C |
Only trivial assertions (single IsNotNull / toBeDefined / assert x is not None), or assertions that check a single field while the operation produces a richer result. |
| D |
One self-referential / tautological assertion (Assert.AreEqual(x, x), assert dto.name == dto.name, round-trip identity without a non-trivial input), or broad exception assertions (Assert.ThrowsException<Exception>). |
| F |
No assertions at all; all assertions are always-true literals (Assert.IsTrue(true), assert True, expect(true).toBe(true)) — these verify nothing and are equivalent to having no assertions; or all assertions are silently un-awaited (e.g., expect(promise).resolves.toBe(x) without await/return, async TUnit/xUnit Assert.ThrowsAsync without await, pytest-asyncio with un-awaited coroutine). |
Exception tests (Assert.ThrowsException<T>, pytest.raises, expect(fn).toThrow,
assertThrows, #[should_panic], Should -Throw, EXPECT_THROW) are
complete on their own — do not require additional assertions.
B. Structure & focus
| Sub-grade |
Pattern |
| A |
Clear Arrange-Act-Assert (or Given-When-Then) separation. Single behavior under test. Body under ~30 lines. Setup uses framework conventions. |
| B |
One mild structural issue (slightly long body, missing blank lines between phases) but intent is clear. |
| C |
Multiple behaviors mixed in one test, or AAA phases interleaved enough to slow comprehension. |
| D |
Conditional logic in the test (if/switch driving assertions) — except for idiomatic Go/Rust table-driven sub-test loops; or test relies on previous test state (ordering dependency). |
| F |
Test exceeds ~60 lines and verifies multiple unrelated behaviors; or shares mutable state with other tests through statics/globals without reset. |
C. Anti-pattern hygiene
Scan against the catalog below. The Anti-pattern sub-grade is computed
in two passes and combined deterministically:
- Hard ceiling pass. Every Critical or High finding sets a
maximum sub-grade (F, D, or C as labeled). Take the worst ceiling
across all matched Critical/High findings — these do not accumulate
(a single F finding caps the sub-grade at F regardless of how many
other Critical/High findings are present).
- Medium-deduction pass. Start from A, then for each Medium
finding deduct one sub-grade level (A→B, B→C, C→D, D→F). These do
accumulate across findings.
The final Anti-pattern sub-grade is the worse of the two passes
(i.e., min(hard_ceiling, A − medium_count)). Low findings never
affect the grade — mention them in the note only.
Examples (Critical/High and Medium counts → Anti-pattern sub-grade):
- Zero Critical/High, 1 Medium → B (A − 1)
- Zero Critical/High, 3 Medium → D (A − 3)
- One C-ceiling (e.g., over-mocking), 0 Medium → C
- One C-ceiling, 2 Medium → D (
min(C, A − 2 = C) = C, but a third Medium would tip to D)
- One F-finding (e.g., swallowed exception) plus any number of Medium → F
Critical (drop straight to F or D)
- No assertions at all → F (also drives Assertion sub-grade to F)
- Swallowed exceptions:
try { … } catch { } (.NET), bare except: pass
(Python), try { … } catch (e) {} (JS/TS/Java), defer recover()
without re-panic (Go), rescue StandardError with no assertion (Ruby),
empty catch (Kotlin/Swift) → F
- Assert-in-catch pattern (
Assert.Fail(ex.Message) instead of
Assert.ThrowsException) → D
- Always-true literal assertions (
Assert.IsTrue(true), assert True,
expect(true).toBe(true)) → F (verifies nothing; also drives
Assertion sub-grade to F)
- Self-referential / tautological assertions on bound values
(
Assert.AreEqual(x, x), assert dto.name == dto.name) → D
- Commented-out assertions → D
High (drop one or two sub-grades)
- Wall-clock sleep used for synchronization:
Thread.Sleep, Task.Delay,
time.sleep, setTimeout-based wait, Thread.sleep, time.Sleep,
sleep, std::thread::sleep, Start-Sleep,
std::this_thread::sleep_for (in a unit test) → D
- Unseeded randomness, wall-clock reads without abstraction
(
DateTime.Now, datetime.now(), Date.now(),
System.currentTimeMillis(), time.Now(), Time.now,
Instant::now(), Get-Date, system_clock::now) → D
- Hard-coded environment-dependent paths (
C:\…, /tmp/…, network hosts) → D
- Ordering dependency on mutable static / package globals → D
- Broad exception assertion (
Assert.ThrowsException<Exception>,
pytest.raises(Exception), expect(fn).toThrow(Error) without matcher,
#[should_panic] without expected = "…", Should -Throw without
-ExpectedMessage, EXPECT_ANY_THROW) → C
- Over-mocking: more mock setup lines than test logic, or verifying exact
call sequences instead of outcomes → C
- Implementation coupling: reflection on private members, casting to
internal types to access state → C
Medium (drop one sub-grade)
- Poor name:
Test1, TestMethod, test, single-word name that says
nothing about scenario or expected outcome (judge against the language
extension's convention) → drop one sub-grade
- Magic values: unexplained
42, "foo", 0x1234 in arrange/assert
without naming or comment → drop one sub-grade
- Giant test (>30 lines covering a single behavior) → drop one sub-grade
- Assertion messages that just repeat the assertion text → drop one sub-grade
- Missing AAA / GWT separation when the test is non-trivial → drop one sub-grade
Low (note only, no deduction)
- Unused setup/teardown hooks; print debugging left in (
Console.WriteLine,
print, console.log, System.out.println, fmt.Println, puts,
dbg!, Write-Host, std::cout); inconsistent naming versus siblings;
leftover TODO comments. Mention in the note column but do not deduct.
Combining sub-grades
Convert sub-grades to numeric points: A=4, B=3, C=2, D=1, F=0.
- Overall score band = weighted average:
0.45 × Assertion + 0.30 × Anti-pattern + 0.25 × Structure
- Map to letter:
- ≥ 3.5 → A (band 90–100)
- ≥ 2.8 → B (band 80–89)
- ≥ 2.0 → C (band 70–79)
- ≥ 1.2 → D (band 60–69)
- < 1.2 → F (band 0–59)
- The overall grade is capped at the worst sub-grade — if any sub-grade
is F, the overall grade is F; if the worst sub-grade is D,
the overall grade is at most D; and so on. A test that fails on any
one dimension cannot earn a higher overall grade than that dimension.
Report the letter grade and the score band (not a single 0–100
number). False precision invites bikeshedding; bands keep the conversation
focused on the rubric.
Step 4: Build the note
The note column is one short sentence (target ≤ 120 characters). State the
single most important reason for the grade. Examples:
- A (90–100):
Clear AAA structure; equality + exception assertions on the public contract.
- B (80–89):
Good assertion variety, mildly long body — consider splitting into per-condition tests.
- C (70–79):
Only checks IsNotNull on the result; no value verification.
- D (60–69):
Self-referential assertion: round-trip identity verifies plumbing, not transformation.
- F (0–59):
No assertions — test executes the method but never verifies anything.
If a test gets A with no notable issues, the note may simply be
No issues found. — do not invent weaknesses to justify the grade.
Step 5: Report
Produce two sections.
1. Summary
A short paragraph (2–4 sentences) covering: total tests graded, grade
distribution, most common issue, and the single most important
recommendation.
2. Per-test table
| Test | Grade | Band | Notes |
|------|-------|------|-------|
| `Namespace.ClassName.Test_Method_Condition_Expected` | A | 90–100 | Clear AAA; equality + exception assertions. |
| `Namespace.ClassName.Test_Other` | C | 70–79 | Only `IsNotNull` — no value verification. |
| `Namespace.ClassName.Test_Old` | F | 0–59 | No assertions. |
Caps and ordering:
- If the table would exceed 50 rows, show all tests graded below B
first (worst to best), then a sample of the best tests, and wrap any
overflow in a collapsed
<details> block.
- Within the same grade, order by file path then by method name for
determinism.
- If the diff context is provided, prefix each test name with a
(new) or
(modified) marker.
If multiple languages are present, produce one table per language and
prefix each section with the language name and framework.
Validation
Common Pitfalls
| Pitfall |
Solution |
| Grading every test in the workspace when no list is provided |
Ask the caller for the explicit list; this skill is for curated input. |
| Inflating deductions to justify the grade |
Start at A; deduct only for observable issues. |
| Penalizing exception tests for low assertion count |
Exception assertions are complete on their own. |
Treating IsNotNull before a value assertion as trivial |
Only flag when the null check is the only assertion. |
| Treating any Boolean assertion as effectively assertion-free |
Only always-true literals (Assert.IsTrue(true), assert True) are; meaningful Assert.IsTrue(result.IsValid) is a real assertion. |
| Flagging Go/Rust table-driven loops as conditional logic |
They are idiomatic; do not deduct. |
Treating pytest bare assert or Go if got != want { t.Error… } as missing-framework |
Both are canonical; count in the correct assertion category. |
| Penalizing tests when production code is unavailable |
Mark concerns about uncovered behaviors as Unverified and do not deduct. |
| Using a fake-precise score (e.g., 87/100) |
Use the score band only — 90–100, 80–89, 70–79, 60–69, 0–59. |
| Spilling a 500-row table into a PR comment |
Apply the row cap from Step 5; collapse extras into <details>. |
| Re-reporting an existing finding three times under different categories |
Pick the most fitting category and report once. |
| Inventing weaknesses for A-grade tests to make the note "balanced" |
If a test is clean, the note may simply read No issues found. |
1---2name: grade-tests3description: >4 Grades a specified set of test methods individually and produces a concise5 table mapping each test (fully-qualified name) to a letter grade (A–F), a6 score band, and a one-line note — designed to be posted as a PR comment.7 Use when the caller wants per-test feedback on a curated list of methods8 (for example, the new or modified tests in a pull request), not a9 suite-wide audit. Polyglot: .NET, Python, TS/JS, Java, Go, Ruby, Rust,10 Swift, Kotlin, PowerShell, C++. Input is a list of test methods (or method11 bodies / file+line spans); output is a compact markdown table plus a short12 summary. DO NOT USE FOR:13 full suite audits (use test-quality-auditor agent or test-anti-patterns),14 writing new tests (use code-testing-generator agent or writing-mstest-tests),15 fixing failures, or measuring code coverage.16license: MIT17metadata:18 source: https://skillmd.com/skills/dotnet/grade-tests19---2021# Grade Tests2223Grade a curated list of test methods and produce a compact, PR-comment-friendly24report: one row per test method with a letter grade, a score band, and a25one-line note explaining the grade. The skill **does not discover tests on its26own** — the caller (typically a PR automation workflow or a human reviewer27holding a specific list) provides the test methods to grade.2829> **Language-specific guidance**: Call the `test-analysis-extensions` skill30> to discover available extension files, then read the file matching the31> target codebase's language and framework (e.g., `extensions/dotnet.md`,32> `extensions/python.md`, `extensions/typescript.md`, `extensions/go.md`).33> You MUST read the relevant extension file before scoring assertions or34> anti-patterns, because assertion APIs and idiomatic patterns differ35> significantly across frameworks.3637## Why a Per-Test Grade3839Suite-wide audits (`test-anti-patterns`, `assertion-quality`,40`test-smell-detection`) produce excellent diagnostic reports, but they are41hard to consume as a short PR comment. Reviewers of a PR mostly want to know:42*for the tests this PR adds or changes, are they good?* This skill answers43that question with a one-row-per-test verdict that fits in a comment table.4445## When to Use4647- A PR automation workflow needs to post a comment grading the tests48 introduced or modified in a pull request.49- A reviewer has a specific list of tests (a file, a class, a method list,50 or a diff hunk) and wants a per-test verdict rather than a suite report.51- A maintainer wants to triage which of N tests in a contribution deserve52 follow-up improvements.5354## When Not to Use5556- The caller wants a full suite audit or comparative metrics — use57 `test-anti-patterns` (pragmatic) or `test-smell-detection` (formal) and58 let the `test-quality-auditor` agent orchestrate.59- The caller wants to *write* new tests — use `code-testing-generator`60 (any language) or `writing-mstest-tests` (MSTest specifically).61- The caller wants to measure code coverage or CRAP scores — use62 `coverage-analysis` or `crap-score` (.NET only).63- The caller wants to fix issues directly in test code — invoke the64 appropriate editing skill.65- No specific list of tests is provided. Do **not** try to grade every test66 in the workspace; ask the caller for an explicit list or scope.6768## Inputs6970| Input | Required | Description |71|-------|----------|-------------|72| 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| 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. |75| Diff context | No | When grading PR changes, the unified diff for each test method helps focus on what actually changed. |7677### Step 0: Validate the input7879Before doing anything else, check that the caller provided one of:80811. An explicit list of test method names, **or**822. One or more file paths plus an explicit instruction to grade every test83 declared in those files (e.g., "grade every test in `OrderTests.cs`"), **or**843. A diff hunk or PR identifier whose changed tests should be graded.8586If the request is ambiguous (e.g., *"Grade my tests"*, *"Are these tests87any good?"* with no scope, *"Review the test suite"*), **do not load88extensions, do not read files, and do not grade anything**. Reply with a89short message asking the caller to provide an explicit list / file(s) /90diff, and optionally point them at `test-quality-auditor` agent or91`test-anti-patterns` skill for full-suite analysis. Stop there.9293## Workflow9495### Step 1: Detect language and load extension9697Identify the target codebase's language and test framework from the file98extensions and the test method markers in the provided list. Call the99`test-analysis-extensions` skill and read the matching extension file (e.g.,100`extensions/dotnet.md` for MSTest/xUnit/NUnit/TUnit, `extensions/python.md`101for pytest, `extensions/typescript.md` for Jest/Vitest, `extensions/go.md`102for the standard `testing` package). If the input contains tests from103multiple languages, load each relevant extension and grade each test using104its language's conventions.105106### Step 2: Resolve the test bodies107108For each entry in the input list:1091101. If the test body is provided inline, use it directly.1112. Otherwise read the file at the given path and locate the method by its112 fully-qualified name. Capture the full method body, including attributes113 / decorators / fixtures and any helper code that the test calls.1143. If a method cannot be found, record it as `N/A — method not found` and115 continue. Never invent a body to grade.116117### Step 3: Score each test118119Start every test at grade **A (score band 90–100)**, then apply deductions120strictly for **observable issues** in the captured body. Do **not** deduct121for hypothetical concerns (e.g., "could have more negative assertions")122unless the production code clearly demands them and the production code is123available.124125#### Three sub-dimensions126127Compute three sub-grades (each A–F) that together drive the overall grade.128129##### A. Assertion strength130131Read the loaded language extension's assertion API list and classify every132assertion in the test body. Score from highest to lowest:133134| Sub-grade | Pattern |135|-----------|---------|136| **A** | At least one meaningful value assertion (equality / structural / exception / state) plus, where appropriate, additional checks (negative, type, collection contents). Mock-call verifications (`Verify`, `toHaveBeenCalledWith`, `Should -Invoke`) and bare assertion forms (pytest `assert`, Go `if got != want { t.Errorf(...) }`, Rust `assert!()`) count as real assertions. |137| **B** | One clear meaningful assertion that verifies the behavior under test. |138| **C** | Only trivial assertions (single `IsNotNull` / `toBeDefined` / `assert x is not None`), or assertions that check a single field while the operation produces a richer result. |139| **D** | One self-referential / tautological assertion (`Assert.AreEqual(x, x)`, `assert dto.name == dto.name`, round-trip identity without a non-trivial input), or broad exception assertions (`Assert.ThrowsException<Exception>`). |140| **F** | No assertions at all; **all** assertions are always-true literals (`Assert.IsTrue(true)`, `assert True`, `expect(true).toBe(true)`) — these verify nothing and are equivalent to having no assertions; or all assertions are silently un-awaited (e.g., `expect(promise).resolves.toBe(x)` without `await`/`return`, async TUnit/xUnit `Assert.ThrowsAsync` without `await`, pytest-asyncio with un-awaited coroutine). |141142Exception tests (`Assert.ThrowsException<T>`, `pytest.raises`, `expect(fn).toThrow`,143`assertThrows`, `#[should_panic]`, `Should -Throw`, `EXPECT_THROW`) are144complete on their own — do not require additional assertions.145146##### B. Structure & focus147148| Sub-grade | Pattern |149|-----------|---------|150| **A** | Clear Arrange-Act-Assert (or Given-When-Then) separation. Single behavior under test. Body under ~30 lines. Setup uses framework conventions. |151| **B** | One mild structural issue (slightly long body, missing blank lines between phases) but intent is clear. |152| **C** | Multiple behaviors mixed in one test, or AAA phases interleaved enough to slow comprehension. |153| **D** | Conditional logic in the test (`if`/`switch` driving assertions) — except for idiomatic Go/Rust table-driven sub-test loops; or test relies on previous test state (ordering dependency). |154| **F** | Test exceeds ~60 lines and verifies multiple unrelated behaviors; or shares mutable state with other tests through statics/globals without reset. |155156##### C. Anti-pattern hygiene157158Scan against the catalog below. The Anti-pattern sub-grade is computed159in two passes and combined deterministically:1601611. **Hard ceiling pass.** Every **Critical** or **High** finding sets a162 maximum sub-grade (F, D, or C as labeled). Take the **worst** ceiling163 across all matched Critical/High findings — these do not accumulate164 (a single F finding caps the sub-grade at F regardless of how many165 other Critical/High findings are present).1662. **Medium-deduction pass.** Start from **A**, then for each **Medium**167 finding deduct one sub-grade level (A→B, B→C, C→D, D→F). These do168 accumulate across findings.169170The final Anti-pattern sub-grade is the **worse** of the two passes171(i.e., `min(hard_ceiling, A − medium_count)`). **Low** findings never172affect the grade — mention them in the note only.173174Examples (Critical/High and Medium counts → Anti-pattern sub-grade):175176- Zero Critical/High, 1 Medium → **B** (A − 1)177- Zero Critical/High, 3 Medium → **D** (A − 3)178- One C-ceiling (e.g., over-mocking), 0 Medium → **C**179- One C-ceiling, 2 Medium → **D** (`min(C, A − 2 = C) = C`, but a third Medium would tip to **D**)180- One F-finding (e.g., swallowed exception) plus any number of Medium → **F**181182**Critical (drop straight to F or D)**183184- No assertions at all → F (also drives Assertion sub-grade to F)185- Swallowed exceptions: `try { … } catch { }` (.NET), bare `except: pass`186 (Python), `try { … } catch (e) {}` (JS/TS/Java), `defer recover()`187 without re-panic (Go), `rescue StandardError` with no assertion (Ruby),188 empty `catch` (Kotlin/Swift) → F189- Assert-in-catch pattern (`Assert.Fail(ex.Message)` instead of190 `Assert.ThrowsException`) → D191- Always-true literal assertions (`Assert.IsTrue(true)`, `assert True`,192 `expect(true).toBe(true)`) → **F** (verifies nothing; also drives193 Assertion sub-grade to F)194- Self-referential / tautological assertions on bound values195 (`Assert.AreEqual(x, x)`, `assert dto.name == dto.name`) → D196- Commented-out assertions → D197198**High (drop one or two sub-grades)**199200- Wall-clock sleep used for synchronization: `Thread.Sleep`, `Task.Delay`,201 `time.sleep`, `setTimeout`-based wait, `Thread.sleep`, `time.Sleep`,202 `sleep`, `std::thread::sleep`, `Start-Sleep`,203 `std::this_thread::sleep_for` (in a unit test) → D204- Unseeded randomness, wall-clock reads without abstraction205 (`DateTime.Now`, `datetime.now()`, `Date.now()`,206 `System.currentTimeMillis()`, `time.Now()`, `Time.now`,207 `Instant::now()`, `Get-Date`, `system_clock::now`) → D208- Hard-coded environment-dependent paths (`C:\…`, `/tmp/…`, network hosts) → D209- Ordering dependency on mutable static / package globals → D210- Broad exception assertion (`Assert.ThrowsException<Exception>`,211 `pytest.raises(Exception)`, `expect(fn).toThrow(Error)` without matcher,212 `#[should_panic]` without `expected = "…"`, `Should -Throw` without213 `-ExpectedMessage`, `EXPECT_ANY_THROW`) → C214- Over-mocking: more mock setup lines than test logic, or verifying exact215 call sequences instead of outcomes → C216- Implementation coupling: reflection on private members, casting to217 internal types to access state → C218219**Medium (drop one sub-grade)**220221- Poor name: `Test1`, `TestMethod`, `test`, single-word name that says222 nothing about scenario or expected outcome (judge against the language223 extension's convention) → drop one sub-grade224- Magic values: unexplained `42`, `"foo"`, `0x1234` in arrange/assert225 without naming or comment → drop one sub-grade226- Giant test (>30 lines covering a single behavior) → drop one sub-grade227- Assertion messages that just repeat the assertion text → drop one sub-grade228- Missing AAA / GWT separation when the test is non-trivial → drop one sub-grade229230**Low (note only, no deduction)**231232- Unused setup/teardown hooks; print debugging left in (`Console.WriteLine`,233 `print`, `console.log`, `System.out.println`, `fmt.Println`, `puts`,234 `dbg!`, `Write-Host`, `std::cout`); inconsistent naming versus siblings;235 leftover TODO comments. Mention in the note column but do not deduct.236237#### Combining sub-grades238239Convert sub-grades to numeric points: A=4, B=3, C=2, D=1, F=0.240- **Overall score band** = weighted average:241 `0.45 × Assertion + 0.30 × Anti-pattern + 0.25 × Structure`242- Map to letter:243 - ≥ 3.5 → **A** (band 90–100)244 - ≥ 2.8 → **B** (band 80–89)245 - ≥ 2.0 → **C** (band 70–79)246 - ≥ 1.2 → **D** (band 60–69)247 - < 1.2 → **F** (band 0–59)248- The overall grade is **capped at the worst sub-grade** — if any sub-grade249 is **F**, the overall grade is **F**; if the worst sub-grade is **D**,250 the overall grade is at most **D**; and so on. A test that fails on any251 one dimension cannot earn a higher overall grade than that dimension.252253Report the **letter grade** and the **score band** (not a single 0–100254number). False precision invites bikeshedding; bands keep the conversation255focused on the rubric.256257### Step 4: Build the note258259The note column is one short sentence (target ≤ 120 characters). State the260single most important reason for the grade. Examples:261262- A (90–100): `Clear AAA structure; equality + exception assertions on the public contract.`263- B (80–89): `Good assertion variety, mildly long body — consider splitting into per-condition tests.`264- C (70–79): `Only checks IsNotNull on the result; no value verification.`265- D (60–69): `Self-referential assertion: round-trip identity verifies plumbing, not transformation.`266- F (0–59): `No assertions — test executes the method but never verifies anything.`267268If a test gets A with no notable issues, the note may simply be269`No issues found.` — do not invent weaknesses to justify the grade.270271### Step 5: Report272273Produce two sections.274275#### 1. Summary276277A short paragraph (2–4 sentences) covering: total tests graded, grade278distribution, most common issue, and the single most important279recommendation.280281#### 2. Per-test table282283```markdown284| Test | Grade | Band | Notes |285|------|-------|------|-------|286| `Namespace.ClassName.Test_Method_Condition_Expected` | A | 90–100 | Clear AAA; equality + exception assertions. |287| `Namespace.ClassName.Test_Other` | C | 70–79 | Only `IsNotNull` — no value verification. |288| `Namespace.ClassName.Test_Old` | F | 0–59 | No assertions. |289```290291**Caps and ordering**:292- If the table would exceed **50 rows**, show all tests graded below **B**293 first (worst to best), then a sample of the best tests, and wrap any294 overflow in a collapsed `<details>` block.295- Within the same grade, order by file path then by method name for296 determinism.297- If the diff context is provided, prefix each test name with a `(new)` or298 `(modified)` marker.299300If multiple languages are present, produce one table per language and301prefix each section with the language name and framework.302303## Validation304305- [ ] Every test in the input list appears in the table (or is recorded as306 `N/A — method not found`).307- [ ] Every grade is justified by at least one observable signal in the308 captured body — no speculative deductions.309- [ ] Trivial-assertion tests are flagged only when the **only** assertion310 is trivial (a null check before a meaningful assertion is not trivial).311- [ ] Exception-only tests are not penalized for low assertion count.312- [ ] Mock-call verifications and bare assertion forms count as real313 assertions of the appropriate category.314- [ ] Boolean assertions on meaningful properties (`Assert.IsTrue(result.IsValid)`)315 are not classified as always-true; only literal `true`/`false` constants are.316- [ ] Self-referential assertions are flagged separately from normal317 equality assertions.318- [ ] Idiomatic patterns are not flagged: Go/Rust table-driven sub-tests,319 pytest bare `assert`, Go `if got != want { t.Errorf(...) }`,320 JS/TS `expect(mock).toHaveBeenCalledWith(...)`.321- [ ] Async test pitfalls (un-awaited `resolves`/`rejects`/`ThrowsAsync`,322 pytest-asyncio without `await`) drop the Assertion sub-grade to F.323- [ ] The summary leads with the highest-leverage observation, not a recap324 of the table.325326## Common Pitfalls327328| Pitfall | Solution |329|---------|----------|330| Grading every test in the workspace when no list is provided | Ask the caller for the explicit list; this skill is for curated input. |331| Inflating deductions to justify the grade | Start at A; deduct only for observable issues. |332| Penalizing exception tests for low assertion count | Exception assertions are complete on their own. |333| Treating `IsNotNull` before a value assertion as trivial | Only flag when the null check is the **only** assertion. |334| Treating any Boolean assertion as effectively assertion-free | Only always-true literals (`Assert.IsTrue(true)`, `assert True`) are; meaningful `Assert.IsTrue(result.IsValid)` is a real assertion. |335| Flagging Go/Rust table-driven loops as conditional logic | They are idiomatic; do not deduct. |336| Treating pytest bare `assert` or Go `if got != want { t.Error… }` as missing-framework | Both are canonical; count in the correct assertion category. |337| Penalizing tests when production code is unavailable | Mark concerns about uncovered behaviors as `Unverified` and do not deduct. |338| 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| Spilling a 500-row table into a PR comment | Apply the row cap from Step 5; collapse extras into `<details>`. |340| Re-reporting an existing finding three times under different categories | Pick the most fitting category and report once. |341| Inventing weaknesses for A-grade tests to make the note "balanced" | If a test is clean, the note may simply read `No issues found.` |