agentic-qe 2.0.0 → 2.1.1
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/.claude/agents/qx-partner.md +17 -4
- package/.claude/skills/accessibility-testing/SKILL.md +144 -692
- package/.claude/skills/agentic-quality-engineering/SKILL.md +176 -529
- package/.claude/skills/api-testing-patterns/SKILL.md +180 -560
- package/.claude/skills/brutal-honesty-review/SKILL.md +113 -603
- package/.claude/skills/bug-reporting-excellence/SKILL.md +116 -517
- package/.claude/skills/chaos-engineering-resilience/SKILL.md +127 -72
- package/.claude/skills/cicd-pipeline-qe-orchestrator/SKILL.md +209 -404
- package/.claude/skills/code-review-quality/SKILL.md +158 -608
- package/.claude/skills/compatibility-testing/SKILL.md +148 -38
- package/.claude/skills/compliance-testing/SKILL.md +132 -63
- package/.claude/skills/consultancy-practices/SKILL.md +114 -446
- package/.claude/skills/context-driven-testing/SKILL.md +117 -381
- package/.claude/skills/contract-testing/SKILL.md +176 -141
- package/.claude/skills/database-testing/SKILL.md +137 -130
- package/.claude/skills/exploratory-testing-advanced/SKILL.md +160 -629
- package/.claude/skills/holistic-testing-pact/SKILL.md +140 -188
- package/.claude/skills/localization-testing/SKILL.md +145 -33
- package/.claude/skills/mobile-testing/SKILL.md +132 -448
- package/.claude/skills/mutation-testing/SKILL.md +147 -41
- package/.claude/skills/performance-testing/SKILL.md +200 -546
- package/.claude/skills/quality-metrics/SKILL.md +164 -519
- package/.claude/skills/refactoring-patterns/SKILL.md +132 -699
- package/.claude/skills/regression-testing/SKILL.md +120 -926
- package/.claude/skills/risk-based-testing/SKILL.md +157 -660
- package/.claude/skills/security-testing/SKILL.md +199 -538
- package/.claude/skills/sherlock-review/SKILL.md +163 -699
- package/.claude/skills/shift-left-testing/SKILL.md +161 -465
- package/.claude/skills/shift-right-testing/SKILL.md +161 -519
- package/.claude/skills/six-thinking-hats/SKILL.md +175 -1110
- package/.claude/skills/skills-manifest.json +71 -20
- package/.claude/skills/tdd-london-chicago/SKILL.md +131 -448
- package/.claude/skills/technical-writing/SKILL.md +103 -154
- package/.claude/skills/test-automation-strategy/SKILL.md +166 -772
- package/.claude/skills/test-data-management/SKILL.md +126 -910
- package/.claude/skills/test-design-techniques/SKILL.md +179 -89
- package/.claude/skills/test-environment-management/SKILL.md +136 -91
- package/.claude/skills/test-reporting-analytics/SKILL.md +169 -92
- package/.claude/skills/testability-scoring/SKILL.md +172 -538
- package/.claude/skills/testability-scoring/scripts/generate-html-report.js +0 -0
- package/.claude/skills/visual-testing-advanced/SKILL.md +155 -78
- package/.claude/skills/xp-practices/SKILL.md +151 -587
- package/CHANGELOG.md +86 -0
- package/README.md +23 -16
- package/dist/agents/QXPartnerAgent.d.ts +47 -1
- package/dist/agents/QXPartnerAgent.d.ts.map +1 -1
- package/dist/agents/QXPartnerAgent.js +2086 -125
- package/dist/agents/QXPartnerAgent.js.map +1 -1
- package/dist/agents/lifecycle/AgentLifecycleManager.d.ts.map +1 -1
- package/dist/agents/lifecycle/AgentLifecycleManager.js +34 -31
- package/dist/agents/lifecycle/AgentLifecycleManager.js.map +1 -1
- package/dist/cli/commands/init-claude-md-template.d.ts.map +1 -1
- package/dist/cli/commands/init-claude-md-template.js +14 -0
- package/dist/cli/commands/init-claude-md-template.js.map +1 -1
- package/dist/core/SwarmCoordinator.d.ts +180 -0
- package/dist/core/SwarmCoordinator.d.ts.map +1 -0
- package/dist/core/SwarmCoordinator.js +473 -0
- package/dist/core/SwarmCoordinator.js.map +1 -0
- package/dist/core/memory/ReflexionMemoryAdapter.d.ts +109 -0
- package/dist/core/memory/ReflexionMemoryAdapter.d.ts.map +1 -0
- package/dist/core/memory/ReflexionMemoryAdapter.js +306 -0
- package/dist/core/memory/ReflexionMemoryAdapter.js.map +1 -0
- package/dist/core/memory/RuVectorPatternStore.d.ts +28 -0
- package/dist/core/memory/RuVectorPatternStore.d.ts.map +1 -1
- package/dist/core/memory/RuVectorPatternStore.js +70 -0
- package/dist/core/memory/RuVectorPatternStore.js.map +1 -1
- package/dist/core/memory/SparseVectorSearch.d.ts +55 -0
- package/dist/core/memory/SparseVectorSearch.d.ts.map +1 -0
- package/dist/core/memory/SparseVectorSearch.js +130 -0
- package/dist/core/memory/SparseVectorSearch.js.map +1 -0
- package/dist/core/memory/TieredCompression.d.ts +81 -0
- package/dist/core/memory/TieredCompression.d.ts.map +1 -0
- package/dist/core/memory/TieredCompression.js +270 -0
- package/dist/core/memory/TieredCompression.js.map +1 -0
- package/dist/core/memory/index.d.ts +6 -0
- package/dist/core/memory/index.d.ts.map +1 -1
- package/dist/core/memory/index.js +29 -1
- package/dist/core/memory/index.js.map +1 -1
- package/dist/core/metrics/MetricsAggregator.d.ts +228 -0
- package/dist/core/metrics/MetricsAggregator.d.ts.map +1 -0
- package/dist/core/metrics/MetricsAggregator.js +482 -0
- package/dist/core/metrics/MetricsAggregator.js.map +1 -0
- package/dist/core/metrics/index.d.ts +5 -0
- package/dist/core/metrics/index.d.ts.map +1 -0
- package/dist/core/metrics/index.js +11 -0
- package/dist/core/metrics/index.js.map +1 -0
- package/dist/core/optimization/SwarmOptimizer.d.ts +5 -0
- package/dist/core/optimization/SwarmOptimizer.d.ts.map +1 -1
- package/dist/core/optimization/SwarmOptimizer.js +17 -0
- package/dist/core/optimization/SwarmOptimizer.js.map +1 -1
- package/dist/core/orchestration/AdaptiveScheduler.d.ts +190 -0
- package/dist/core/orchestration/AdaptiveScheduler.d.ts.map +1 -0
- package/dist/core/orchestration/AdaptiveScheduler.js +460 -0
- package/dist/core/orchestration/AdaptiveScheduler.js.map +1 -0
- package/dist/core/orchestration/WorkflowOrchestrator.d.ts +13 -0
- package/dist/core/orchestration/WorkflowOrchestrator.d.ts.map +1 -1
- package/dist/core/orchestration/WorkflowOrchestrator.js +32 -0
- package/dist/core/orchestration/WorkflowOrchestrator.js.map +1 -1
- package/dist/core/recovery/CircuitBreaker.d.ts +176 -0
- package/dist/core/recovery/CircuitBreaker.d.ts.map +1 -0
- package/dist/core/recovery/CircuitBreaker.js +382 -0
- package/dist/core/recovery/CircuitBreaker.js.map +1 -0
- package/dist/core/recovery/RecoveryOrchestrator.d.ts +186 -0
- package/dist/core/recovery/RecoveryOrchestrator.d.ts.map +1 -0
- package/dist/core/recovery/RecoveryOrchestrator.js +476 -0
- package/dist/core/recovery/RecoveryOrchestrator.js.map +1 -0
- package/dist/core/recovery/RetryStrategy.d.ts +127 -0
- package/dist/core/recovery/RetryStrategy.d.ts.map +1 -0
- package/dist/core/recovery/RetryStrategy.js +314 -0
- package/dist/core/recovery/RetryStrategy.js.map +1 -0
- package/dist/core/recovery/index.d.ts +8 -0
- package/dist/core/recovery/index.d.ts.map +1 -0
- package/dist/core/recovery/index.js +27 -0
- package/dist/core/recovery/index.js.map +1 -0
- package/dist/core/skills/DependencyResolver.d.ts +99 -0
- package/dist/core/skills/DependencyResolver.d.ts.map +1 -0
- package/dist/core/skills/DependencyResolver.js +260 -0
- package/dist/core/skills/DependencyResolver.js.map +1 -0
- package/dist/core/skills/ManifestGenerator.d.ts +114 -0
- package/dist/core/skills/ManifestGenerator.d.ts.map +1 -0
- package/dist/core/skills/ManifestGenerator.js +449 -0
- package/dist/core/skills/ManifestGenerator.js.map +1 -0
- package/dist/core/skills/index.d.ts +9 -0
- package/dist/core/skills/index.d.ts.map +1 -0
- package/dist/core/skills/index.js +24 -0
- package/dist/core/skills/index.js.map +1 -0
- package/dist/mcp/handlers/chaos/chaos-inject-failure.d.ts +5 -0
- package/dist/mcp/handlers/chaos/chaos-inject-failure.d.ts.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-failure.js +36 -2
- package/dist/mcp/handlers/chaos/chaos-inject-failure.js.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-latency.d.ts +5 -0
- package/dist/mcp/handlers/chaos/chaos-inject-latency.d.ts.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-latency.js +36 -2
- package/dist/mcp/handlers/chaos/chaos-inject-latency.js.map +1 -1
- package/dist/mcp/server.d.ts +9 -9
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +1 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/types/qx.d.ts +113 -7
- package/dist/types/qx.d.ts.map +1 -1
- package/dist/types/qx.js.map +1 -1
- package/dist/visualization/api/RestEndpoints.js +1 -1
- package/dist/visualization/api/RestEndpoints.js.map +1 -1
- package/package.json +15 -54
|
@@ -1,154 +1,244 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-design-techniques
|
|
3
|
-
description: Systematic test design with boundary value analysis, equivalence partitioning, decision tables, state transition testing, and combinatorial testing. Use when designing comprehensive test cases, reducing redundant tests, or ensuring systematic coverage.
|
|
3
|
+
description: "Systematic test design with boundary value analysis, equivalence partitioning, decision tables, state transition testing, and combinatorial testing. Use when designing comprehensive test cases, reducing redundant tests, or ensuring systematic coverage."
|
|
4
|
+
category: specialized-testing
|
|
5
|
+
priority: high
|
|
6
|
+
tokenEstimate: 900
|
|
7
|
+
agents: [qe-test-generator, qe-coverage-analyzer, qe-quality-analyzer]
|
|
8
|
+
implementation_status: optimized
|
|
9
|
+
optimization_version: 1.0
|
|
10
|
+
last_optimized: 2025-12-02
|
|
11
|
+
dependencies: []
|
|
12
|
+
quick_reference_card: true
|
|
13
|
+
tags: [test-design, bva, equivalence-partitioning, decision-tables, pairwise, state-transition]
|
|
4
14
|
---
|
|
5
15
|
|
|
6
16
|
# Test Design Techniques
|
|
7
17
|
|
|
8
|
-
|
|
18
|
+
<default_to_action>
|
|
19
|
+
When designing test cases systematically:
|
|
20
|
+
1. APPLY Boundary Value Analysis (test at min, max, edges)
|
|
21
|
+
2. USE Equivalence Partitioning (one test per partition)
|
|
22
|
+
3. CREATE Decision Tables (for complex business rules)
|
|
23
|
+
4. MODEL State Transitions (for stateful behavior)
|
|
24
|
+
5. REDUCE with Pairwise Testing (for combinations)
|
|
25
|
+
|
|
26
|
+
**Quick Design Selection:**
|
|
27
|
+
- Numeric ranges → BVA + EP
|
|
28
|
+
- Multiple conditions → Decision Tables
|
|
29
|
+
- Workflows → State Transition
|
|
30
|
+
- Many parameters → Pairwise Testing
|
|
31
|
+
|
|
32
|
+
**Critical Success Factors:**
|
|
33
|
+
- Systematic design finds more bugs with fewer tests
|
|
34
|
+
- Random testing is inefficient
|
|
35
|
+
- 40+ years of research backs these techniques
|
|
36
|
+
</default_to_action>
|
|
37
|
+
|
|
38
|
+
## Quick Reference Card
|
|
39
|
+
|
|
40
|
+
### When to Use
|
|
41
|
+
- Designing new test suites
|
|
42
|
+
- Optimizing existing tests
|
|
43
|
+
- Complex business rules
|
|
44
|
+
- Reducing test redundancy
|
|
45
|
+
|
|
46
|
+
### Technique Selection Guide
|
|
47
|
+
| Scenario | Technique |
|
|
48
|
+
|----------|-----------|
|
|
49
|
+
| **Numeric input ranges** | BVA + EP |
|
|
50
|
+
| **Multiple conditions** | Decision Tables |
|
|
51
|
+
| **Stateful workflows** | State Transition |
|
|
52
|
+
| **Many parameter combinations** | Pairwise |
|
|
53
|
+
| **All combinations critical** | Full Factorial |
|
|
9
54
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Random testing is inefficient. Proven test design techniques (40+ years of research) systematically identify high-value test cases, reduce redundancy, and maximize bug detection.
|
|
55
|
+
---
|
|
13
56
|
|
|
14
57
|
## Boundary Value Analysis (BVA)
|
|
15
58
|
|
|
16
|
-
**Principle:** Bugs cluster at boundaries
|
|
59
|
+
**Principle:** Bugs cluster at boundaries.
|
|
17
60
|
|
|
18
|
-
**Test at:**
|
|
61
|
+
**Test at boundaries:**
|
|
19
62
|
- Minimum valid value
|
|
20
63
|
- Just below minimum (invalid)
|
|
21
64
|
- Just above minimum (valid)
|
|
22
65
|
- Maximum valid value
|
|
23
66
|
- Just above maximum (invalid)
|
|
24
|
-
- Just below maximum (valid)
|
|
25
67
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
68
|
+
```javascript
|
|
69
|
+
// Age field: 18-120 valid
|
|
70
|
+
const boundaryTests = [
|
|
71
|
+
{ input: 17, expected: 'invalid' }, // Below min
|
|
72
|
+
{ input: 18, expected: 'valid' }, // Min boundary
|
|
73
|
+
{ input: 19, expected: 'valid' }, // Above min
|
|
74
|
+
{ input: 119, expected: 'valid' }, // Below max
|
|
75
|
+
{ input: 120, expected: 'valid' }, // Max boundary
|
|
76
|
+
{ input: 121, expected: 'invalid' } // Above max
|
|
77
|
+
];
|
|
35
78
|
```
|
|
36
79
|
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
// qe-test-generator automatically identifies boundaries
|
|
40
|
-
const tests = await agent.generateBVATests({
|
|
41
|
-
field: 'age',
|
|
42
|
-
dataType: 'integer',
|
|
43
|
-
constraints: { min: 18, max: 120 }
|
|
44
|
-
});
|
|
45
|
-
// Returns: 6 boundary test cases
|
|
46
|
-
```
|
|
80
|
+
---
|
|
47
81
|
|
|
48
82
|
## Equivalence Partitioning (EP)
|
|
49
83
|
|
|
50
|
-
**Principle:**
|
|
84
|
+
**Principle:** One test per equivalent class.
|
|
51
85
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
✓ -1 → Reject
|
|
67
|
-
✓ 5 → 0% discount
|
|
68
|
-
✓ 50 → 10% discount
|
|
69
|
-
✓ 200 → 20% discount
|
|
86
|
+
```javascript
|
|
87
|
+
// Discount rules:
|
|
88
|
+
// 1-10: No discount
|
|
89
|
+
// 11-100: 10% discount
|
|
90
|
+
// 101+: 20% discount
|
|
91
|
+
|
|
92
|
+
const partitionTests = [
|
|
93
|
+
{ quantity: -1, expected: 'invalid' }, // Invalid partition
|
|
94
|
+
{ quantity: 5, expected: 0 }, // Partition 1: 1-10
|
|
95
|
+
{ quantity: 50, expected: 0.10 }, // Partition 2: 11-100
|
|
96
|
+
{ quantity: 200, expected: 0.20 } // Partition 3: 101+
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
// 4 tests cover all behavior (vs 200+ if testing every value)
|
|
70
100
|
```
|
|
71
101
|
|
|
102
|
+
---
|
|
103
|
+
|
|
72
104
|
## Decision Tables
|
|
73
105
|
|
|
74
106
|
**Use for:** Complex business rules with multiple conditions.
|
|
75
107
|
|
|
76
|
-
**Example: Loan Approval**
|
|
77
108
|
```
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
109
|
+
Loan Approval Rules:
|
|
110
|
+
┌──────────────┬───────┬───────┬───────┬───────┬───────┐
|
|
111
|
+
│ Conditions │ R1 │ R2 │ R3 │ R4 │ R5 │
|
|
112
|
+
├──────────────┼───────┼───────┼───────┼───────┼───────┤
|
|
113
|
+
│ Age ≥ 18 │ Yes │ Yes │ Yes │ No │ Yes │
|
|
114
|
+
│ Credit ≥ 700 │ Yes │ Yes │ No │ Yes │ No │
|
|
115
|
+
│ Income ≥ 50k │ Yes │ No │ Yes │ Yes │ Yes │
|
|
116
|
+
├──────────────┼───────┼───────┼───────┼───────┼───────┤
|
|
117
|
+
│ Result │Approve│Approve│Reject │Reject │Reject │
|
|
118
|
+
└──────────────┴───────┴───────┴───────┴───────┴───────┘
|
|
119
|
+
|
|
120
|
+
// 5 tests cover all decision combinations
|
|
90
121
|
```
|
|
91
122
|
|
|
92
|
-
|
|
123
|
+
---
|
|
93
124
|
|
|
94
125
|
## State Transition Testing
|
|
95
126
|
|
|
96
127
|
**Model state changes:**
|
|
128
|
+
|
|
97
129
|
```
|
|
98
130
|
States: Logged Out → Logged In → Premium → Suspended
|
|
99
131
|
|
|
100
|
-
Transitions:
|
|
101
|
-
Login: Logged Out → Logged In
|
|
102
|
-
Upgrade: Logged In → Premium
|
|
103
|
-
Payment Fail: Premium → Suspended
|
|
104
|
-
Logout: Any → Logged Out
|
|
132
|
+
Valid Transitions:
|
|
133
|
+
- Login: Logged Out → Logged In
|
|
134
|
+
- Upgrade: Logged In → Premium
|
|
135
|
+
- Payment Fail: Premium → Suspended
|
|
136
|
+
- Logout: Any → Logged Out
|
|
105
137
|
|
|
106
138
|
Invalid Transitions to Test:
|
|
107
|
-
Logged Out → Premium (should reject)
|
|
108
|
-
Suspended → Premium (should reject)
|
|
139
|
+
- Logged Out → Premium (should reject)
|
|
140
|
+
- Suspended → Premium (should reject)
|
|
109
141
|
```
|
|
110
142
|
|
|
111
|
-
|
|
143
|
+
```javascript
|
|
144
|
+
test('cannot upgrade without login', async () => {
|
|
145
|
+
const result = await user.upgrade(); // While logged out
|
|
146
|
+
expect(result.error).toBe('Login required');
|
|
147
|
+
});
|
|
148
|
+
```
|
|
112
149
|
|
|
113
|
-
|
|
150
|
+
---
|
|
114
151
|
|
|
115
|
-
|
|
152
|
+
## Pairwise (Combinatorial) Testing
|
|
153
|
+
|
|
154
|
+
**Problem:** All combinations explode exponentially.
|
|
155
|
+
|
|
156
|
+
```javascript
|
|
157
|
+
// Parameters:
|
|
158
|
+
// Browser: Chrome, Firefox, Safari (3)
|
|
159
|
+
// OS: Windows, Mac, Linux (3)
|
|
160
|
+
// Screen: Desktop, Tablet, Mobile (3)
|
|
161
|
+
|
|
162
|
+
// All combinations: 3 × 3 × 3 = 27 tests
|
|
163
|
+
// Pairwise: 9 tests cover all pairs
|
|
164
|
+
|
|
165
|
+
const pairwiseTests = [
|
|
166
|
+
{ browser: 'Chrome', os: 'Windows', screen: 'Desktop' },
|
|
167
|
+
{ browser: 'Chrome', os: 'Mac', screen: 'Tablet' },
|
|
168
|
+
{ browser: 'Chrome', os: 'Linux', screen: 'Mobile' },
|
|
169
|
+
{ browser: 'Firefox', os: 'Windows', screen: 'Tablet' },
|
|
170
|
+
{ browser: 'Firefox', os: 'Mac', screen: 'Mobile' },
|
|
171
|
+
{ browser: 'Firefox', os: 'Linux', screen: 'Desktop' },
|
|
172
|
+
{ browser: 'Safari', os: 'Windows', screen: 'Mobile' },
|
|
173
|
+
{ browser: 'Safari', os: 'Mac', screen: 'Desktop' },
|
|
174
|
+
{ browser: 'Safari', os: 'Linux', screen: 'Tablet' }
|
|
175
|
+
];
|
|
176
|
+
// Each pair appears at least once
|
|
116
177
|
```
|
|
117
|
-
Browser: Chrome, Firefox, Safari (3)
|
|
118
|
-
OS: Windows, Mac, Linux (3)
|
|
119
|
-
Screen: Desktop, Tablet, Mobile (3)
|
|
120
178
|
|
|
121
|
-
|
|
179
|
+
---
|
|
122
180
|
|
|
123
|
-
|
|
124
|
-
```
|
|
181
|
+
## Agent-Driven Test Design
|
|
125
182
|
|
|
126
|
-
**With Agents:**
|
|
127
183
|
```typescript
|
|
128
|
-
//
|
|
129
|
-
|
|
184
|
+
// Auto-generate BVA tests
|
|
185
|
+
await Task("Generate BVA Tests", {
|
|
186
|
+
field: 'age',
|
|
187
|
+
dataType: 'integer',
|
|
188
|
+
constraints: { min: 18, max: 120 }
|
|
189
|
+
}, "qe-test-generator");
|
|
190
|
+
// Returns: 6 boundary test cases
|
|
191
|
+
|
|
192
|
+
// Auto-generate pairwise tests
|
|
193
|
+
await Task("Generate Pairwise Tests", {
|
|
130
194
|
parameters: {
|
|
131
195
|
browser: ['Chrome', 'Firefox', 'Safari'],
|
|
132
196
|
os: ['Windows', 'Mac', 'Linux'],
|
|
133
197
|
screen: ['Desktop', 'Tablet', 'Mobile']
|
|
134
198
|
}
|
|
135
|
-
});
|
|
199
|
+
}, "qe-test-generator");
|
|
136
200
|
// Returns: 9-12 tests (vs 27 full combination)
|
|
137
201
|
```
|
|
138
202
|
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Agent Coordination Hints
|
|
206
|
+
|
|
207
|
+
### Memory Namespace
|
|
208
|
+
```
|
|
209
|
+
aqe/test-design/
|
|
210
|
+
├── bva-analysis/* - Boundary value tests
|
|
211
|
+
├── partitions/* - Equivalence partitions
|
|
212
|
+
├── decision-tables/* - Decision table tests
|
|
213
|
+
└── pairwise/* - Combinatorial reduction
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Fleet Coordination
|
|
217
|
+
```typescript
|
|
218
|
+
const designFleet = await FleetManager.coordinate({
|
|
219
|
+
strategy: 'systematic-test-design',
|
|
220
|
+
agents: [
|
|
221
|
+
'qe-test-generator', // Apply design techniques
|
|
222
|
+
'qe-coverage-analyzer', // Analyze coverage
|
|
223
|
+
'qe-quality-analyzer' // Assess test quality
|
|
224
|
+
],
|
|
225
|
+
topology: 'sequential'
|
|
226
|
+
});
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
139
231
|
## Related Skills
|
|
232
|
+
- [agentic-quality-engineering](../agentic-quality-engineering/) - Agent-driven testing
|
|
233
|
+
- [risk-based-testing](../risk-based-testing/) - Prioritize by risk
|
|
234
|
+
- [mutation-testing](../mutation-testing/) - Validate test effectiveness
|
|
140
235
|
|
|
141
|
-
|
|
142
|
-
- [test-automation-strategy](../test-automation-strategy/)
|
|
143
|
-
- [risk-based-testing](../risk-based-testing/)
|
|
236
|
+
---
|
|
144
237
|
|
|
145
238
|
## Remember
|
|
146
239
|
|
|
147
|
-
**Systematic design > Random testing
|
|
240
|
+
**Systematic design > Random testing.** 40+ years of research shows these techniques find more bugs with fewer tests than ad-hoc approaches.
|
|
148
241
|
|
|
149
|
-
|
|
150
|
-
- EP reduces redundant tests
|
|
151
|
-
- Decision tables handle complexity
|
|
152
|
-
- Pairwise reduces combinatorial explosion
|
|
242
|
+
**Combine techniques for comprehensive coverage.** BVA for boundaries, EP for partitions, decision tables for rules, pairwise for combinations.
|
|
153
243
|
|
|
154
|
-
**With Agents:** `qe-test-generator` applies these techniques automatically, generating optimal test suites with maximum coverage and minimum redundancy.
|
|
244
|
+
**With Agents:** `qe-test-generator` applies these techniques automatically, generating optimal test suites with maximum coverage and minimum redundancy. Agents identify boundaries, partitions, and combinations from code analysis.
|
|
@@ -1,53 +1,70 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-environment-management
|
|
3
|
-
description: Test environment provisioning, infrastructure as code for testing, Docker/Kubernetes for test environments, service virtualization, and cost optimization. Use when managing test infrastructure, ensuring environment parity, or optimizing testing costs.
|
|
3
|
+
description: "Test environment provisioning, infrastructure as code for testing, Docker/Kubernetes for test environments, service virtualization, and cost optimization. Use when managing test infrastructure, ensuring environment parity, or optimizing testing costs."
|
|
4
|
+
category: specialized-testing
|
|
5
|
+
priority: medium
|
|
6
|
+
tokenEstimate: 900
|
|
7
|
+
agents: [qe-test-executor, qe-performance-tester, qe-chaos-engineer]
|
|
8
|
+
implementation_status: optimized
|
|
9
|
+
optimization_version: 1.0
|
|
10
|
+
last_optimized: 2025-12-02
|
|
11
|
+
dependencies: []
|
|
12
|
+
quick_reference_card: true
|
|
13
|
+
tags: [environment, docker, kubernetes, infrastructure, parity, cost-optimization]
|
|
4
14
|
---
|
|
5
15
|
|
|
6
16
|
# Test Environment Management
|
|
7
17
|
|
|
8
|
-
|
|
18
|
+
<default_to_action>
|
|
19
|
+
When managing test environments:
|
|
20
|
+
1. DEFINE environment types (local, CI, staging, prod)
|
|
21
|
+
2. CONTAINERIZE with Docker for consistency
|
|
22
|
+
3. ENSURE parity with production (same versions, configs)
|
|
23
|
+
4. MOCK external services (service virtualization)
|
|
24
|
+
5. OPTIMIZE costs (auto-shutdown, spot instances)
|
|
25
|
+
|
|
26
|
+
**Quick Environment Checklist:**
|
|
27
|
+
- Same OS/versions as production
|
|
28
|
+
- Same database type and version
|
|
29
|
+
- Same configuration structure
|
|
30
|
+
- Containers for reproducibility
|
|
31
|
+
- Auto-shutdown after hours
|
|
32
|
+
|
|
33
|
+
**Critical Success Factors:**
|
|
34
|
+
- "Works on my machine" = environment inconsistency
|
|
35
|
+
- Infrastructure as Code = repeatable environments
|
|
36
|
+
- Service virtualization = test without external dependencies
|
|
37
|
+
</default_to_action>
|
|
38
|
+
|
|
39
|
+
## Quick Reference Card
|
|
40
|
+
|
|
41
|
+
### When to Use
|
|
42
|
+
- Setting up test infrastructure
|
|
43
|
+
- Debugging environment-specific failures
|
|
44
|
+
- Reducing test infrastructure costs
|
|
45
|
+
- Ensuring dev/prod parity
|
|
46
|
+
|
|
47
|
+
### Environment Types
|
|
48
|
+
| Type | Purpose | Lifetime |
|
|
49
|
+
|------|---------|----------|
|
|
50
|
+
| **Local** | Fast feedback | Developer session |
|
|
51
|
+
| **CI** | Automated tests | Per build (ephemeral) |
|
|
52
|
+
| **Staging** | Pre-prod validation | Persistent |
|
|
53
|
+
| **Production** | Canary/synthetic | Continuous |
|
|
54
|
+
|
|
55
|
+
### Dev/Prod Parity Checklist
|
|
56
|
+
| Item | Must Match |
|
|
57
|
+
|------|------------|
|
|
58
|
+
| OS | Same version |
|
|
59
|
+
| Database | Same type + version |
|
|
60
|
+
| Dependencies | Same versions |
|
|
61
|
+
| Config | Same structure |
|
|
62
|
+
| Env vars | Same names |
|
|
9
63
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Test environment management ensures consistent, reproducible environments for testing while optimizing cost and maintenance.
|
|
13
|
-
|
|
14
|
-
## Environment Types
|
|
15
|
-
|
|
16
|
-
### Local Development
|
|
17
|
-
```
|
|
18
|
-
Developer machine
|
|
19
|
-
- Fast feedback
|
|
20
|
-
- Full control
|
|
21
|
-
- May differ from production
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### CI Environment
|
|
25
|
-
```
|
|
26
|
-
GitHub Actions, Jenkins, etc.
|
|
27
|
-
- Automated tests
|
|
28
|
-
- Ephemeral (created per build)
|
|
29
|
-
- Must match production closely
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Staging/QA Environment
|
|
33
|
-
```
|
|
34
|
-
Pre-production mirror
|
|
35
|
-
- Integration testing
|
|
36
|
-
- User acceptance testing
|
|
37
|
-
- Should match production exactly
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Production (Testing in Prod)
|
|
41
|
-
```
|
|
42
|
-
Real environment
|
|
43
|
-
- Canary deployments
|
|
44
|
-
- Feature flags
|
|
45
|
-
- Synthetic monitoring
|
|
46
|
-
```
|
|
64
|
+
---
|
|
47
65
|
|
|
48
66
|
## Docker for Test Environments
|
|
49
67
|
|
|
50
|
-
**Containerize test dependencies:**
|
|
51
68
|
```yaml
|
|
52
69
|
# docker-compose.test.yml
|
|
53
70
|
version: '3.8'
|
|
@@ -69,13 +86,9 @@ services:
|
|
|
69
86
|
environment:
|
|
70
87
|
POSTGRES_DB: test
|
|
71
88
|
POSTGRES_PASSWORD: password
|
|
72
|
-
ports:
|
|
73
|
-
- "5432:5432"
|
|
74
89
|
|
|
75
90
|
redis:
|
|
76
91
|
image: redis:7
|
|
77
|
-
ports:
|
|
78
|
-
- "6379:6379"
|
|
79
92
|
```
|
|
80
93
|
|
|
81
94
|
**Run tests in container:**
|
|
@@ -85,9 +98,10 @@ docker-compose -f docker-compose.test.yml exec app npm test
|
|
|
85
98
|
docker-compose -f docker-compose.test.yml down
|
|
86
99
|
```
|
|
87
100
|
|
|
101
|
+
---
|
|
102
|
+
|
|
88
103
|
## Infrastructure as Code
|
|
89
104
|
|
|
90
|
-
**Terraform for test environments:**
|
|
91
105
|
```hcl
|
|
92
106
|
# test-environment.tf
|
|
93
107
|
resource "aws_instance" "test_server" {
|
|
@@ -95,31 +109,27 @@ resource "aws_instance" "test_server" {
|
|
|
95
109
|
instance_type = "t3.medium"
|
|
96
110
|
|
|
97
111
|
tags = {
|
|
98
|
-
Name
|
|
99
|
-
Environment
|
|
112
|
+
Name = "test-environment"
|
|
113
|
+
Environment = "test"
|
|
100
114
|
AutoShutdown = "20:00" # Cost optimization
|
|
101
115
|
}
|
|
102
116
|
}
|
|
103
117
|
|
|
104
118
|
resource "aws_rds_instance" "test_db" {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
instance_class = "db.t3.micro"
|
|
109
|
-
db_name = "test"
|
|
110
|
-
username = "testuser"
|
|
111
|
-
password = var.db_password
|
|
112
|
-
|
|
119
|
+
engine = "postgres"
|
|
120
|
+
engine_version = "15"
|
|
121
|
+
instance_class = "db.t3.micro"
|
|
113
122
|
backup_retention_period = 0 # No backups needed for test
|
|
114
|
-
skip_final_snapshot
|
|
123
|
+
skip_final_snapshot = true
|
|
115
124
|
}
|
|
116
125
|
```
|
|
117
126
|
|
|
127
|
+
---
|
|
128
|
+
|
|
118
129
|
## Service Virtualization
|
|
119
130
|
|
|
120
|
-
**Mock external services:**
|
|
121
131
|
```javascript
|
|
122
|
-
//
|
|
132
|
+
// Mock external services with WireMock
|
|
123
133
|
import { WireMock } from 'wiremock-captain';
|
|
124
134
|
|
|
125
135
|
const wiremock = new WireMock('http://localhost:8080');
|
|
@@ -132,67 +142,102 @@ await wiremock.register({
|
|
|
132
142
|
},
|
|
133
143
|
response: {
|
|
134
144
|
status: 200,
|
|
135
|
-
jsonBody: {
|
|
136
|
-
transactionId: '12345',
|
|
137
|
-
status: 'approved'
|
|
138
|
-
}
|
|
145
|
+
jsonBody: { transactionId: '12345', status: 'approved' }
|
|
139
146
|
}
|
|
140
147
|
});
|
|
141
148
|
|
|
142
149
|
// Tests use mock instead of real gateway
|
|
143
150
|
```
|
|
144
151
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
**Dev/Prod Parity Checklist:**
|
|
148
|
-
- [ ] Same OS and versions
|
|
149
|
-
- [ ] Same database type and version
|
|
150
|
-
- [ ] Same dependency versions
|
|
151
|
-
- [ ] Same configuration structure
|
|
152
|
-
- [ ] Same environment variables
|
|
153
|
-
|
|
154
|
-
**12-Factor App principles for parity**
|
|
152
|
+
---
|
|
155
153
|
|
|
156
154
|
## Cost Optimization
|
|
157
155
|
|
|
158
|
-
**Auto-shutdown test environments:**
|
|
159
156
|
```bash
|
|
160
|
-
#
|
|
161
|
-
0 20 * * * aws ec2 stop-instances --instance-ids $(aws ec2 describe-instances
|
|
157
|
+
# Auto-shutdown test environments after hours
|
|
158
|
+
0 20 * * * aws ec2 stop-instances --instance-ids $(aws ec2 describe-instances \
|
|
159
|
+
--filters "Name=tag:Environment,Values=test" \
|
|
160
|
+
--query "Reservations[].Instances[].InstanceId" --output text)
|
|
162
161
|
|
|
163
162
|
# Start before work hours
|
|
164
|
-
0 7 * * 1-5 aws ec2 start-instances --instance-ids $(aws ec2 describe-instances
|
|
163
|
+
0 7 * * 1-5 aws ec2 start-instances --instance-ids $(aws ec2 describe-instances \
|
|
164
|
+
--filters "Name=tag:Environment,Values=test" \
|
|
165
|
+
--query "Reservations[].Instances[].InstanceId" --output text)
|
|
165
166
|
```
|
|
166
167
|
|
|
167
|
-
**Use spot instances
|
|
168
|
+
**Use spot instances (70% savings):**
|
|
168
169
|
```hcl
|
|
169
170
|
resource "aws_instance" "test_runner" {
|
|
170
|
-
instance_type
|
|
171
|
+
instance_type = "c5.2xlarge"
|
|
171
172
|
instance_market_options {
|
|
172
173
|
market_type = "spot"
|
|
173
174
|
spot_options {
|
|
174
|
-
max_price = "0.10"
|
|
175
|
+
max_price = "0.10"
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
```
|
|
179
180
|
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Agent-Driven Environment Management
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
// Provision test environment
|
|
187
|
+
await Task("Environment Provisioning", {
|
|
188
|
+
type: 'integration-testing',
|
|
189
|
+
services: ['app', 'db', 'redis', 'mocks'],
|
|
190
|
+
parity: 'production',
|
|
191
|
+
lifetime: '2h'
|
|
192
|
+
}, "qe-test-executor");
|
|
193
|
+
|
|
194
|
+
// Chaos testing in isolated environment
|
|
195
|
+
await Task("Chaos Test Environment", {
|
|
196
|
+
baseline: 'staging',
|
|
197
|
+
isolate: true,
|
|
198
|
+
injectFaults: ['network-delay', 'pod-failure']
|
|
199
|
+
}, "qe-chaos-engineer");
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Agent Coordination Hints
|
|
205
|
+
|
|
206
|
+
### Memory Namespace
|
|
207
|
+
```
|
|
208
|
+
aqe/environment-management/
|
|
209
|
+
├── configs/* - Environment configurations
|
|
210
|
+
├── parity-checks/* - Dev/prod parity results
|
|
211
|
+
├── cost-reports/* - Infrastructure costs
|
|
212
|
+
└── service-mocks/* - Service virtualization configs
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Fleet Coordination
|
|
216
|
+
```typescript
|
|
217
|
+
const envFleet = await FleetManager.coordinate({
|
|
218
|
+
strategy: 'environment-management',
|
|
219
|
+
agents: [
|
|
220
|
+
'qe-test-executor', // Provision environments
|
|
221
|
+
'qe-performance-tester', // Environment performance
|
|
222
|
+
'qe-chaos-engineer' // Resilience testing
|
|
223
|
+
],
|
|
224
|
+
topology: 'sequential'
|
|
225
|
+
});
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
180
230
|
## Related Skills
|
|
231
|
+
- [test-data-management](../test-data-management/) - Data for environments
|
|
232
|
+
- [continuous-testing-shift-left](../continuous-testing-shift-left/) - CI/CD environments
|
|
233
|
+
- [chaos-engineering-resilience](../chaos-engineering-resilience/) - Environment resilience
|
|
181
234
|
|
|
182
|
-
|
|
183
|
-
- [continuous-testing-shift-left](../continuous-testing-shift-left/)
|
|
184
|
-
- [test-automation-strategy](../test-automation-strategy/)
|
|
235
|
+
---
|
|
185
236
|
|
|
186
237
|
## Remember
|
|
187
238
|
|
|
188
|
-
**Environment inconsistency = flaky tests.**
|
|
189
|
-
|
|
190
|
-
"Works on my machine" problems from:
|
|
191
|
-
- Different OS/versions
|
|
192
|
-
- Missing dependencies
|
|
193
|
-
- Configuration differences
|
|
194
|
-
- Data differences
|
|
239
|
+
**Environment inconsistency = flaky tests.** "Works on my machine" problems come from: different OS/versions, missing dependencies, configuration differences, data differences.
|
|
195
240
|
|
|
196
|
-
**Infrastructure as Code ensures repeatability.**
|
|
241
|
+
**Infrastructure as Code ensures repeatability.** Version control your environment configurations. Spin up identical environments on demand.
|
|
197
242
|
|
|
198
|
-
**With Agents:** Agents automatically provision test environments, ensure parity
|
|
243
|
+
**With Agents:** Agents automatically provision test environments matching production, ensure parity, mock external services, and optimize costs with auto-scaling and auto-shutdown.
|