Testing & QA Automation
Compatible with Cursor, Claude Code, Cline, Roo Code, Antigravity, GitHub Copilot

Comprehensive Unit Test Suite Generation (AAA Pattern)

Generate mutation-tested unit tests with Arrange-Act-Assert structure, boundary cases, and proper mock boundaries.

TestingJUnitVitestPytestJestTDD
Skill Objective

Generate comprehensive unit test suites covering 100% of branches, boundary conditions, malicious inputs, and custom exception handling.

Execution Workflow Procedure

Ordered steps the coding agent executes when performing this skill.

1

Analyze Function Invariants & Boundaries

Inspect the source code to map all conditional branches, boundary thresholds (0, negative, max values), and exception triggers.

2

Structure Tests with AAA Pattern

Write individual, single-behavior tests structured clearly into Arrange, Act, and Assert phases with descriptive naming.

3

Mock Only at System Boundaries

Mock external I/O (network, database, clock) while testing pure domain logic and value objects with real instances.

Agent Safety Guardrails & Anti-Hallucination Rules

  • DO NOT over-mock internal data structures or helper functions; test public interfaces.
  • DO NOT write tests that assert multiple unrelated behaviors in a single test case.

Expected Output Format

Runnable test file with 100% branch and edge case coverage.

🧪 Complete Test File: Fully typed, runnable test suite.
📋 Edge Case Matrix: Summary of boundary values tested.

Domain Verification Checks

Boundary Threshold Coverage: Tests exact cutoff numbers (e.g. 99.99 vs 100.00).
Exception Verification: Verifies custom error classes and exact messages.
Parameterized Matrices: Uses table-driven tests for large input permutations.

Example Agent Invocations

"Generate a comprehensive Vitest unit test suite for this pricing calculator class."
"Write JUnit 5 unit tests covering all edge cases and exceptions for this user registration service."

Install / Configure This Skill

# Place in .cursorrules or create .cursor/rules/comprehensive-unit-test-generation.mdc
# Trigger: Whenever you perform comprehensive unit test suite generation (aaa pattern)

---
name: comprehensive-unit-test-generation
description: Generate complete unit test suites adhering to Arrange-Act-Assert with boundary conditions and mock isolation.
version: 1.2.0
compatibility: [Cursor, Claude Code, Cline, Roo Code, Antigravity]
---

# Comprehensive Unit Test Suite Generation (AAA Pattern)

## Objective
Produce reliable, mutation-tested unit test suites with clear Arrange-Act-Assert separation and comprehensive edge case matrices.

## Workflow
1. **Branch & Boundary Mapping**: Identify all decision paths, boundary thresholds, and exception conditions.
2. **AAA Formatting**: Structure tests with clear Arrange, Act, Assert sections and readable test names.
3. **Mock Isolation**: Mock only external I/O boundaries while testing domain logic directly.
Complementary Agent Prompt

Need a quick one-time prompt for chat?

Try the Unit Test Suite Generator with Edge Cases — a lightweight version designed for 1-click copying directly into Claude, ChatGPT, or Cursor chat.

View Prompt

SprintKit Workflow Integrations

Complementary tools and checklists to pair with this agent workflow.

Related Agent Skills

Explore related procedural workflows in this discipline.

All Skills

Containerized Integration Testing with Testcontainers

Create robust integration test suites with real databases in Docker containers and contract verification.

Integration TestingTestcontainersPlaywright+2
3 workflow stepsView skill

Flaky CI Test & Async Timing Resolution

Fix nondeterministic test failures, unhandled async promises, and race conditions in Playwright, Jest, or Vitest.

TestingPlaywrightVitest+3
3 workflow stepsView skill

Strict TypeScript Type Safety & Soundness Audit

Audit TypeScript code for type safety, type narrowing, generics, mutation traps, and runtime boundary validation.

TypeScriptNode.jsClean Code+1
4 workflow stepsView skill