Test Evaluator
ASecurityEvaluates an application's tests for quality. It measures branch coverage with the ecosystem's native tool (coverage.py, Jest/Vitest/c8/Node, JaCoCo, coverlet, PHPUnit, SimpleCov, llvm-cov…) and scores the tests against five criteria. (1) Do they test behavior through a public interface rather than internals? (2) If the code is deliberately broken, do they fail with a clear message? This is checked by actually breaking the code in an isolated copy. (3) Are they readable as documentation, with...
- 3 stars
- 0 votes
- 0 copies
- 0 views
- Added December 4, 2026
Works with
Security analysis
100/100Pro scans all 3 files and shows the line behind each finding
npx -y skills add faelwar/pragmatic-programmer --skill test-evaluator --agent claude-codeAre you the author of Test Evaluator?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/faelwar-test-evaluator)---
name: test-evaluator
description: Evaluates an application's tests for quality. It measures branch coverage with the ecosystem's native tool (coverage.py, Jest/Vitest/c8/Node, JaCoCo, coverlet, PHPUnit, SimpleCov, llvm-cov…) and scores the tests against five criteria. (1) Do they test behavior through a public interface rather than internals? (2) If the code is deliberately broken, do they fail with a clear message? This is checked by actually breaking the code in an isolated copy. (3) Are they readable as documentation, with clear Arrange/Act/Assert? (4) Are they FIRST: Fast, Isolated, Repeatable, Self-validating, Timely? (5) Do they cover boundaries and error paths, not just the happy path? Returns a scorecard with a rating per criterion, the uncovered branches, evidence at file:line, and prioritized fixes. Never leaves the user's code modified. Use whenever the user asks to "evaluate", "grade", "score" or "assess" their tests, asks about "branch coverage", whether tests are "good", "FIRST", "readable", "testing implementation details", "covering edge cases", or wants a test-quality scorecard for a file, module, diff or suite, in any language.
---
# Test Evaluator
Coverage tells you **where** the tests go. The five criteria tell you **whether what they do there is worth anything**. This skill measures both and returns one scorecard. Every rating rests on evidence: a measured number, an observed failure, or a `file:line`. Impressions are not evidence.
## Ground rules
- **Never leave the user's code modified.** Snapshot `git status --porcelain` before starting and confirm it is identical at the end. If git is unavailable (not a repo, or the binary can't run), record SHA-256 checksums of every file in scope instead (`shasum -a 256`, `sha256sum`, or a short script) and compare them at the end. Deliberate breakages (§4) happen only in an isolated copy.
- **Do not change manifests, lockfiles or test config without asking.** Run coverage tools ephemerally where possible (`references/coverage-tools.md`). If branch coverage needs a config change, ask, or fall back to the static branch inventory.
- **Do not edit tests or source.** Recommend fixes; write them only if asked afterwards.
- **A green baseline comes first.** If tests fail before you touch anything, report which, then evaluate the rest and say so.
## 1. Resolve the scope
| User says | Production code under evaluation | Tests evaluated |
|---|---|---|
| a file / module / folder | that code | the tests that exercise it |
| "my changes" / PR / branch | production files changed vs. base | tests changed + tests exercising those files |
| "the suite" / nothing specific | the main source tree (or ask if the repo is large) | all tests, sampled by module for large suites |
Map tests to code by imports and naming conventions. Note production files with **no** tests at all; they get their own line in the report.
## 2. Measure branch coverage
Read `references/coverage-tools.md` for the command per ecosystem and where its branch data lands.
1. Run the scoped tests with **branch** coverage enabled (not just line or statement coverage). Record the overall branch %, the branch % per file, and the **specific uncovered branches** (e.g. coverage.py `12->15`, Istanbul's uncovered `if` paths, JaCoCo `BRANCH_MISSED` per line).
2. Record the wall time of the run. You need it for "Fast".
3. If the ecosystem has no branch coverage (e.g. Go, which is statement-only), or the tool cannot run without unapproved changes, build a **static branch inventory**: list each decision point in the target (every `if`/`else`, ternary, `switch`/`match` arm, short-circuit `&&`/`||`/`??`, `try`/`catch`, early return or guard, and loop zero-versus-many iterations), then mark each as exercised or not by tracing which tests reach it. Label the result **estimated**, and state the measured line or statement % alongside it if available.
4. Translate the uncovered branches into behavior: "`withdraw` with an amount larger than the balance is never tested", not "line 14 false branch". These feed criterion 5.
## 3. Evaluate the five criteria
Read `references/rubric.md` at the start of every evaluation. It defines what to check for each criterion, the code-level signals, and what earns **Strong / Adequate / Weak / Failing**. Evaluate every test in scope against every criterion. For a large suite, evaluate a representative sample per module and say so.
1. **Public interface, not internals.** Do tests call the API that real callers use and assert observable outcomes? Or do they reach into private fields or methods, mock the unit's own internals, or assert call sequences that are incidental?
2. **Breaks are caught, with a clear message.** Measured in §4.
3. **Readable as documentation.** Does the test name state the behavior and expected outcome? Are Arrange / Act / Assert visibly separated, with one Act? Is the relevant data visible and the irrelevant data hidden?
4. **FIRST.** **F**ast (measured time; real I/O, sleeps or network in unit tests). **I**solated (shared mutable state, order dependence, external resources). **R**epeatable (real clock, randomness without a seed, environment or locale dependence). **S**elf-validating (it asserts something; no "check the log"; no assertions that cannot fail). **T**imely (tests arrive with the code: compare git history of source versus tests where available, and look at whether recent changes came with tests).
5. **Boundaries and error paths.** Does each rule with a threshold have tests at, just below and just above it? Are invalid inputs, empty, null or zero values, max values, and each thrown error or rejected promise tested, including the message or type where it matters? Use the uncovered branches from §2 as hard evidence.
## 4. Deliberate-break probes (criterion 2)
Do not guess whether tests would catch a break. Break the code and look.
1. **Isolate.** `git worktree add --detach "<scratchpad>/eval-worktree" HEAD`, and copy in any uncommitted target files. Without git, `cp -R` the project (excluding dependency and build dirs) into the scratchpad. Symlink dependency dirs (`node_modules`, `.venv`, `vendor`) rather than reinstalling. Confirm the baseline is green in the copy.
2. **Pick 4–10 probe sites** covering the most important behaviors in scope: a core calculation, a boundary comparison, a guard or validation, an error branch, a side effect (save, send, publish), and a returned value. Prefer **covered** code: a break in uncovered code is already known to be missed.
3. **For each probe**, apply one realistic break (flip a comparison, return a wrong value, delete a guard or side-effect call, change a constant). Run the relevant tests with a timeout of about 3× baseline, then record:
- **Caught?** Which test(s) failed. If none failed, record it as **missed**.
- **Message clarity**: quote the first failure line. It is **clear** if it names the behavior or shows expected versus actual in domain terms (`expected total 90, got 100`, a test named `applies_discount_at_exactly_100`). It is **unclear** if it says only `false is not true`, `AssertionError`, `expected undefined to be truthy`, or the failure comes from a crash in unrelated code, or a giant snapshot diff.
- Restore the file and verify it is restored.
4. **Tear down**: `git worktree remove --force "<scratchpad>/eval-worktree"` (or delete the copy), then compare the user's tree against the snapshot (git status or checksums).
If the user wants an exhaustive measurement, recommend the `x-men-tester` skill (full mutation testing). For a deeper code-level review of test design problems, recommend `test-smeller`.
## 5. Rate and prioritize
Rate each criterion **Strong / Adequate / Weak / Failing** using the rubric. Ratings are about the suite in scope, but every Weak or Failing rating must cite the specific tests responsible.
Prioritize recommendations by risk, not by criterion order:
1. Missed probes and assertions that cannot fail: the suite gives false confidence.
2. Uncovered error paths and boundaries in core or business logic.
3. Isolation and repeatability problems: results cannot be trusted.
4. Tests coupled to internals: they block refactoring.
5. Readability and speed.
## 6. Report format
```markdown
# Test Evaluation — <target>
**Verdict:** <one line, e.g. "Good happy-path coverage, but 3 of 6 deliberate breaks went unnoticed and no error path in withdraw() is tested">
**Scope:** <N production files, M tests in K files; framework> · **Run:** `<command>` in <time> · **Baseline:** <green | n failing, listed below>
## Scorecard
| # | Criterion | Rating | Key evidence |
|---|---|---|---|
| 1 | Public interface, not internals | Weak | 4 tests assert on `_history` |
| 2 | Breaks caught with clear message | Failing | 3/6 probes missed; 2 caught with unclear messages |
| 3 | Readable as documentation (AAA) | Adequate | … |
| 4 | FIRST | Weak | F ✓ · I ✗ · R ✓ · S ✓ · T ? |
| 5 | Boundaries & error paths | Failing | branch coverage 58%; 0 of 3 error branches tested |
## Branch coverage
**Overall:** <n>% branches (<covered>/<total>) · <n>% lines — <measured with <tool> | estimated (static inventory) because …>
| File | Branch % | Uncovered branches (as behavior) |
|---|---|---|
| `src/account.js` | 50% | `withdraw` amount ≤ 0 (L12); `withdraw` amount > balance (L13); `fee` below 1000 (L20) |
Production files with no tests: <list or "none">
## Deliberate-break probes
| # | Where | Break | Caught by | Failure message | Verdict |
|---|---|---|---|---|---|
| 1 | `src/account.js:13` | `>` → `>=` | — | — | ✗ missed |
| 2 | `src/account.js:15` | `-=` → `+=` | `withdraw reduces balance` | `expected 70, got 130` | ✓ clear |
## Findings by criterion
### 1. Public interface, not internals: <rating>
- `tests/account.test.js:8`: <what the test does> → <why it matters> → **Fix:** <concrete change>
(repeat for each criterion; only list criteria with something to say beyond the scorecard)
## Top recommendations
1. <highest-risk fix, with the test(s) to add or change; short code sketch when it helps>
2. …
## Housekeeping
- Working tree restored: <yes, git status (or file checksums) identical to the pre-run snapshot>
- Coverage artifacts: <where they were written (scratchpad), or removed>
- Not evaluated / limitations: <sampled modules, tools that could not run, Timely without git history, …>
```
Omit empty sections. When a criterion is genuinely Strong, say so in one line. Do not invent problems. Ratings are relative to what the tests are for: a thin integration suite is not "Failing" on boundaries if the boundaries are well covered by unit tests elsewhere, but say where that coverage lives.
Files in this skill
- SKILL.md
- references/coverage-tools.md
- references/rubric.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.