agentic-qe 1.9.4 → 2.1.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/.claude/agents/qe-api-contract-validator.md +95 -1336
- package/.claude/agents/qe-chaos-engineer.md +152 -1211
- package/.claude/agents/qe-code-complexity.md +144 -707
- package/.claude/agents/qe-coverage-analyzer.md +147 -743
- package/.claude/agents/qe-deployment-readiness.md +143 -1496
- package/.claude/agents/qe-flaky-test-hunter.md +132 -1529
- package/.claude/agents/qe-fleet-commander.md +12 -12
- package/.claude/agents/qe-performance-tester.md +150 -886
- package/.claude/agents/qe-production-intelligence.md +155 -1396
- package/.claude/agents/qe-quality-analyzer.md +6 -6
- package/.claude/agents/qe-quality-gate.md +151 -648
- package/.claude/agents/qe-regression-risk-analyzer.md +132 -1150
- package/.claude/agents/qe-requirements-validator.md +149 -932
- package/.claude/agents/qe-security-scanner.md +157 -797
- package/.claude/agents/qe-test-data-architect.md +96 -1365
- package/.claude/agents/qe-test-executor.md +8 -8
- package/.claude/agents/qe-test-generator.md +145 -1540
- package/.claude/agents/qe-visual-tester.md +153 -1257
- package/.claude/agents/qx-partner.md +248 -0
- package/.claude/agents/subagents/qe-code-reviewer.md +40 -136
- package/.claude/agents/subagents/qe-coverage-gap-analyzer.md +40 -480
- package/.claude/agents/subagents/qe-data-generator.md +41 -125
- package/.claude/agents/subagents/qe-flaky-investigator.md +55 -411
- package/.claude/agents/subagents/qe-integration-tester.md +53 -141
- package/.claude/agents/subagents/qe-performance-validator.md +54 -130
- package/.claude/agents/subagents/qe-security-auditor.md +56 -114
- package/.claude/agents/subagents/qe-test-data-architect-sub.md +57 -548
- package/.claude/agents/subagents/qe-test-implementer.md +58 -551
- package/.claude/agents/subagents/qe-test-refactorer.md +65 -722
- package/.claude/agents/subagents/qe-test-writer.md +63 -726
- 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 +683 -0
- 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/README.md +71 -0
- package/.claude/skills/testability-scoring/SKILL.md +245 -0
- package/.claude/skills/testability-scoring/resources/templates/config.template.js +84 -0
- package/.claude/skills/testability-scoring/resources/templates/testability-scoring.spec.template.js +532 -0
- package/.claude/skills/testability-scoring/scripts/generate-html-report.js +1007 -0
- package/.claude/skills/testability-scoring/scripts/run-assessment.sh +70 -0
- package/.claude/skills/visual-testing-advanced/SKILL.md +155 -78
- package/.claude/skills/xp-practices/SKILL.md +151 -587
- package/CHANGELOG.md +110 -0
- package/README.md +55 -21
- package/dist/agents/QXPartnerAgent.d.ts +146 -0
- package/dist/agents/QXPartnerAgent.d.ts.map +1 -0
- package/dist/agents/QXPartnerAgent.js +1831 -0
- package/dist/agents/QXPartnerAgent.js.map +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +82 -2
- package/dist/agents/index.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/debug/agent.d.ts.map +1 -1
- package/dist/cli/commands/debug/agent.js +19 -6
- package/dist/cli/commands/debug/agent.js.map +1 -1
- package/dist/cli/commands/debug/health-check.js +20 -7
- package/dist/cli/commands/debug/health-check.js.map +1 -1
- package/dist/cli/commands/init-claude-md-template.d.ts +1 -0
- package/dist/cli/commands/init-claude-md-template.d.ts.map +1 -1
- package/dist/cli/commands/init-claude-md-template.js +18 -3
- package/dist/cli/commands/init-claude-md-template.js.map +1 -1
- package/dist/cli/commands/workflow/cancel.d.ts.map +1 -1
- package/dist/cli/commands/workflow/cancel.js +4 -3
- package/dist/cli/commands/workflow/cancel.js.map +1 -1
- package/dist/cli/commands/workflow/list.d.ts.map +1 -1
- package/dist/cli/commands/workflow/list.js +4 -3
- package/dist/cli/commands/workflow/list.js.map +1 -1
- package/dist/cli/commands/workflow/pause.d.ts.map +1 -1
- package/dist/cli/commands/workflow/pause.js +4 -3
- package/dist/cli/commands/workflow/pause.js.map +1 -1
- package/dist/cli/init/claude-config.d.ts.map +1 -1
- package/dist/cli/init/claude-config.js +3 -8
- package/dist/cli/init/claude-config.js.map +1 -1
- package/dist/cli/init/claude-md.d.ts.map +1 -1
- package/dist/cli/init/claude-md.js +44 -2
- package/dist/cli/init/claude-md.js.map +1 -1
- package/dist/cli/init/database-init.js +1 -1
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/index.js +13 -6
- package/dist/cli/init/index.js.map +1 -1
- package/dist/cli/init/skills.d.ts.map +1 -1
- package/dist/cli/init/skills.js +2 -1
- package/dist/cli/init/skills.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/AgentDBIntegration.d.ts +24 -6
- package/dist/core/memory/AgentDBIntegration.d.ts.map +1 -1
- package/dist/core/memory/AgentDBIntegration.js +66 -10
- package/dist/core/memory/AgentDBIntegration.js.map +1 -1
- package/dist/core/memory/UnifiedMemoryCoordinator.d.ts +341 -0
- package/dist/core/memory/UnifiedMemoryCoordinator.d.ts.map +1 -0
- package/dist/core/memory/UnifiedMemoryCoordinator.js +986 -0
- package/dist/core/memory/UnifiedMemoryCoordinator.js.map +1 -0
- package/dist/core/memory/index.d.ts +5 -0
- package/dist/core/memory/index.d.ts.map +1 -1
- package/dist/core/memory/index.js +23 -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 +190 -0
- package/dist/core/optimization/SwarmOptimizer.d.ts.map +1 -0
- package/dist/core/optimization/SwarmOptimizer.js +648 -0
- package/dist/core/optimization/SwarmOptimizer.js.map +1 -0
- package/dist/core/optimization/index.d.ts +9 -0
- package/dist/core/optimization/index.d.ts.map +1 -0
- package/dist/core/optimization/index.js +25 -0
- package/dist/core/optimization/index.js.map +1 -0
- package/dist/core/optimization/types.d.ts +53 -0
- package/dist/core/optimization/types.d.ts.map +1 -0
- package/dist/core/optimization/types.js +6 -0
- package/dist/core/optimization/types.js.map +1 -0
- 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/PriorityQueue.d.ts +54 -0
- package/dist/core/orchestration/PriorityQueue.d.ts.map +1 -0
- package/dist/core/orchestration/PriorityQueue.js +122 -0
- package/dist/core/orchestration/PriorityQueue.js.map +1 -0
- package/dist/core/orchestration/WorkflowOrchestrator.d.ts +189 -0
- package/dist/core/orchestration/WorkflowOrchestrator.d.ts.map +1 -0
- package/dist/core/orchestration/WorkflowOrchestrator.js +845 -0
- package/dist/core/orchestration/WorkflowOrchestrator.js.map +1 -0
- package/dist/core/orchestration/index.d.ts +7 -0
- package/dist/core/orchestration/index.d.ts.map +1 -0
- package/dist/core/orchestration/index.js +11 -0
- package/dist/core/orchestration/index.js.map +1 -0
- package/dist/core/orchestration/types.d.ts +96 -0
- package/dist/core/orchestration/types.d.ts.map +1 -0
- package/dist/core/orchestration/types.js +6 -0
- package/dist/core/orchestration/types.js.map +1 -0
- 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/DynamicSkillLoader.d.ts +96 -0
- package/dist/core/skills/DynamicSkillLoader.d.ts.map +1 -0
- package/dist/core/skills/DynamicSkillLoader.js +353 -0
- package/dist/core/skills/DynamicSkillLoader.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/core/skills/types.d.ts +118 -0
- package/dist/core/skills/types.d.ts.map +1 -0
- package/dist/core/skills/types.js +7 -0
- package/dist/core/skills/types.js.map +1 -0
- package/dist/core/transport/QUICTransport.d.ts +320 -0
- package/dist/core/transport/QUICTransport.d.ts.map +1 -0
- package/dist/core/transport/QUICTransport.js +711 -0
- package/dist/core/transport/QUICTransport.js.map +1 -0
- package/dist/core/transport/index.d.ts +40 -0
- package/dist/core/transport/index.d.ts.map +1 -0
- package/dist/core/transport/index.js +46 -0
- package/dist/core/transport/index.js.map +1 -0
- package/dist/core/transport/quic-loader.d.ts +123 -0
- package/dist/core/transport/quic-loader.d.ts.map +1 -0
- package/dist/core/transport/quic-loader.js +293 -0
- package/dist/core/transport/quic-loader.js.map +1 -0
- package/dist/core/transport/quic.d.ts +154 -0
- package/dist/core/transport/quic.d.ts.map +1 -0
- package/dist/core/transport/quic.js +214 -0
- package/dist/core/transport/quic.js.map +1 -0
- 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/mcp/services/AgentRegistry.d.ts.map +1 -1
- package/dist/mcp/services/AgentRegistry.js +4 -1
- package/dist/mcp/services/AgentRegistry.js.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/qx.d.ts +429 -0
- package/dist/types/qx.d.ts.map +1 -0
- package/dist/types/qx.js +71 -0
- package/dist/types/qx.js.map +1 -0
- package/dist/visualization/api/RestEndpoints.js +2 -2
- package/dist/visualization/api/RestEndpoints.js.map +1 -1
- package/dist/visualization/api/WebSocketServer.d.ts +44 -0
- package/dist/visualization/api/WebSocketServer.d.ts.map +1 -1
- package/dist/visualization/api/WebSocketServer.js +144 -23
- package/dist/visualization/api/WebSocketServer.js.map +1 -1
- package/dist/visualization/core/DataTransformer.d.ts +10 -0
- package/dist/visualization/core/DataTransformer.d.ts.map +1 -1
- package/dist/visualization/core/DataTransformer.js +60 -5
- package/dist/visualization/core/DataTransformer.js.map +1 -1
- package/dist/visualization/emit-event.d.ts +75 -0
- package/dist/visualization/emit-event.d.ts.map +1 -0
- package/dist/visualization/emit-event.js +213 -0
- package/dist/visualization/emit-event.js.map +1 -0
- package/dist/visualization/index.d.ts +1 -0
- package/dist/visualization/index.d.ts.map +1 -1
- package/dist/visualization/index.js +7 -1
- package/dist/visualization/index.js.map +1 -1
- package/docs/reference/skills.md +63 -1
- package/package.json +16 -58
|
@@ -1,529 +1,225 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: shift-left-testing
|
|
3
|
-
description: Move testing activities earlier
|
|
3
|
+
description: "Move testing activities earlier in the development lifecycle to catch defects when they're cheapest to fix. Use when implementing TDD, CI/CD, or early quality practices."
|
|
4
|
+
category: testing-methodologies
|
|
5
|
+
priority: high
|
|
6
|
+
tokenEstimate: 900
|
|
7
|
+
agents: [qe-test-generator, qe-requirements-validator, qe-regression-risk-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: [shift-left, early-testing, tdd, bdd, ci-cd, prevention]
|
|
4
14
|
---
|
|
5
15
|
|
|
6
16
|
# Shift-Left Testing
|
|
7
17
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
**Shift-Left:**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
18
|
+
<default_to_action>
|
|
19
|
+
When implementing early testing practices:
|
|
20
|
+
1. VALIDATE requirements before coding (testability, BDD scenarios)
|
|
21
|
+
2. WRITE tests before implementation (TDD red-green-refactor)
|
|
22
|
+
3. AUTOMATE in CI pipeline (every commit triggers tests)
|
|
23
|
+
4. FOLLOW test pyramid: Many unit (70%), some integration (20%), few E2E (10%)
|
|
24
|
+
5. FIX defects immediately - never let them accumulate
|
|
25
|
+
|
|
26
|
+
**Quick Shift-Left Levels:**
|
|
27
|
+
- Level 1: Unit tests with each PR (developer responsibility)
|
|
28
|
+
- Level 2: TDD practice (tests before code)
|
|
29
|
+
- Level 3: BDD/Example mapping in refinement (requirements testing)
|
|
30
|
+
- Level 4: Risk analysis in design (architecture testing)
|
|
31
|
+
|
|
32
|
+
**Critical Success Factors:**
|
|
33
|
+
- Defects found in requirements cost 1x; in production cost 100x
|
|
34
|
+
- Every commit must run automated tests
|
|
35
|
+
- Quality is built in, not tested in
|
|
36
|
+
</default_to_action>
|
|
37
|
+
|
|
38
|
+
## Quick Reference Card
|
|
39
|
+
|
|
40
|
+
### When to Use
|
|
41
|
+
- Reducing cost of defects
|
|
42
|
+
- Implementing CI/CD pipelines
|
|
43
|
+
- Starting TDD practice
|
|
44
|
+
- Improving requirements quality
|
|
45
|
+
|
|
46
|
+
### Cost of Defects by Phase
|
|
47
|
+
| Phase | Relative Cost | Example |
|
|
48
|
+
|-------|--------------|---------|
|
|
49
|
+
| Requirements | 1x | Fix doc: 30 min |
|
|
50
|
+
| Design | 5x | Redesign: few hours |
|
|
51
|
+
| Development | 10x | Code fix: 1 day |
|
|
52
|
+
| Testing | 20x | Fix + retest: 2 days |
|
|
53
|
+
| Production | 100x | Hotfix + rollback + investigation |
|
|
54
|
+
|
|
55
|
+
### Test Pyramid
|
|
56
|
+
```
|
|
57
|
+
/\ E2E (10%) - Critical user journeys
|
|
58
|
+
/ \
|
|
59
|
+
/ \ Integration (20%) - Component interactions
|
|
60
|
+
/ \
|
|
61
|
+
/________\ Unit (70%) - Fast, isolated, comprehensive
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Shift-Left Levels
|
|
65
|
+
| Level | Practice | When |
|
|
66
|
+
|-------|----------|------|
|
|
67
|
+
| 1 | Unit tests in PR | Before merge |
|
|
68
|
+
| 2 | TDD | Before implementation |
|
|
69
|
+
| 3 | BDD/Example Mapping | During refinement |
|
|
70
|
+
| 4 | Risk Analysis | During design |
|
|
48
71
|
|
|
49
72
|
---
|
|
50
73
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- Developers write unit tests
|
|
54
|
-
- TDD practices
|
|
55
|
-
- Automated unit tests in CI
|
|
56
|
-
- Test coverage metrics
|
|
57
|
-
|
|
58
|
-
**Cost of Bug:** $100-1,000 (10x cheaper)
|
|
59
|
-
|
|
60
|
-
```javascript
|
|
61
|
-
// Developer writes test BEFORE code (TDD)
|
|
62
|
-
test('calculateTotal sums line items', () => {
|
|
63
|
-
const items = [{ price: 10 }, { price: 20 }];
|
|
64
|
-
expect(calculateTotal(items)).toBe(30);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
// Then implements code
|
|
68
|
-
function calculateTotal(items) {
|
|
69
|
-
return items.reduce((sum, item) => sum + item.price, 0);
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**TDD Cycle (Red-Green-Refactor):**
|
|
74
|
-
1. **Red**: Write failing test
|
|
75
|
-
2. **Green**: Write minimal code to pass
|
|
76
|
-
3. **Refactor**: Improve code quality
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
### Level 3: Shift-Further-Left (Requirements)
|
|
81
|
-
|
|
82
|
-
- Testable acceptance criteria
|
|
83
|
-
- BDD with Gherkin scenarios
|
|
84
|
-
- Executable specifications
|
|
85
|
-
- Test cases from requirements
|
|
86
|
-
|
|
87
|
-
**Cost of Bug:** $10-100 (100x cheaper)
|
|
88
|
-
|
|
89
|
-
```gherkin
|
|
90
|
-
# Specification IS test
|
|
91
|
-
Feature: Shopping Cart
|
|
92
|
-
|
|
93
|
-
Scenario: Calculate total with tax
|
|
94
|
-
Given I have items worth $100
|
|
95
|
-
When I apply 10% tax
|
|
96
|
-
Then the total should be $110
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**BDD Benefits:**
|
|
100
|
-
- Business stakeholders write tests
|
|
101
|
-
- Living documentation
|
|
102
|
-
- Automated acceptance testing
|
|
103
|
-
- Shared understanding
|
|
104
|
-
|
|
105
|
-
**Tools:** Cucumber, SpecFlow, Behave
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
### Level 4: Shift-All-The-Way-Left (Design)
|
|
110
|
-
|
|
111
|
-
- Testability in architecture
|
|
112
|
-
- Design for testability
|
|
113
|
-
- API design reviewed for testing
|
|
114
|
-
- Security/performance considered early
|
|
115
|
-
|
|
116
|
-
**Cost of Bug:** $1-10 (1000x cheaper)
|
|
117
|
-
|
|
118
|
-
```typescript
|
|
119
|
-
// Design decision: Dependency injection for testability
|
|
120
|
-
class OrderService {
|
|
121
|
-
constructor(
|
|
122
|
-
private paymentGateway: PaymentGateway, // Injectable
|
|
123
|
-
private emailService: EmailService // Mockable
|
|
124
|
-
) {}
|
|
125
|
-
|
|
126
|
-
// Easy to test with mocks
|
|
127
|
-
async placeOrder(order: Order) {
|
|
128
|
-
await this.paymentGateway.charge(order.total);
|
|
129
|
-
await this.emailService.sendConfirmation(order);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Test with mocks (no real payment gateway needed)
|
|
134
|
-
test('places order successfully', async () => {
|
|
135
|
-
const mockPayment = { charge: jest.fn() };
|
|
136
|
-
const mockEmail = { sendConfirmation: jest.fn() };
|
|
137
|
-
|
|
138
|
-
const service = new OrderService(mockPayment, mockEmail);
|
|
139
|
-
await service.placeOrder({ total: 100 });
|
|
140
|
-
|
|
141
|
-
expect(mockPayment.charge).toHaveBeenCalledWith(100);
|
|
142
|
-
expect(mockEmail.sendConfirmation).toHaveBeenCalled();
|
|
143
|
-
});
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
**Design Patterns for Testability:**
|
|
147
|
-
- Dependency Injection
|
|
148
|
-
- Interface-based design
|
|
149
|
-
- Single Responsibility Principle
|
|
150
|
-
- Avoid global state
|
|
151
|
-
- Pure functions (no side effects)
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## Continuous Testing in CI/CD
|
|
156
|
-
|
|
157
|
-
### CI/CD Pipeline with Shift-Left Testing
|
|
158
|
-
|
|
159
|
-
**Goal:** Test at every stage, fail fast, high confidence
|
|
74
|
+
## Level 1: Tests in Every PR
|
|
160
75
|
|
|
161
76
|
```yaml
|
|
162
|
-
#
|
|
163
|
-
name:
|
|
164
|
-
|
|
77
|
+
# CI pipeline - tests run on every commit
|
|
78
|
+
name: CI
|
|
165
79
|
on: [push, pull_request]
|
|
166
|
-
|
|
167
80
|
jobs:
|
|
168
|
-
|
|
169
|
-
fast-feedback:
|
|
170
|
-
runs-on: ubuntu-latest
|
|
171
|
-
timeout-minutes: 5
|
|
172
|
-
steps:
|
|
173
|
-
- uses: actions/checkout@v3
|
|
174
|
-
|
|
175
|
-
# Static Analysis (30 seconds)
|
|
176
|
-
- name: Lint
|
|
177
|
-
run: npm run lint
|
|
178
|
-
|
|
179
|
-
- name: Type Check
|
|
180
|
-
run: npm run type-check
|
|
181
|
-
|
|
182
|
-
# Unit Tests (2 minutes)
|
|
183
|
-
- name: Unit Tests
|
|
184
|
-
run: npm run test:unit
|
|
185
|
-
|
|
186
|
-
- name: Coverage Check
|
|
187
|
-
run: npm run coverage -- --threshold 80
|
|
188
|
-
|
|
189
|
-
# Stage 2: Integration Tests (< 10 minutes)
|
|
190
|
-
integration-tests:
|
|
191
|
-
needs: fast-feedback
|
|
81
|
+
test:
|
|
192
82
|
runs-on: ubuntu-latest
|
|
193
|
-
timeout-minutes: 10
|
|
194
83
|
steps:
|
|
195
|
-
- uses: actions/checkout@
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
run: npm audit && npm run security:scan
|
|
204
|
-
|
|
205
|
-
# Stage 3: E2E Tests (< 15 minutes)
|
|
206
|
-
e2e-tests:
|
|
207
|
-
needs: integration-tests
|
|
208
|
-
runs-on: ubuntu-latest
|
|
209
|
-
timeout-minutes: 15
|
|
210
|
-
steps:
|
|
211
|
-
- uses: actions/checkout@v3
|
|
212
|
-
|
|
213
|
-
# E2E Tests (10 minutes)
|
|
214
|
-
- name: E2E Tests with Playwright
|
|
215
|
-
run: npm run test:e2e
|
|
216
|
-
|
|
217
|
-
# Performance Tests (5 minutes)
|
|
218
|
-
- name: Performance Tests
|
|
219
|
-
run: npm run test:performance
|
|
220
|
-
|
|
221
|
-
# Stage 4: Deploy to Staging
|
|
222
|
-
deploy-staging:
|
|
223
|
-
needs: e2e-tests
|
|
224
|
-
if: github.ref == 'refs/heads/main'
|
|
84
|
+
- uses: actions/checkout@v4
|
|
85
|
+
- run: npm ci
|
|
86
|
+
- run: npm run test:unit
|
|
87
|
+
- run: npm run test:integration
|
|
88
|
+
- run: npm run lint
|
|
89
|
+
|
|
90
|
+
quality-gate:
|
|
91
|
+
needs: test
|
|
225
92
|
steps:
|
|
226
|
-
- name:
|
|
227
|
-
run:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
- name: Smoke Tests
|
|
231
|
-
run: npm run test:smoke -- --env=staging
|
|
93
|
+
- name: Coverage Check
|
|
94
|
+
run: npx coverage-check --min 80
|
|
95
|
+
- name: No New Warnings
|
|
96
|
+
run: npm run lint -- --max-warnings 0
|
|
232
97
|
```
|
|
233
98
|
|
|
234
|
-
**Pipeline Best Practices:**
|
|
235
|
-
1. **Fail Fast**: Run fastest tests first (lint, unit)
|
|
236
|
-
2. **Parallel Execution**: Run independent tests concurrently
|
|
237
|
-
3. **Clear Feedback**: Immediate notification on failures
|
|
238
|
-
4. **Incremental Testing**: Only run affected tests when possible
|
|
239
|
-
5. **Quality Gates**: Block merges on test failures
|
|
240
|
-
|
|
241
99
|
---
|
|
242
100
|
|
|
243
|
-
##
|
|
244
|
-
|
|
245
|
-
```
|
|
246
|
-
/\
|
|
247
|
-
/E2E\ Few (slow, expensive, brittle)
|
|
248
|
-
/------\
|
|
249
|
-
/ Int. \ Some (moderate speed/cost)
|
|
250
|
-
/----------\
|
|
251
|
-
/ Unit \ Many (fast, cheap, reliable)
|
|
252
|
-
/--------------\
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
**Unit Tests (Base):**
|
|
256
|
-
- 70-80% of tests
|
|
257
|
-
- Milliseconds execution
|
|
258
|
-
- Test individual functions/classes
|
|
259
|
-
- High coverage, low cost
|
|
260
|
-
|
|
261
|
-
**Integration Tests (Middle):**
|
|
262
|
-
- 15-20% of tests
|
|
263
|
-
- Seconds execution
|
|
264
|
-
- Test component interactions
|
|
265
|
-
- Database, API, services
|
|
266
|
-
|
|
267
|
-
**E2E Tests (Top):**
|
|
268
|
-
- 5-10% of tests
|
|
269
|
-
- Minutes execution
|
|
270
|
-
- Test critical user journeys
|
|
271
|
-
- Full stack, realistic scenarios
|
|
272
|
-
|
|
273
|
-
**Shift-Left Impact:**
|
|
274
|
-
Most testing happens at UNIT level (early, cheap, fast).
|
|
101
|
+
## Level 2: TDD Practice
|
|
275
102
|
|
|
276
|
-
---
|
|
277
|
-
|
|
278
|
-
## Shift-Left Practices
|
|
279
|
-
|
|
280
|
-
### 1. Test-Driven Development (TDD)
|
|
281
|
-
|
|
282
|
-
**Process:**
|
|
283
103
|
```javascript
|
|
284
|
-
//
|
|
285
|
-
test('
|
|
286
|
-
|
|
287
|
-
expect(
|
|
104
|
+
// Red: Write failing test first
|
|
105
|
+
test('calculates discount for orders over $100', () => {
|
|
106
|
+
const order = new Order([{ price: 150 }]);
|
|
107
|
+
expect(order.discount).toBe(15); // 10% off
|
|
288
108
|
});
|
|
289
109
|
|
|
290
|
-
//
|
|
291
|
-
|
|
292
|
-
|
|
110
|
+
// Green: Minimal implementation
|
|
111
|
+
class Order {
|
|
112
|
+
get discount() {
|
|
113
|
+
return this.total > 100 ? this.total * 0.1 : 0;
|
|
114
|
+
}
|
|
293
115
|
}
|
|
294
116
|
|
|
295
|
-
//
|
|
296
|
-
function isValidEmail(email) {
|
|
297
|
-
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
298
|
-
return regex.test(email);
|
|
299
|
-
}
|
|
117
|
+
// Refactor: Improve while keeping green
|
|
300
118
|
```
|
|
301
119
|
|
|
302
|
-
**Benefits:**
|
|
303
|
-
- Better design (testable by default)
|
|
304
|
-
- Complete test coverage
|
|
305
|
-
- Confident refactoring
|
|
306
|
-
- Living documentation
|
|
307
|
-
|
|
308
120
|
---
|
|
309
121
|
|
|
310
|
-
|
|
122
|
+
## Level 3: BDD in Refinement
|
|
311
123
|
|
|
312
|
-
**Process:**
|
|
313
124
|
```gherkin
|
|
314
|
-
#
|
|
315
|
-
Feature:
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
And I click "Sign Up"
|
|
322
|
-
Then I should see "Welcome"
|
|
323
|
-
And I should receive a confirmation email
|
|
324
|
-
```
|
|
125
|
+
# Example mapping before coding
|
|
126
|
+
Feature: Loyalty Discount
|
|
127
|
+
Scenario: Gold member gets 15% discount
|
|
128
|
+
Given a customer with "gold" membership
|
|
129
|
+
When they checkout with $200 in cart
|
|
130
|
+
Then discount applied is $30
|
|
131
|
+
And order total is $170
|
|
325
132
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
await page.goto('/register');
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
When('I enter valid email {string}', async (email: string) => {
|
|
334
|
-
await page.fill('[data-test=email]', email);
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
// ... more step definitions
|
|
133
|
+
Scenario: New customer gets no discount
|
|
134
|
+
Given a customer with no membership
|
|
135
|
+
When they checkout with $200 in cart
|
|
136
|
+
Then no discount is applied
|
|
338
137
|
```
|
|
339
138
|
|
|
340
|
-
**Benefits:**
|
|
341
|
-
- Shared language (business + dev)
|
|
342
|
-
- Testable requirements
|
|
343
|
-
- Automated acceptance tests
|
|
344
|
-
- Reduced misunderstandings
|
|
345
|
-
|
|
346
139
|
---
|
|
347
140
|
|
|
348
|
-
|
|
141
|
+
## Level 4: Risk Analysis in Design
|
|
349
142
|
|
|
350
|
-
**Principles:**
|
|
351
|
-
|
|
352
|
-
**a) Dependency Injection**
|
|
353
143
|
```typescript
|
|
354
|
-
//
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
constructor(private db: Database) {}
|
|
144
|
+
// During architecture review
|
|
145
|
+
await Task("Risk Analysis", {
|
|
146
|
+
phase: 'design',
|
|
147
|
+
component: 'payment-service',
|
|
148
|
+
questions: [
|
|
149
|
+
'What happens when payment gateway times out?',
|
|
150
|
+
'How do we handle duplicate submissions?',
|
|
151
|
+
'What if inventory changed during checkout?'
|
|
152
|
+
]
|
|
153
|
+
}, "qe-requirements-validator");
|
|
365
154
|
|
|
366
|
-
|
|
367
|
-
return this.db.insert('users', data);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Test with mock
|
|
372
|
-
const mockDb = { insert: jest.fn() };
|
|
373
|
-
const service = new UserService(mockDb);
|
|
155
|
+
// Output: Testability requirements, failure mode tests
|
|
374
156
|
```
|
|
375
157
|
|
|
376
|
-
|
|
377
|
-
```typescript
|
|
378
|
-
// ❌ Hard to test (side effects, global state)
|
|
379
|
-
let total = 0;
|
|
380
|
-
function addToTotal(amount) {
|
|
381
|
-
total += amount; // Modifies global state
|
|
382
|
-
return total;
|
|
383
|
-
}
|
|
158
|
+
---
|
|
384
159
|
|
|
385
|
-
|
|
386
|
-
function calculateTotal(current, amount) {
|
|
387
|
-
return current + amount;
|
|
388
|
-
}
|
|
160
|
+
## Agent-Assisted Shift-Left
|
|
389
161
|
|
|
390
|
-
test('adds amounts correctly', () => {
|
|
391
|
-
expect(calculateTotal(100, 50)).toBe(150);
|
|
392
|
-
expect(calculateTotal(0, 10)).toBe(10);
|
|
393
|
-
});
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
**c) Single Responsibility**
|
|
397
162
|
```typescript
|
|
398
|
-
//
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
class EmailService {
|
|
419
|
-
sendConfirmation(order) { /* ... */ }
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// Each class has one reason to change, one thing to test
|
|
163
|
+
// Validate requirements testability
|
|
164
|
+
await Task("Requirements Validation", {
|
|
165
|
+
requirements: userStories,
|
|
166
|
+
check: ['INVEST-criteria', 'testability', 'ambiguity'],
|
|
167
|
+
generateBDD: true
|
|
168
|
+
}, "qe-requirements-validator");
|
|
169
|
+
|
|
170
|
+
// Generate tests from requirements
|
|
171
|
+
await Task("Generate Tests", {
|
|
172
|
+
source: 'requirements',
|
|
173
|
+
types: ['unit', 'integration', 'e2e'],
|
|
174
|
+
coverage: 'comprehensive'
|
|
175
|
+
}, "qe-test-generator");
|
|
176
|
+
|
|
177
|
+
// Smart test selection for changes
|
|
178
|
+
await Task("Select Regression Tests", {
|
|
179
|
+
changedFiles: prFiles,
|
|
180
|
+
algorithm: 'risk-based',
|
|
181
|
+
targetReduction: 0.7 // 70% time savings
|
|
182
|
+
}, "qe-regression-risk-analyzer");
|
|
423
183
|
```
|
|
424
184
|
|
|
425
185
|
---
|
|
426
186
|
|
|
427
|
-
##
|
|
428
|
-
|
|
429
|
-
**Track Effectiveness:**
|
|
430
|
-
|
|
431
|
-
**1. Defect Detection Percentage (DDP)**
|
|
432
|
-
```
|
|
433
|
-
DDP = (Defects found in phase / Total defects) × 100
|
|
434
|
-
|
|
435
|
-
Target: 80%+ defects found before production
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
**2. Test Coverage**
|
|
439
|
-
```
|
|
440
|
-
Coverage = (Lines covered / Total lines) × 100
|
|
441
|
-
|
|
442
|
-
Target: 80%+ for unit tests
|
|
443
|
-
```
|
|
187
|
+
## Agent Coordination Hints
|
|
444
188
|
|
|
445
|
-
|
|
189
|
+
### Memory Namespace
|
|
446
190
|
```
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
191
|
+
aqe/shift-left/
|
|
192
|
+
├── requirements/* - Validated requirements
|
|
193
|
+
├── generated-tests/* - Auto-generated tests
|
|
194
|
+
├── coverage-targets/* - Coverage goals by component
|
|
195
|
+
└── pipeline-results/* - CI/CD test history
|
|
452
196
|
```
|
|
453
197
|
|
|
454
|
-
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
-
|
|
460
|
-
-
|
|
198
|
+
### Fleet Coordination
|
|
199
|
+
```typescript
|
|
200
|
+
const shiftLeftFleet = await FleetManager.coordinate({
|
|
201
|
+
strategy: 'shift-left',
|
|
202
|
+
agents: [
|
|
203
|
+
'qe-requirements-validator', // Level 3-4
|
|
204
|
+
'qe-test-generator', // Level 2
|
|
205
|
+
'qe-regression-risk-analyzer' // Smart selection
|
|
206
|
+
],
|
|
207
|
+
topology: 'sequential'
|
|
208
|
+
});
|
|
461
209
|
```
|
|
462
210
|
|
|
463
211
|
---
|
|
464
212
|
|
|
465
|
-
## Tools for Shift-Left Testing
|
|
466
|
-
|
|
467
|
-
**Unit Testing:**
|
|
468
|
-
- Jest, Mocha, Vitest (JavaScript)
|
|
469
|
-
- JUnit, TestNG (Java)
|
|
470
|
-
- pytest (Python)
|
|
471
|
-
- RSpec (Ruby)
|
|
472
|
-
|
|
473
|
-
**BDD Frameworks:**
|
|
474
|
-
- Cucumber, SpecFlow (Gherkin)
|
|
475
|
-
- Behave (Python)
|
|
476
|
-
- Jasmine (JavaScript)
|
|
477
|
-
|
|
478
|
-
**CI/CD Platforms:**
|
|
479
|
-
- GitHub Actions
|
|
480
|
-
- GitLab CI
|
|
481
|
-
- Jenkins
|
|
482
|
-
- CircleCI
|
|
483
|
-
- Travis CI
|
|
484
|
-
|
|
485
|
-
**Code Quality:**
|
|
486
|
-
- ESLint, SonarQube
|
|
487
|
-
- Code coverage (Jest, Istanbul, c8)
|
|
488
|
-
- Static analysis (TypeScript, Flow)
|
|
489
|
-
|
|
490
|
-
---
|
|
491
|
-
|
|
492
213
|
## Related Skills
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
- [
|
|
496
|
-
- [
|
|
497
|
-
- [regression-testing](../regression-testing/)
|
|
498
|
-
|
|
499
|
-
**DevOps:**
|
|
500
|
-
- [shift-right-testing](../shift-right-testing/) - Testing IN production
|
|
501
|
-
- [test-design-techniques](../test-design-techniques/)
|
|
502
|
-
- [mutation-testing](../mutation-testing/)
|
|
503
|
-
|
|
504
|
-
**Complementary:**
|
|
505
|
-
- [shift-right-testing](../shift-right-testing/) - Production validation (the other half)
|
|
214
|
+
- [tdd-london-chicago](../tdd-london-chicago/) - TDD practices
|
|
215
|
+
- [holistic-testing-pact](../holistic-testing-pact/) - Proactive testing
|
|
216
|
+
- [cicd-pipeline-qe-orchestrator](../cicd-pipeline-qe-orchestrator/) - Pipeline integration
|
|
217
|
+
- [shift-right-testing](../shift-right-testing/) - Production feedback
|
|
506
218
|
|
|
507
219
|
---
|
|
508
220
|
|
|
509
221
|
## Remember
|
|
510
222
|
|
|
511
|
-
**
|
|
512
|
-
|
|
513
|
-
**Cost by Phase:**
|
|
514
|
-
- Design/Requirements: $1-10
|
|
515
|
-
- Development (unit tests): $100-1,000
|
|
516
|
-
- QA/Integration: $1,000-10,000
|
|
517
|
-
- Production: $10,000-100,000+
|
|
518
|
-
|
|
519
|
-
**Shift-Left = 10x-100x cost reduction**
|
|
520
|
-
|
|
521
|
-
**Best Practices:**
|
|
522
|
-
1. Write tests BEFORE code (TDD)
|
|
523
|
-
2. Make requirements testable (BDD)
|
|
524
|
-
3. Design for testability (DI, pure functions)
|
|
525
|
-
4. Automate everything (CI/CD)
|
|
526
|
-
5. Fail fast (run fastest tests first)
|
|
527
|
-
6. Test pyramid (many unit, few E2E)
|
|
223
|
+
**Earlier = Cheaper.** Requirements defects cost 1x; production defects cost 100x. Test pyramid: 70% unit, 20% integration, 10% E2E. Every commit runs tests. TDD builds quality in.
|
|
528
224
|
|
|
529
|
-
**With Agents:**
|
|
225
|
+
**With Agents:** Agents validate requirements testability, generate tests from specs, and select optimal regression suites. Use agents to implement shift-left practices consistently.
|