Comprehensive Unit Test Suite Generation (AAA Pattern)
Generate mutation-tested unit tests with Arrange-Act-Assert structure, boundary cases, and proper mock boundaries.
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.
Analyze Function Invariants & Boundaries
Inspect the source code to map all conditional branches, boundary thresholds (0, negative, max values), and exception triggers.
Structure Tests with AAA Pattern
Write individual, single-behavior tests structured clearly into Arrange, Act, and Assert phases with descriptive naming.
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.
Domain Verification Checks
Example Agent Invocations
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.
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.
SprintKit Workflow Integrations
Complementary tools and checklists to pair with this agent workflow.
Related Agent Skills
Explore related procedural workflows in this discipline.
Containerized Integration Testing with Testcontainers
Create robust integration test suites with real databases in Docker containers and contract verification.
Flaky CI Test & Async Timing Resolution
Fix nondeterministic test failures, unhandled async promises, and race conditions in Playwright, Jest, or Vitest.
Strict TypeScript Type Safety & Soundness Audit
Audit TypeScript code for type safety, type narrowing, generics, mutation traps, and runtime boundary validation.