@dzhechkov/keysarium 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -3
- package/bin/cli.js +0 -0
- package/package.json +5 -3
- package/templates/.claude/commands/analyst-manual.md +38 -0
- package/templates/.claude/commands/casarium.md +55 -4
- package/templates/.claude/commands/feature-adr.md +8 -0
- package/templates/.claude/rules/trust-tiers.md +5 -0
- package/templates/.claude/shards/feature-adr.shard.md +64 -10
- package/templates/.claude/shards/phase-ai-factory.shard.md +109 -0
- package/templates/.claude/skills/ai-factory-mapper/README.md +90 -0
- package/templates/.claude/skills/ai-factory-mapper/SKILL.md +309 -0
- package/templates/.claude/skills/ai-factory-mapper/assets/report-template.md +123 -0
- package/templates/.claude/skills/ai-factory-mapper/references/catalog.md +230 -0
- package/templates/.claude/skills/ai-factory-mapper/references/coverage-formula.md +219 -0
- package/templates/.claude/skills/ai-factory-mapper/references/decomposition-checklist.md +183 -0
- package/templates/.claude/skills/ai-factory-mapper/references/pattern-library.md +312 -0
- package/templates/.claude/skills/ai-factory-mapper/scripts/build_docx_report.js +423 -0
- package/templates/.claude/skills/analyst-manual-full/SKILL.md +286 -0
- package/templates/.claude/skills/edu-site-generator/SKILL.md +254 -0
- package/templates/.claude/skills/edu-site-generator/examples/sample-course-structure.md +116 -0
- package/templates/.claude/skills/edu-site-generator/modules/00-content-analysis.md +84 -0
- package/templates/.claude/skills/edu-site-generator/modules/01-course-structure.md +75 -0
- package/templates/.claude/skills/edu-site-generator/modules/02-data-generation.md +186 -0
- package/templates/.claude/skills/edu-site-generator/modules/03-scaffold.md +249 -0
- package/templates/.claude/skills/edu-site-generator/modules/04-components.md +130 -0
- package/templates/.claude/skills/edu-site-generator/modules/05-gamification.md +163 -0
- package/templates/.claude/skills/edu-site-generator/modules/06-deploy.md +88 -0
- package/templates/.claude/skills/edu-site-generator/modules/07-verification.md +97 -0
- package/templates/.claude/skills/edu-site-generator/references/component-templates.md +436 -0
- package/templates/.claude/skills/edu-site-generator/references/data-schemas.md +164 -0
- package/templates/.claude/skills/edu-site-generator/references/exercise-catalog.md +110 -0
- package/templates/.claude/skills/edu-site-generator/references/tech-stack.md +69 -0
- package/templates/.claude/skills/feature-adr/SKILL.md +245 -59
- package/templates/.claude/skills/feature-adr/modules/03-adr.md +43 -0
- package/templates/.claude/skills/feature-adr/modules/03.5-ideation-swarm.md +180 -0
- package/templates/.claude/skills/feature-adr/modules/06-implementation-plan.md +56 -7
- package/templates/.claude/skills/feature-adr/modules/08-qe.md +87 -23
- package/templates/.claude/skills/feature-adr/modules/09-fleet-qe.md +305 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/README.md +143 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/brutal-honesty-review.md +240 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/chaos-engineering-resilience.md +163 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/code-goal-planner.md +446 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/enterprise-integration-testing.md +111 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/mutation-testing.md +236 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/performance-testing.md +315 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qcsd-ideation-swarm.md +126 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qcsd-production-swarm.md +108 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-coverage-analysis.md +193 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-requirements-validation.md +254 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/regression-testing.md +233 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/risk-based-testing.md +212 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/security-testing.md +311 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/shift-left-testing.md +231 -0
- package/templates/.claude/skills/feature-adr/references/agentic-qe/tdd-london-chicago.md +249 -0
- package/templates/.claude/skills/transcript-site-generator/SKILL.md +287 -0
- package/templates/.claude/skills/transcript-site-generator/examples/sample-text-only-site.md +123 -0
- package/templates/.claude/skills/transcript-site-generator/examples/sample-transcript-site.md +134 -0
- package/templates/.claude/skills/transcript-site-generator/modules/00-input-analysis.md +132 -0
- package/templates/.claude/skills/transcript-site-generator/modules/01-content-parsing.md +117 -0
- package/templates/.claude/skills/transcript-site-generator/modules/02-site-generation.md +293 -0
- package/templates/.claude/skills/transcript-site-generator/modules/03-interactivity.md +406 -0
- package/templates/.claude/skills/transcript-site-generator/modules/04-deploy.md +130 -0
- package/templates/.claude/skills/transcript-site-generator/modules/05-verification.md +155 -0
- package/templates/.claude/skills/transcript-site-generator/references/component-catalog.md +86 -0
- package/templates/.claude/skills/transcript-site-generator/references/data-schemas.md +123 -0
- package/templates/.claude/skills/transcript-site-generator/references/tech-stack.md +132 -0
- package/templates/CLAUDE.md +9 -2
- package/templates/docs/edu-site-generator/01-deployment-guide.md +911 -0
- package/templates/docs/edu-site-generator/02-admin-guide.md +901 -0
- package/templates/docs/edu-site-generator/03-user-guide.md +1008 -0
- package/templates/docs/edu-site-generator/04-infrastructure-requirements.md +489 -0
- package/templates/docs/edu-site-generator/05-architecture.md +902 -0
- package/templates/docs/edu-site-generator/06-user-flows.md +759 -0
- package/templates/docs/transcript-site-generator/01-deployment-guide.md +1042 -0
- package/templates/docs/transcript-site-generator/02-admin-guide.md +918 -0
- package/templates/docs/transcript-site-generator/03-user-guide.md +925 -0
- package/templates/docs/transcript-site-generator/04-infrastructure-requirements.md +482 -0
- package/templates/docs/transcript-site-generator/05-architecture.md +1068 -0
- package/templates/docs/transcript-site-generator/06-user-flows.md +855 -0
package/templates/.claude/skills/feature-adr/references/agentic-qe/enterprise-integration-testing.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Enterprise Integration Testing (Condensed for Feature ADR)
|
|
2
|
+
|
|
3
|
+
> Source: agentic-qe `enterprise-integration-testing` skill (Tier 3)
|
|
4
|
+
> Condensed from 735 lines — SAP-specific sections removed, universal patterns retained.
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
Verify that independently correct modules/systems work correctly together.
|
|
9
|
+
The biggest risks are in the seams between components, not within them.
|
|
10
|
+
|
|
11
|
+
## Integration Testing Protocol
|
|
12
|
+
|
|
13
|
+
### 1. Map E2E Flow
|
|
14
|
+
|
|
15
|
+
Before writing tests, map the complete flow:
|
|
16
|
+
```
|
|
17
|
+
User Action → API → Service A → Service B → Database → Response
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Identify every integration boundary (API calls, DB queries, message queues, file I/O).
|
|
21
|
+
|
|
22
|
+
### 2. Test Each Boundary
|
|
23
|
+
|
|
24
|
+
For each integration point:
|
|
25
|
+
|
|
26
|
+
| Boundary Type | What to Test |
|
|
27
|
+
|---|---|
|
|
28
|
+
| API (REST/GraphQL) | Contract compliance, schema validation, error codes |
|
|
29
|
+
| Database | Query correctness, transaction isolation, migration compatibility |
|
|
30
|
+
| Message Queue | Message format, ordering, DLQ handling, retry logic |
|
|
31
|
+
| File I/O | Format validation, encoding, path handling |
|
|
32
|
+
| External Service | Mock fidelity, timeout handling, circuit breaker |
|
|
33
|
+
|
|
34
|
+
### 3. Cross-Module Data Consistency
|
|
35
|
+
|
|
36
|
+
After each integration event, verify:
|
|
37
|
+
- Data written by module A is correctly read by module B
|
|
38
|
+
- No data loss or transformation errors at boundaries
|
|
39
|
+
- Eventual consistency windows are respected (async flows)
|
|
40
|
+
|
|
41
|
+
### 4. Contract Testing
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Consumer defines expected contract
|
|
45
|
+
→ Provider validates against contract
|
|
46
|
+
→ Break = blocked merge
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Key checks:
|
|
50
|
+
- Request/response schemas match between caller and callee
|
|
51
|
+
- Error response formats are consistent
|
|
52
|
+
- API versioning is respected
|
|
53
|
+
- No breaking changes in shared interfaces
|
|
54
|
+
|
|
55
|
+
### 5. Error Recovery
|
|
56
|
+
|
|
57
|
+
Test failure scenarios at every boundary:
|
|
58
|
+
- What happens when Service B is down?
|
|
59
|
+
- Are partial operations compensated/rolled back?
|
|
60
|
+
- Do correlation IDs propagate through the chain?
|
|
61
|
+
- Are DLQ messages reprocessable?
|
|
62
|
+
|
|
63
|
+
## Integration Quality Gates
|
|
64
|
+
|
|
65
|
+
| Gate | Threshold | Action |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| Cross-module data consistency | 100% for critical paths | BLOCK on failure |
|
|
68
|
+
| API contract compliance | 100% | BLOCK on failure |
|
|
69
|
+
| Error recovery | All compensation paths tested | WARN if partial |
|
|
70
|
+
| Performance | E2E flow < defined SLA | WARN if exceeded |
|
|
71
|
+
|
|
72
|
+
## Hierarchical Testing Strategy
|
|
73
|
+
|
|
74
|
+
Execute integration tests in phases:
|
|
75
|
+
1. **Contract validation** — verify interfaces match
|
|
76
|
+
2. **Integration testing** — verify boundary behavior
|
|
77
|
+
3. **E2E validation** — verify complete flows
|
|
78
|
+
4. **Authorization check** — verify access control across modules
|
|
79
|
+
|
|
80
|
+
## QCSD Flags for Integration
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
HAS_CROSS_MODULE_DATA: true → Data replicated/shared across modules
|
|
84
|
+
HAS_ASYNC_PROCESSING: true → Message queues, event-driven flows
|
|
85
|
+
HAS_EXTERNAL_SERVICES: true → Third-party API integrations
|
|
86
|
+
HAS_DATABASE_SHARING: true → Multiple modules access same DB
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Best Practices
|
|
90
|
+
|
|
91
|
+
### Do
|
|
92
|
+
- Map the full E2E flow before writing any tests
|
|
93
|
+
- Test each integration boundary separately AND end-to-end
|
|
94
|
+
- Validate data consistency across all modules after each event
|
|
95
|
+
- Use service virtualization for hard-to-provision dependencies
|
|
96
|
+
- Include correlation ID tracing in test assertions
|
|
97
|
+
|
|
98
|
+
### Avoid
|
|
99
|
+
- Testing only through the UI without API-level tests
|
|
100
|
+
- Ignoring async processing errors (DLQ, failed events)
|
|
101
|
+
- Assuming cross-module data is immediately consistent
|
|
102
|
+
- Testing integrations only in isolation (mock everything)
|
|
103
|
+
- Deploying without verifying no breaking API changes
|
|
104
|
+
|
|
105
|
+
## Agent Coordination
|
|
106
|
+
|
|
107
|
+
When used as Fleet QE Agent 3 (Integration Integrity Checker):
|
|
108
|
+
- Focus scope: cross-module interactions within the feature
|
|
109
|
+
- Input: `{CODE_CHANGES}` file list, `{ARCHITECTURE}` component diagram
|
|
110
|
+
- Output: integration issues found, contract violations, data consistency risks
|
|
111
|
+
- Verdict per issue: BLOCKER / WARNING / INFO
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mutation-testing
|
|
3
|
+
description: "Test quality validation through mutation testing, assessing test suite effectiveness by introducing code mutations and measuring kill rate. Use when evaluating test quality, identifying weak tests, or proving tests actually catch bugs."
|
|
4
|
+
category: specialized-testing
|
|
5
|
+
priority: high
|
|
6
|
+
tokenEstimate: 900
|
|
7
|
+
agents: [qe-test-generator, qe-coverage-analyzer, qe-quality-analyzer, qe-mutation-tester]
|
|
8
|
+
implementation_status: optimized
|
|
9
|
+
optimization_version: 1.0
|
|
10
|
+
last_optimized: 2025-12-02
|
|
11
|
+
dependencies: []
|
|
12
|
+
quick_reference_card: true
|
|
13
|
+
tags: [mutation, stryker, test-quality, kill-rate, assertions, effectiveness]
|
|
14
|
+
|
|
15
|
+
# ADR-056 Trust Tier 3 Validation
|
|
16
|
+
trust_tier: 3
|
|
17
|
+
validation:
|
|
18
|
+
schema_path: schemas/output.json
|
|
19
|
+
validator_path: scripts/validate-config.json
|
|
20
|
+
eval_path: evals/mutation-testing.yaml
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Mutation Testing
|
|
24
|
+
|
|
25
|
+
<default_to_action>
|
|
26
|
+
When validating test quality or improving test effectiveness:
|
|
27
|
+
1. MUTATE code (change + to -, >= to >, remove statements)
|
|
28
|
+
2. RUN tests against each mutant
|
|
29
|
+
3. VERIFY tests catch mutations (kill mutants)
|
|
30
|
+
4. IDENTIFY surviving mutants (tests need improvement)
|
|
31
|
+
5. STRENGTHEN tests to kill surviving mutants
|
|
32
|
+
|
|
33
|
+
**Quick Mutation Metrics:**
|
|
34
|
+
- Mutation Score = Killed / (Killed + Survived)
|
|
35
|
+
- Target: > 80% mutation score
|
|
36
|
+
- Surviving mutants = weak tests
|
|
37
|
+
|
|
38
|
+
**Critical Success Factors:**
|
|
39
|
+
- High coverage ≠ good tests (100% coverage, 0% assertions)
|
|
40
|
+
- Mutation testing proves tests actually catch bugs
|
|
41
|
+
- Focus on critical code paths first
|
|
42
|
+
</default_to_action>
|
|
43
|
+
|
|
44
|
+
## Quick Reference Card
|
|
45
|
+
|
|
46
|
+
### When to Use
|
|
47
|
+
- Evaluating test suite quality
|
|
48
|
+
- Finding gaps in test assertions
|
|
49
|
+
- Proving tests catch bugs
|
|
50
|
+
- Before critical releases
|
|
51
|
+
|
|
52
|
+
### Mutation Score Interpretation
|
|
53
|
+
| Score | Interpretation |
|
|
54
|
+
|-------|----------------|
|
|
55
|
+
| **90%+** | Excellent test quality |
|
|
56
|
+
| **80-90%** | Good, minor improvements |
|
|
57
|
+
| **60-80%** | Needs attention |
|
|
58
|
+
| **< 60%** | Significant gaps |
|
|
59
|
+
|
|
60
|
+
### Common Mutation Operators
|
|
61
|
+
| Category | Original | Mutant |
|
|
62
|
+
|----------|----------|--------|
|
|
63
|
+
| **Arithmetic** | `a + b` | `a - b` |
|
|
64
|
+
| **Relational** | `x >= 18` | `x > 18` |
|
|
65
|
+
| **Logical** | `a && b` | `a \|\| b` |
|
|
66
|
+
| **Conditional** | `if (x)` | `if (true)` |
|
|
67
|
+
| **Statement** | `return x` | *(removed)* |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## How Mutation Testing Works
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
// Original code
|
|
75
|
+
function isAdult(age) {
|
|
76
|
+
return age >= 18; // ← Mutant: change >= to >
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Strong test (catches mutation)
|
|
80
|
+
test('18 is adult', () => {
|
|
81
|
+
expect(isAdult(18)).toBe(true); // Kills mutant!
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// Weak test (mutation survives)
|
|
85
|
+
test('19 is adult', () => {
|
|
86
|
+
expect(isAdult(19)).toBe(true); // Doesn't catch >= vs >
|
|
87
|
+
});
|
|
88
|
+
// Surviving mutant → Test needs boundary value
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Using Stryker
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Install
|
|
97
|
+
npm install --save-dev @stryker-mutator/core @stryker-mutator/jest-runner
|
|
98
|
+
|
|
99
|
+
# Initialize
|
|
100
|
+
npx stryker init
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Configuration:**
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"packageManager": "npm",
|
|
107
|
+
"reporters": ["html", "clear-text", "progress"],
|
|
108
|
+
"testRunner": "jest",
|
|
109
|
+
"coverageAnalysis": "perTest",
|
|
110
|
+
"mutate": [
|
|
111
|
+
"src/**/*.ts",
|
|
112
|
+
"!src/**/*.spec.ts"
|
|
113
|
+
],
|
|
114
|
+
"thresholds": {
|
|
115
|
+
"high": 90,
|
|
116
|
+
"low": 70,
|
|
117
|
+
"break": 60
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Run:**
|
|
123
|
+
```bash
|
|
124
|
+
npx stryker run
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Output:**
|
|
128
|
+
```
|
|
129
|
+
Mutation Score: 87.3%
|
|
130
|
+
Killed: 124
|
|
131
|
+
Survived: 18
|
|
132
|
+
No Coverage: 3
|
|
133
|
+
Timeout: 1
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Fixing Surviving Mutants
|
|
139
|
+
|
|
140
|
+
```javascript
|
|
141
|
+
// Surviving mutant: >= changed to >
|
|
142
|
+
function calculateDiscount(quantity) {
|
|
143
|
+
if (quantity >= 10) { // Mutant survives!
|
|
144
|
+
return 0.1;
|
|
145
|
+
}
|
|
146
|
+
return 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Original weak test
|
|
150
|
+
test('large order gets discount', () => {
|
|
151
|
+
expect(calculateDiscount(15)).toBe(0.1); // Doesn't test boundary
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// Fixed: Add boundary test
|
|
155
|
+
test('exactly 10 gets discount', () => {
|
|
156
|
+
expect(calculateDiscount(10)).toBe(0.1); // Kills mutant!
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test('9 does not get discount', () => {
|
|
160
|
+
expect(calculateDiscount(9)).toBe(0); // Tests below boundary
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Agent-Driven Mutation Testing
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
// Analyze mutation score and generate fixes
|
|
170
|
+
await Task("Mutation Analysis", {
|
|
171
|
+
targetFile: 'src/payment.ts',
|
|
172
|
+
generateMissingTests: true,
|
|
173
|
+
minScore: 80
|
|
174
|
+
}, "qe-test-generator");
|
|
175
|
+
|
|
176
|
+
// Returns:
|
|
177
|
+
// {
|
|
178
|
+
// mutationScore: 0.65,
|
|
179
|
+
// survivedMutations: [
|
|
180
|
+
// { line: 45, operator: '>=', mutant: '>', killedBy: null }
|
|
181
|
+
// ],
|
|
182
|
+
// generatedTests: [
|
|
183
|
+
// 'test for boundary at line 45'
|
|
184
|
+
// ]
|
|
185
|
+
// }
|
|
186
|
+
|
|
187
|
+
// Coverage + mutation correlation
|
|
188
|
+
await Task("Coverage Quality Analysis", {
|
|
189
|
+
coverageData: coverageReport,
|
|
190
|
+
mutationData: mutationReport,
|
|
191
|
+
identifyWeakCoverage: true
|
|
192
|
+
}, "qe-coverage-analyzer");
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Agent Coordination Hints
|
|
198
|
+
|
|
199
|
+
### Memory Namespace
|
|
200
|
+
```
|
|
201
|
+
aqe/mutation-testing/
|
|
202
|
+
├── mutation-results/* - Stryker reports
|
|
203
|
+
├── surviving/* - Surviving mutants
|
|
204
|
+
├── generated-tests/* - Tests to kill mutants
|
|
205
|
+
└── trends/* - Mutation score over time
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Fleet Coordination
|
|
209
|
+
```typescript
|
|
210
|
+
const mutationFleet = await FleetManager.coordinate({
|
|
211
|
+
strategy: 'mutation-testing',
|
|
212
|
+
agents: [
|
|
213
|
+
'qe-test-generator', // Generate tests for survivors
|
|
214
|
+
'qe-coverage-analyzer', // Coverage correlation
|
|
215
|
+
'qe-quality-analyzer' // Quality assessment
|
|
216
|
+
],
|
|
217
|
+
topology: 'sequential'
|
|
218
|
+
});
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Related Skills
|
|
224
|
+
- [tdd-london-chicago](../tdd-london-chicago/) - Write effective tests first
|
|
225
|
+
- [test-design-techniques](../test-design-techniques/) - Boundary value analysis
|
|
226
|
+
- [quality-metrics](../quality-metrics/) - Measure test effectiveness
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Remember
|
|
231
|
+
|
|
232
|
+
**High code coverage ≠ good tests.** 100% coverage but weak assertions = useless. Mutation testing proves tests actually catch bugs.
|
|
233
|
+
|
|
234
|
+
**Focus on critical paths first.** Don't mutation test everything - prioritize payment, authentication, data integrity code.
|
|
235
|
+
|
|
236
|
+
**With Agents:** Agents run mutation analysis, identify surviving mutants, and generate missing test cases to kill them. Automated improvement of test quality.
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-testing
|
|
3
|
+
description: "Test application performance, scalability, and resilience. Use when planning load testing, stress testing, or optimizing system performance."
|
|
4
|
+
category: specialized-testing
|
|
5
|
+
priority: high
|
|
6
|
+
tokenEstimate: 1100
|
|
7
|
+
agents: [qe-performance-tester, qe-quality-analyzer, qe-production-intelligence]
|
|
8
|
+
implementation_status: optimized
|
|
9
|
+
optimization_version: 1.0
|
|
10
|
+
last_optimized: 2025-12-02
|
|
11
|
+
dependencies: []
|
|
12
|
+
quick_reference_card: true
|
|
13
|
+
tags: [performance, load-testing, stress-testing, scalability, k6, bottlenecks]
|
|
14
|
+
trust_tier: 3
|
|
15
|
+
validation:
|
|
16
|
+
schema_path: schemas/output.json
|
|
17
|
+
validator_path: scripts/validate-config.json
|
|
18
|
+
eval_path: evals/performance-testing.yaml
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Performance Testing
|
|
22
|
+
|
|
23
|
+
<default_to_action>
|
|
24
|
+
When testing performance or planning load tests:
|
|
25
|
+
1. DEFINE SLOs: p95 response time, throughput, error rate targets
|
|
26
|
+
2. IDENTIFY critical paths: revenue flows, high-traffic pages, key APIs
|
|
27
|
+
3. CREATE realistic scenarios: user journeys, think time, varied data
|
|
28
|
+
4. EXECUTE with monitoring: CPU, memory, DB queries, network
|
|
29
|
+
5. ANALYZE bottlenecks and fix before production
|
|
30
|
+
|
|
31
|
+
**Quick Test Type Selection:**
|
|
32
|
+
- Expected load validation → Load testing
|
|
33
|
+
- Find breaking point → Stress testing
|
|
34
|
+
- Sudden traffic spike → Spike testing
|
|
35
|
+
- Memory leaks, resource exhaustion → Endurance/soak testing
|
|
36
|
+
- Horizontal/vertical scaling → Scalability testing
|
|
37
|
+
|
|
38
|
+
**Critical Success Factors:**
|
|
39
|
+
- Performance is a feature, not an afterthought
|
|
40
|
+
- Test early and often, not just before release
|
|
41
|
+
- Focus on user-impacting bottlenecks
|
|
42
|
+
</default_to_action>
|
|
43
|
+
|
|
44
|
+
## Quick Reference Card
|
|
45
|
+
|
|
46
|
+
### When to Use
|
|
47
|
+
- Before major releases
|
|
48
|
+
- After infrastructure changes
|
|
49
|
+
- Before scaling events (Black Friday)
|
|
50
|
+
- When setting SLAs/SLOs
|
|
51
|
+
|
|
52
|
+
### Test Types
|
|
53
|
+
| Type | Purpose | When |
|
|
54
|
+
|------|---------|------|
|
|
55
|
+
| **Load** | Expected traffic | Every release |
|
|
56
|
+
| **Stress** | Beyond capacity | Quarterly |
|
|
57
|
+
| **Spike** | Sudden surge | Before events |
|
|
58
|
+
| **Endurance** | Memory leaks | After code changes |
|
|
59
|
+
| **Scalability** | Scaling validation | Infrastructure changes |
|
|
60
|
+
|
|
61
|
+
### Key Metrics
|
|
62
|
+
| Metric | Target | Why |
|
|
63
|
+
|--------|--------|-----|
|
|
64
|
+
| p95 response | < 200ms | User experience |
|
|
65
|
+
| Throughput | 10k req/min | Capacity |
|
|
66
|
+
| Error rate | < 0.1% | Reliability |
|
|
67
|
+
| CPU | < 70% | Headroom |
|
|
68
|
+
| Memory | < 80% | Stability |
|
|
69
|
+
|
|
70
|
+
### Tools
|
|
71
|
+
- **k6**: Modern, JS-based, CI/CD friendly
|
|
72
|
+
- **JMeter**: Enterprise, feature-rich
|
|
73
|
+
- **Artillery**: Simple YAML configs
|
|
74
|
+
- **Gatling**: Scala, great reporting
|
|
75
|
+
|
|
76
|
+
### Agent Coordination
|
|
77
|
+
- `qe-performance-tester`: Load test orchestration
|
|
78
|
+
- `qe-quality-analyzer`: Results analysis
|
|
79
|
+
- `qe-production-intelligence`: Production comparison
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Defining SLOs
|
|
84
|
+
|
|
85
|
+
**Bad:** "The system should be fast"
|
|
86
|
+
**Good:** "p95 response time < 200ms under 1,000 concurrent users"
|
|
87
|
+
|
|
88
|
+
```javascript
|
|
89
|
+
export const options = {
|
|
90
|
+
thresholds: {
|
|
91
|
+
http_req_duration: ['p(95)<200'], // 95% < 200ms
|
|
92
|
+
http_req_failed: ['rate<0.01'], // < 1% failures
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Realistic Scenarios
|
|
100
|
+
|
|
101
|
+
**Bad:** Every user hits homepage repeatedly
|
|
102
|
+
**Good:** Model actual user behavior
|
|
103
|
+
|
|
104
|
+
```javascript
|
|
105
|
+
// Realistic distribution
|
|
106
|
+
// 40% browse, 30% search, 20% details, 10% checkout
|
|
107
|
+
export default function () {
|
|
108
|
+
const action = Math.random();
|
|
109
|
+
if (action < 0.4) browse();
|
|
110
|
+
else if (action < 0.7) search();
|
|
111
|
+
else if (action < 0.9) viewProduct();
|
|
112
|
+
else checkout();
|
|
113
|
+
|
|
114
|
+
sleep(randomInt(1, 5)); // Think time
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Common Bottlenecks
|
|
121
|
+
|
|
122
|
+
### Database
|
|
123
|
+
**Symptoms:** Slow queries under load, connection pool exhaustion
|
|
124
|
+
**Fixes:** Add indexes, optimize N+1 queries, increase pool size, read replicas
|
|
125
|
+
|
|
126
|
+
### N+1 Queries
|
|
127
|
+
```javascript
|
|
128
|
+
// BAD: 100 orders = 101 queries
|
|
129
|
+
const orders = await Order.findAll();
|
|
130
|
+
for (const order of orders) {
|
|
131
|
+
const customer = await Customer.findById(order.customerId);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// GOOD: 1 query
|
|
135
|
+
const orders = await Order.findAll({ include: [Customer] });
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Synchronous Processing
|
|
139
|
+
**Problem:** Blocking operations in request path (sending email during checkout)
|
|
140
|
+
**Fix:** Use message queues, process async, return immediately
|
|
141
|
+
|
|
142
|
+
### Memory Leaks
|
|
143
|
+
**Detection:** Endurance testing, memory profiling
|
|
144
|
+
**Common causes:** Event listeners not cleaned, caches without eviction
|
|
145
|
+
|
|
146
|
+
### External Dependencies
|
|
147
|
+
**Solutions:** Aggressive timeouts, circuit breakers, caching, graceful degradation
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## k6 CI/CD Example
|
|
152
|
+
|
|
153
|
+
```javascript
|
|
154
|
+
// performance-test.js
|
|
155
|
+
import http from 'k6/http';
|
|
156
|
+
import { check, sleep } from 'k6';
|
|
157
|
+
|
|
158
|
+
export const options = {
|
|
159
|
+
stages: [
|
|
160
|
+
{ duration: '1m', target: 50 }, // Ramp up
|
|
161
|
+
{ duration: '3m', target: 50 }, // Steady
|
|
162
|
+
{ duration: '1m', target: 0 }, // Ramp down
|
|
163
|
+
],
|
|
164
|
+
thresholds: {
|
|
165
|
+
http_req_duration: ['p(95)<200'],
|
|
166
|
+
http_req_failed: ['rate<0.01'],
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export default function () {
|
|
171
|
+
const res = http.get('https://api.example.com/products');
|
|
172
|
+
check(res, {
|
|
173
|
+
'status is 200': (r) => r.status === 200,
|
|
174
|
+
'response time < 200ms': (r) => r.timings.duration < 200,
|
|
175
|
+
});
|
|
176
|
+
sleep(1);
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```yaml
|
|
181
|
+
# GitHub Actions
|
|
182
|
+
- name: Run k6 test
|
|
183
|
+
uses: grafana/k6-action@v0.3.0
|
|
184
|
+
with:
|
|
185
|
+
filename: performance-test.js
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Analyzing Results
|
|
191
|
+
|
|
192
|
+
### Good Results
|
|
193
|
+
```
|
|
194
|
+
Load: 1,000 users | p95: 180ms | Throughput: 5,000 req/s
|
|
195
|
+
Error rate: 0.05% | CPU: 65% | Memory: 70%
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Problems
|
|
199
|
+
```
|
|
200
|
+
Load: 1,000 users | p95: 3,500ms ❌ | Throughput: 500 req/s ❌
|
|
201
|
+
Error rate: 5% ❌ | CPU: 95% ❌ | Memory: 90% ❌
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Root Cause Analysis
|
|
205
|
+
1. Correlate metrics: When response time spikes, what changes?
|
|
206
|
+
2. Check logs: Errors, warnings, slow queries
|
|
207
|
+
3. Profile code: Where is time spent?
|
|
208
|
+
4. Monitor resources: CPU, memory, disk
|
|
209
|
+
5. Trace requests: End-to-end flow
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Anti-Patterns
|
|
214
|
+
|
|
215
|
+
| ❌ Anti-Pattern | ✅ Better |
|
|
216
|
+
|----------------|-----------|
|
|
217
|
+
| Testing too late | Test early and often |
|
|
218
|
+
| Unrealistic scenarios | Model real user behavior |
|
|
219
|
+
| 0 to 1000 users instantly | Ramp up gradually |
|
|
220
|
+
| No monitoring during tests | Monitor everything |
|
|
221
|
+
| No baseline | Establish and track trends |
|
|
222
|
+
| One-time testing | Continuous performance testing |
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Agent-Assisted Performance Testing
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
// Comprehensive load test
|
|
230
|
+
await Task("Load Test", {
|
|
231
|
+
target: 'https://api.example.com',
|
|
232
|
+
scenarios: {
|
|
233
|
+
checkout: { vus: 100, duration: '5m' },
|
|
234
|
+
search: { vus: 200, duration: '5m' },
|
|
235
|
+
browse: { vus: 500, duration: '5m' }
|
|
236
|
+
},
|
|
237
|
+
thresholds: {
|
|
238
|
+
'http_req_duration': ['p(95)<200'],
|
|
239
|
+
'http_req_failed': ['rate<0.01']
|
|
240
|
+
}
|
|
241
|
+
}, "qe-performance-tester");
|
|
242
|
+
|
|
243
|
+
// Bottleneck analysis
|
|
244
|
+
await Task("Analyze Bottlenecks", {
|
|
245
|
+
testResults: perfTest,
|
|
246
|
+
metrics: ['cpu', 'memory', 'db_queries', 'network']
|
|
247
|
+
}, "qe-performance-tester");
|
|
248
|
+
|
|
249
|
+
// CI integration
|
|
250
|
+
await Task("CI Performance Gate", {
|
|
251
|
+
mode: 'smoke',
|
|
252
|
+
duration: '1m',
|
|
253
|
+
vus: 10,
|
|
254
|
+
failOn: { 'p95_response_time': 300, 'error_rate': 0.01 }
|
|
255
|
+
}, "qe-performance-tester");
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Agent Coordination Hints
|
|
261
|
+
|
|
262
|
+
### Memory Namespace
|
|
263
|
+
```
|
|
264
|
+
aqe/performance/
|
|
265
|
+
├── results/* - Test execution results
|
|
266
|
+
├── baselines/* - Performance baselines
|
|
267
|
+
├── bottlenecks/* - Identified bottlenecks
|
|
268
|
+
└── trends/* - Historical trends
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Fleet Coordination
|
|
272
|
+
```typescript
|
|
273
|
+
const perfFleet = await FleetManager.coordinate({
|
|
274
|
+
strategy: 'performance-testing',
|
|
275
|
+
agents: [
|
|
276
|
+
'qe-performance-tester',
|
|
277
|
+
'qe-quality-analyzer',
|
|
278
|
+
'qe-production-intelligence',
|
|
279
|
+
'qe-deployment-readiness'
|
|
280
|
+
],
|
|
281
|
+
topology: 'sequential'
|
|
282
|
+
});
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Pre-Production Checklist
|
|
288
|
+
|
|
289
|
+
- [ ] Load test passed (expected traffic)
|
|
290
|
+
- [ ] Stress test passed (2-3x expected)
|
|
291
|
+
- [ ] Spike test passed (sudden surge)
|
|
292
|
+
- [ ] Endurance test passed (24+ hours)
|
|
293
|
+
- [ ] Database indexes in place
|
|
294
|
+
- [ ] Caching configured
|
|
295
|
+
- [ ] Monitoring and alerting set up
|
|
296
|
+
- [ ] Performance baseline established
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Related Skills
|
|
301
|
+
- [agentic-quality-engineering](../agentic-quality-engineering/) - Agent coordination
|
|
302
|
+
- [api-testing-patterns](../api-testing-patterns/) - API performance
|
|
303
|
+
- [chaos-engineering-resilience](../chaos-engineering-resilience/) - Resilience testing
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Remember
|
|
308
|
+
|
|
309
|
+
**Performance is a feature:** Test it like functionality
|
|
310
|
+
**Test continuously:** Not just before launch
|
|
311
|
+
**Monitor production:** Synthetic + real user monitoring
|
|
312
|
+
**Fix what matters:** Focus on user-impacting bottlenecks
|
|
313
|
+
**Trend over time:** Catch degradation early
|
|
314
|
+
|
|
315
|
+
**With Agents:** Agents automate load testing, analyze bottlenecks, and compare with production. Use agents to maintain performance at scale.
|