Test review

From woditschka/agentic-coding-reference · View interactive version

Test review is an AI agent skill from the GitHub repository woditschka/agentic-coding-reference. Test quality checklist, security testing requirements, dynamic analysis, and test organization conventions for Go applications. Load when conducting test reviews.

How to use this skill

Skill file

Project Testing Policy (read from the brief)

The policy values this review enforces are project-owned and live in CODE0: the test pyramid ratios (§ Test Pyramid), the coverage measure (§ 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 Placement

The brief's pyramid section is a placement rule, not a ratio to eyeball. The design doc's assignment governs. For every new or changed rule in the diff, find the component docs/system-design.md assigns it to, then check where its tests landed:

Judge placement against the components docs/system-design.md assigns first and docs/testing-principles.md § Test Pyramid second, never a remembered ratio. A brief sentence that reads unconditionally yields to the design doc's assignment; a conflict between the two briefs is a clarify to the system-design-expert. Every placement finding cites the assignment it enforces.

Test Quality Checklist

Test Coverage

Table-Driven Tests

Useful Failure Messages

Test Helpers

Mocking Policy

The policy is the brief's (§ Mocking Policy). Go-specific application of its boundary rule:

| Mock Type | Acceptable | Location |

|-----------|------------|----------|

| HTTP client | Yes | System boundary |

| Internal types | No | Use real implementation |

| Time/Clock | Yes | Deterministic testing |

The governing principle is tested-as-spec: a test asserts observable outcomes, and a fake's call record is asserted only where the interaction itself is the contract. Each call-record assertion in the changed tests is cleared by naming the behavioral assertion it does not duplicate, or is an autofix finding, severity fixable.

Security Testing Requirements

Boundary Testing

Error Path Testing

State and Idempotency Testing

Concurrency Testing

Input Validation Testing

Dynamic Analysis

Go Race Detector

go test -race ./...

Detects data races at runtime. Should run on all tests in CI.

Vet and Static Analysis

go vet and golangci-lint ride the gate's vet and lint checks, which the reviewer never re-runs; a red one never reaches review.

Fuzz Testing (Go 1.18+)

For input parsing code, verify fuzz tests exist:

func FuzzParseInput(f *testing.F) {
    f.Add([]byte(`{"id":"test"}`))
    f.Fuzz(func(t *testing.T, data []byte) {
        // Should not panic
        ParseInput(data)
    })
}

Fuzz test requirements:

Test Organization

File Naming

Build Tags for Integration Tests

//go:build integration

package mypackage_test

Test Data

Common Issues to Flag

[AUTOFIX] Issues

[ESCALATE] Issues

[CLARIFY:security-reviewer] Issues

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.