183 lines
4.9 KiB
Markdown
Executable File
183 lines
4.9 KiB
Markdown
Executable File
# Test Management Strategy
|
|
|
|
## 📋 Requirements & Test Case Management with Linear
|
|
|
|
### Structure
|
|
|
|
#### 1. **Requirements (REQ-XXX)**
|
|
- **Label**: `requirement`
|
|
- **Project**: Megfelelő feature project
|
|
- **Description**: Detailed requirement specification
|
|
- **Acceptance Criteria**: Clear, testable criteria
|
|
|
|
#### 2. **Test Cases (TC-XXX)**
|
|
- **Label**: `test-case`
|
|
- **Links to**: Parent requirement issue
|
|
- **Description**: Test steps, expected results
|
|
- **Status**: Draft → Ready → Executed → Passed/Failed
|
|
|
|
#### 3. **Bug Reports (BUG-XXX)**
|
|
- **Label**: `bug`
|
|
- **Links to**: Related test case and requirement
|
|
- **Priority**: Based on requirement criticality
|
|
|
|
### Linear Labels for Test Management
|
|
|
|
```bash
|
|
# Create test management labels
|
|
requirement # REQ-XXX issues
|
|
test-case # TC-XXX issues
|
|
bug # BUG-XXX issues
|
|
test-suite # Automated test groupings
|
|
manual-test # Manual test cases
|
|
automated-test # Automated test cases
|
|
regression # Regression test cases
|
|
smoke-test # Smoke test cases
|
|
integration # Integration test cases
|
|
e2e-test # End-to-end test cases
|
|
```
|
|
|
|
### Workflow
|
|
|
|
#### Phase 1: Requirements Definition
|
|
1. Create `REQ-XXX` issues with `requirement` label
|
|
2. Define acceptance criteria
|
|
3. Link to epic/project
|
|
4. Assign priority and estimate
|
|
|
|
#### Phase 2: Test Case Creation
|
|
1. For each requirement, create `TC-XXX` issues
|
|
2. Link test cases to parent requirements
|
|
3. Specify test type (unit/integration/e2e)
|
|
4. Define test steps and expected results
|
|
|
|
#### Phase 3: Implementation & Execution
|
|
1. Implement automated tests referencing `TC-XXX`
|
|
2. Update test case status based on execution
|
|
3. Create `BUG-XXX` for failures
|
|
4. Link bugs to failing test cases
|
|
|
|
### Traceability Matrix
|
|
|
|
| Requirement | Test Cases | Automated Tests | Status |
|
|
|-------------|------------|-----------------|--------|
|
|
| REQ-001: User Auth | TC-001, TC-002 | `auth.test.ts` | ✅ |
|
|
| REQ-002: Contact Form | TC-003, TC-004, TC-005 | `contact.test.ts` | ✅ |
|
|
| REQ-003: Performance | TC-006 | `performance.test.ts` | 🟡 |
|
|
|
|
### MCP Integration Commands
|
|
|
|
```bash
|
|
# Create requirement
|
|
linear create-issue "REQ: User registration validation" \
|
|
--label requirement \
|
|
--description "Users must provide valid email and password"
|
|
|
|
# Create linked test case
|
|
linear create-issue "TC: Email format validation" \
|
|
--label test-case \
|
|
--description "Verify email format is validated on registration" \
|
|
--link-to REQ-XXX
|
|
|
|
# Query requirements without test coverage
|
|
linear list-issues --label requirement --filter "no linked test-case"
|
|
|
|
# Generate test coverage report
|
|
linear list-issues --label test-case --group-by requirement
|
|
```
|
|
|
|
### Integration with Automated Tests
|
|
|
|
#### Test File Headers
|
|
```typescript
|
|
/**
|
|
* @testcase TC-001
|
|
* @requirement REQ-001
|
|
* @description User authentication validation
|
|
* @type integration
|
|
*/
|
|
describe('User Authentication (TC-001)', () => {
|
|
// tests...
|
|
})
|
|
```
|
|
|
|
#### Test Reporting
|
|
```bash
|
|
# Generate traceability report
|
|
npm run test:coverage:requirements
|
|
|
|
# Update Linear test case status
|
|
npm run test:sync-linear
|
|
```
|
|
|
|
### Custom MCP Commands for Test Management
|
|
|
|
```javascript
|
|
// ~/.cursor/mcp-extensions/test-management.js
|
|
export const commands = {
|
|
'create-test-case': async (requirement, description) => {
|
|
// Create TC-XXX linked to REQ-XXX
|
|
},
|
|
|
|
'generate-traceability-matrix': async () => {
|
|
// Generate requirements → test cases mapping
|
|
},
|
|
|
|
'sync-test-results': async () => {
|
|
// Update Linear issues based on test execution
|
|
}
|
|
}
|
|
```
|
|
|
|
## 📊 Reporting & Metrics
|
|
|
|
### Key Metrics to Track
|
|
- **Requirements Coverage**: % of REQ-XXX with linked TC-XXX
|
|
- **Test Execution Rate**: % of TC-XXX executed
|
|
- **Pass Rate**: % of executed tests passing
|
|
- **Defect Density**: Bugs per requirement
|
|
- **Automation Rate**: % of TC-XXX automated
|
|
|
|
### Dashboard Queries
|
|
```bash
|
|
# Coverage report
|
|
linear list-issues --label requirement --include-links
|
|
|
|
# Test execution status
|
|
linear list-issues --label test-case --filter "status:executed"
|
|
|
|
# Bug trend analysis
|
|
linear list-issues --label bug --created-after "2025-01-01"
|
|
```
|
|
|
|
## 🔄 Continuous Integration
|
|
|
|
### GitHub Actions Integration
|
|
```yaml
|
|
name: Test Management Sync
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
sync-test-results:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Run Tests & Update Linear
|
|
run: |
|
|
npm test -- --json > test-results.json
|
|
node scripts/sync-linear-test-status.js
|
|
```
|
|
|
|
### Benefits of This Approach
|
|
|
|
1. **Single Source of Truth**: All in Linear
|
|
2. **Existing Workflow**: Leverages current Linear usage
|
|
3. **MCP Ready**: Native connector available
|
|
4. **Automation Friendly**: API integration possible
|
|
5. **Scalable**: Grows with project complexity
|
|
6. **Cost Effective**: Using existing tooling
|
|
|
|
This approach transforms Linear from simple issue tracking into a comprehensive test management system while maintaining the familiar workflow.
|