Loading...
Loading...
Design test cases based on requirements. Use when users need test case design, testing strategy, or QA planning. Triggers on keywords like "test cases", "test design", "unit test", "integration test", "e2e test".
npx skill4agent add ab300819/skills devdocs-test-casesdocs/devdocs/01-requirements.mddocs/devdocs/02-system-design.mdFeature Point (F-XXX)
│
└── User Story (US-XXX)
│
└── Acceptance Criterion (AC-XXX)
│
├── Unit Test (UT-XXX) ← Verify internal logic
│
├── Integration Test (IT-XXX) ← Verify component collaboration
│
└── E2E Test (E2E-XXX) ← Verify user scenarios| Acceptance Criterion Type | Recommended Test Type | Example |
|---|---|---|
| Input validation rules | Unit Test | "Email format validation" → UT |
| Business logic rules | Unit Test + Integration Test | "Password encrypted storage" → UT + IT |
| User interaction flow | E2E Test | "Complete registration process" → E2E |
| Inter-component collaboration | Integration Test | "Send verification email" → IT |
| Test Type | Prefix | Format | Example |
|---|---|---|---|
| Unit Test | UT | UT-XXX | UT-001, UT-002 |
| Integration Test | IT | IT-XXX | IT-001, IT-002 |
| E2E Test | E2E | E2E-XXX | E2E-001, E2E-002 |
1. Read requirement document
│
▼
2. Extract feature points, user stories, and acceptance criteria
│
▼
3. Select test type for each acceptance criterion
│
▼
4. Design unit test cases (UT-XXX)
│
▼
5. Design integration test cases (IT-XXX)
│
▼
6. Design E2E test cases (E2E-XXX)
│
▼
7. Generate traceability matrix
│
▼
8. User confirmationdocs/devdocs/03-test-cases.mddocs/devdocs/
├── 03-test-cases.md # Main document: Test strategy, coverage requirements, traceability matrix
├── 03-test-unit.md # Unit test cases (UT-XXX)
├── 03-test-integration.md # Integration test cases (IT-XXX)
└── 03-test-e2e.md # E2E test cases (E2E-XXX)| File | Content Included |
|---|---|
| 03-test-cases.md | Test strategy, coverage requirements, traceability matrix, test case summary |
| 03-test-unit.md | Details of all unit test cases (UT-001 ~ UT-XXX) |
| 03-test-integration.md | Details of all integration test cases (IT-001 ~ IT-XXX) |
| 03-test-e2e.md | Details of all E2E test cases (E2E-001 ~ E2E-XXX) |
03-test-cases.md# Test Cases: <Feature Name>
## 1. Test Strategy
## 2. Coverage Requirements
## 3. Traceability Matrix
## 4. Test Case Summary| Feature Point | User Story | Acceptance Criterion | Unit Test | Integration Test | E2E Test | Status |
|---------------|------------|----------------------|-----------|------------------|----------|--------|
| F-001 | US-001 | AC-001 | UT-001 | - | E2E-001 | ⏳ |
| F-001 | US-001 | AC-002 | UT-002 | - | E2E-001 | ⏳ |
| F-001 | US-002 | AC-004 | UT-003, UT-004 | IT-001 | - | ⏳ |Code locations are automatically populated by, based on scanning/devdocs-sync --trace/@satisfiesannotations in the code.@verifies
| AC ID | Acceptance Criterion | Test ID | Entry Code | Test Code | Status |
|-------|----------------------|---------|------------|-----------|--------|
| AC-001 | Email format validation | UT-001 | `src/user.ts:15` | `tests/user.test.ts:20` | ✅ |
| AC-002 | Password strength validation | UT-002 | `src/user.ts:15` | `tests/user.test.ts:35` | ✅ |
| AC-003 | Username uniqueness | UT-003 | `src/user.ts:15` | `tests/user.test.ts:50` | ⏳ |
| AC-004 | Send verification email | IT-001 | - | - | ❌ || Field | Source | Description |
|---|---|---|
| Entry Code | | Location of the method implementing this AC |
| Test Code | | Location of the test verifying this AC |
| Status | Meaning | Condition |
|---|---|---|
| ✅ | Fully Covered | Has test case + entry code + test code + test passed |
| ⏳ | In Progress | Has test case, code/test partially completed |
| ⚠️ | Partially Covered | Has code but lacks test, or has test but lacks code |
| ❌ | Not Covered | No test case or no code implementation |
Design Phase Development Phase Sync Phase
│ │ │
▼ ▼ ▼
Generate Basic Matrix Generate skeleton code (with annotations) /devdocs-sync --trace
(AC → Test IDs) (Entry + Test) │
▼
Scan code annotations
│
▼
Populate code location column
│
▼
Update status column| ID | Acceptance Criterion | Test Object | Scenario | Input | Expected Output | Priority |
|----|----------------------|-------------|----------|-------|-----------------|----------|
| UT-001 | AC-001 | validateEmail() | Valid email | "test@example.com" | true | P0 |
| UT-002 | AC-002 | validateEmail() | Invalid format | "invalid" | false | P0 || ID | Acceptance Criterion | Test Scenario | Involved Components | Expected Result | Priority |
|----|----------------------|---------------|---------------------|-----------------|----------|
| IT-001 | AC-004 | Password encrypted storage | UserService + DB | Password stored in bcrypt format | P0 || ID | User Story | Acceptance Criterion | Operation Steps | Expected Result | Priority |
|----|------------|----------------------|-----------------|-----------------|----------|
| E2E-001 | US-001 | AC-001~AC-003 | 1. Open registration page<br>2. Enter email and password<br>3. Click register | Registration successful, verification email received | P0 || Test Type | Coverage Target | Coverage Requirement |
|---|---|---|
| Unit Test | Core business logic | Line coverage ≥ 80%, branch coverage ≥ 80% |
| Integration Test | Component collaboration scenarios | At least 1 IT per feature point |
| E2E Test | User stories | At least 1 E2E per P0 user story |
/testing-guide| Scenario | Collaborating Skill | Description |
|---|---|---|
| Requirement Input | | Pre-requisite: Provide F/US/AC as the basis for test design |
| New Feature Testing | | Called: New features require additional test cases |
| Bug Regression Testing | | Called: Bug fixes require supplementary regression tests |
| Test Improvement | | Called: Improvement suggestions may require test coverage |
| Traceability Update | | Collaboration: Trace mode updates code locations in the traceability matrix |
| Test Quality | | Collaboration: Quality constraints when writing test code |
| Task Splitting | | Follow-up: Convert test cases into development tasks |
/devdocs-dev-tasks