124 lines
3.0 KiB
Markdown
124 lines
3.0 KiB
Markdown
---
|
|
name: generate-testplan
|
|
description: Structured test plan from implementation plan / assessment.
|
|
---
|
|
|
|
# Skill: generate-testplan
|
|
|
|
Structured test plan from implementation plan / assessment.
|
|
|
|
## Invoked by
|
|
|
|
📋 Planner mode
|
|
|
|
## Required Inputs
|
|
|
|
| Input | Source | Example |
|
|
|-------|--------|---------|
|
|
| `TICKET_KEY` | Jira issue key | `PROJECT-123` |
|
|
| `MODULE` | Module/component name | `auth`, `api`, `core` |
|
|
| `PLAN_PATH` | Path to plan.md | `docs/auth/PROJECT-123/PROJECT-123-plan.md` |
|
|
|
|
## Output
|
|
|
|
Markdown file: `docs/<MODULE>/<TICKET_KEY>/<TICKET_KEY>-testplan.md`
|
|
|
|
## Steps
|
|
|
|
### 1. Read the implementation plan
|
|
|
|
Understand which classes/methods are being added or modified, data flows affected, database changes, and integration points.
|
|
|
|
### 2. Identify testable units
|
|
|
|
| Category | What to test | Test type |
|
|
|----------|-------------|-----------|
|
|
| New methods | Input/output, edge cases, null handling | Unit |
|
|
| Modified methods | Regression + new behavior | Unit |
|
|
| Database changes | Migration up/down, data integrity | Integration |
|
|
| Data flows | End-to-end processing | Integration |
|
|
| Error paths | Invalid input, missing data, error responses | Unit |
|
|
|
|
### 3. Generate test plan document
|
|
|
|
```markdown
|
|
# Test Plan: <TICKET_KEY> — <Summary>
|
|
|
|
**Date:** <today>
|
|
**Module:** <MODULE>
|
|
**Author:** Lumen (Planner)
|
|
**Status:** Draft v1
|
|
**Based on:** <TICKET_KEY>-plan.md
|
|
|
|
---
|
|
|
|
## Test Overview
|
|
|
|
| ID | Description | Type | Class | Status |
|
|
|----|-------------|------|-------|--------|
|
|
| T-01 | <short desc> | Unit | <TestClass> | ⬜ |
|
|
| T-02 | <short desc> | Unit | <TestClass> | ⬜ |
|
|
| T-03 | <short desc> | Integration | <TestClass> | ⬜ |
|
|
|
|
Status: ⬜ Open | ✅ Passed | ❌ Failed | ⏭️ Skipped
|
|
|
|
---
|
|
|
|
## Test Cases
|
|
|
|
### T-01: <Descriptive name>
|
|
|
|
**Type:** Unit
|
|
**Class:** `<package>.<TestClassName>`
|
|
**Method:** `test<MethodName>()`
|
|
|
|
**Preconditions:**
|
|
- <setup requirements>
|
|
|
|
**Scenarios:**
|
|
|
|
| # | Input | Expected Result |
|
|
|---|-------|----------------|
|
|
| a | <input> | <expected> |
|
|
| b | <input> | <expected> |
|
|
| c | <edge case> | <expected> |
|
|
|
|
---
|
|
|
|
## Test Data
|
|
|
|
<Describe test data requirements, fixtures, or database setup needed.>
|
|
|
|
## Test Coverage
|
|
|
|
| Component | Unit | Integration | Total |
|
|
|-----------|------|-------------|-------|
|
|
| <Class1> | 3 | 1 | 4 |
|
|
| <Class2> | 2 | 0 | 2 |
|
|
| **Total** | **5** | **1** | **6** |
|
|
```
|
|
|
|
### 4. Cross-reference with plan
|
|
|
|
Verify every implementation step has at least one test case. Flag gaps as warnings.
|
|
|
|
### 5. Store in BigMind
|
|
|
|
```python
|
|
memory_store_fact(
|
|
category="codebase",
|
|
fact=f"{TICKET_KEY}: Testplan with {N} test cases (Unit: {u}, Integration: {i})"
|
|
)
|
|
```
|
|
|
|
## Test Naming Conventions
|
|
|
|
- Test class: `<OriginalClass>Test.java` or `<Feature>Test.java`
|
|
- Test method: `test<What>_<Scenario>_<Expected>()` or `test<What>()` for simple cases
|
|
- Location: mirror source structure under `src/test/java/`
|
|
|
|
## Test ID Format
|
|
|
|
- Sequential: T-01, T-02, ..., T-nn
|
|
- IDs are stable — don't renumber on revision, append new tests at the end
|