| name | review-tests |
| description | Test quality review skill. Evaluates test validity, coverage thresholds, BDD scenario matching, edge cases, test structure, and error path testing. |
| argument-hint | Invoked by Review Coordinator - do not call directly |
review-tests - Test Quality Review Skill
This skill is invoked by the Review Coordinator as a subagent. It evaluates all test files associated with a WP across 6 quality dimensions, checking that tests exercise real behavior and meet coverage thresholds.
Input contract (received via subagent prompt):
- Read this SKILL.md file for review instructions.
- Read the specification file for acceptance scenarios and BDD requirements.
- Read the WP file to identify in-scope tasks, FRs, and test requirements.
- Discover and read all test files associated with this WP.
- Evaluate each checklist item below against the discovered test code.
- Write structured findings to the specified output path.
- Return a brief summary (counts of PASS/WARN/FAIL/N/A).
Constraint: Do NOT modify any test files, source code, WP file, or spec file. Only write to the specified output path (FR-028).
Test Quality Checklist
Before evaluating, identify all test files for this WP:
- Look for test files in
tests/, test/, __tests__/, or spec/ directories
- Match test files to WP source files by naming convention or import analysis
- Check the WP's task descriptions for
Test requirements fields to identify expected test types (unit, integration, BDD, E2E, none)
Dimension 1: Test Validity (FR-040.1)
Detection patterns (adapt for the project's language):
- Python:
assert True, self.assertTrue(True), def test_*(): pass, def test_*(): ...
- JavaScript/TypeScript:
expect(true).toBe(true), it('...', () => {}), test('...', () => {})
- Look for tests that mock the function being tested and only assert the mock was called
Dimension 2: Coverage Thresholds (FR-040.2)
If coverage tooling is configured: read existing coverage reports (e.g., htmlcov/, coverage.xml, .coverage, lcov.info, coverage/lcov-report/) and report actual thresholds found in the reports. If no reports exist, check the coverage configuration (e.g., pytest-cov in pyproject.toml, .coveragerc, jest --coverage in package.json, .nycrc) and flag as WARN - "Coverage tooling is configured but no coverage reports found. Cannot verify thresholds." Do NOT execute test runners or coverage tools (NFR-004: static analysis only).
If coverage tooling is NOT configured: flag as WARN - "No coverage tooling configured. Cannot verify thresholds."
Dimension 3: BDD Scenario Matching (FR-040.3)
Dimension 4: Edge Case Coverage (FR-040.4)
Dimension 5: Test Structure (FR-040.5)
Dimension 6: Error Path Testing (FR-040.6)
Severity Guidance (FR-041)
FAIL - Must fix before approval
- Vacuous tests:
assert True, empty test bodies, no assertions, mocking entire subject under test
- Code coverage below 80% threshold without documented justification
- Branch coverage below 90% threshold without documented justification
- Missing BDD scenario coverage for acceptance scenarios mapped to this WP
WARN - Should address, does not block approval
- Test naming does not clearly describe the behavior being tested
- Minor structural concerns: shared setup that could be more focused
- Coverage exclusion markers present with justification (acceptable but noted)
- Test organization could be improved (multiple concerns in one test)
N/A - Not applicable
Use N/A with justification when a checklist dimension does not apply to this WP. Example justifications:
- "No test files in this WP - WP produces configuration/documentation only"
- "No BDD scenarios mapped to this WP's FRs in spec Section 11.2"
- "No API error responses specified for this WP's scope"
Output Format
Write findings to the specified output path using the format below. Finding IDs use the TEST- prefix.
---
skill: review-tests
wp: <WP-ID>
spec: <spec-path>
reviewed_at: <ISO-8601-timestamp>
status: completed
finding_counts:
pass: <count>
warn: <count>
fail: <count>
na: <count>
files_reviewed:
- <test-file-1>
- <test-file-2>
- <source-file-checked-for-coverage>
---
# review-tests Findings for <WP-ID>
## Summary
<Brief overview: number of test files reviewed, test count, overall test quality assessment.>
## Findings
### TEST-001 [FAIL]
- **Checklist item**: Test Validity - Vacuous test
- **Requirement**: FR-040 dimension 1
- **File**: tests/test_users.py#L25-L28
- **Description**: Test `test_user_creation` contains only `assert True`.
- **Expected**: Test should assert specific behavior of the user creation function.
- **Evidence**:
```python
def test_user_creation():
assert True
TEST-002 [PASS]
- Checklist item: Test Structure - Arrange/Act/Assert
- Requirement: FR-040 dimension 5
- File: tests/test_auth.py
- Description: All 12 test functions follow clear Arrange/Act/Assert structure.
TEST-003 [WARN]
- Checklist item: Test Structure - Naming
- Requirement: FR-040 dimension 5
- File: tests/test_utils.py#L10
- Description: Test function
test_1 has a non-descriptive name.
- Expected: Name should describe the behavior being tested, e.g.,
test_parse_config_returns_default_on_missing_key.
- Evidence:
def test_1():
TEST-004 [N/A]
- Checklist item: Edge Case Coverage - Concurrent access
- Justification: No concurrency requirements specified for this WP's scope.