| name | test-review |
| description | Test quality checklist, security testing requirements, dynamic analysis, and test organization conventions for Java/Spring Boot applications. Load when conducting test reviews. |
| compatibility | ["claude-code","github-copilot","opencode","junie-cli"] |
| reads | ["docs/testing-principles.md"] |
| metadata | {"version":"1.0","author":"team"} |
Project Testing Policy (read from the brief)
The policy values this review enforces are project-owned and live in docs/testing-principles.md: the test pyramid ratios (§ Test Pyramid), the coverage target and scope (§ Coverage), the mocking policy (§ Mocking Policy), and the naming school (§ Test Naming). Read them before reviewing and enforce what the brief says, not remembered defaults — the brief is the contract that survives harness upgrades. If the brief contradicts itself or the code under review reveals a gap in it, raise a clarify finding against the brief instead of silently substituting your own values.
Test Quality Checklist
Mocking Policy
The policy is the brief's (§ Mocking Policy) — enforce what it declares, not remembered defaults. Java-specific application:
AssertJ Assertions
Test Structure (see testing-principles.md)
Test Data Naming (see testing-principles.md, Three-Tier Convention)
Edge Case Coverage
Test Coverage
Parameterized Tests
State and Idempotency Testing
Security Testing Requirements
Boundary Testing
Error Path Testing
Concurrency Testing
Input Validation Testing
Dynamic Analysis
Build-Gate Analysis
./gradlew check
Runs the tests plus every bound static check (Spotless format among them). The quality gate's Build check (./gradlew build) runs check, so a failure blocks merge.
Concurrency
The JVM ships no race detector (Go's -race has no equivalent). Confidence comes from tests: repeated racy scenarios, CountDownLatch-choreographed interleavings, and review attention on shared mutable state. Escalate untested shared state; never assume safety.
Fuzz and Adversarial Testing
For input-parsing code, adversarial coverage is required. Bind a JVM fuzzer where the build declares the Jazzer dependency (com.code-intelligence:jazzer-junit); the floor is @ParameterizedTest over adversarial fixtures (malformed, truncated, oversized input).
Test Organization
Naming Conventions
The naming school is the brief's (§ Test Naming); the machine floor is test_name_pattern in scripts/layout.toml. Test data lives in test-data/ at the project root.
Common Issues to Flag
[AUTOFIX] Issues
- Missing
@ParameterizedTest for repetitive cases
- Wrong assertion style (JUnit instead of AssertJ)
- Non-descriptive test name
- Missing edge case in table-driven test
[ESCALATE] Issues
- No integration test for external service
- Test coverage below the brief's target (§ Coverage)
- No concurrent access testing for shared state
[CLARIFY:security-reviewer] Issues
- Test exposes sensitive data handling patterns
- Error message content needs security review