agentic-qe 3.8.2 → 3.8.3
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/skills/README.md +29 -7
- package/.claude/skills/TRUST-TIERS.md +26 -10
- package/.claude/skills/a11y-ally/SKILL.md +10 -1
- package/.claude/skills/accessibility-testing/SKILL.md +2 -0
- package/.claude/skills/agentic-quality-engineering/SKILL.md +1 -1
- package/.claude/skills/api-testing-patterns/SKILL.md +8 -0
- package/.claude/skills/api-testing-patterns/config.json +14 -0
- package/.claude/skills/api-testing-patterns/templates/api-test-scaffold.md +87 -0
- package/.claude/skills/bug-reporting-excellence/SKILL.md +14 -0
- package/.claude/skills/code-review-quality/SKILL.md +14 -0
- package/.claude/skills/compatibility-testing/SKILL.md +1 -54
- package/.claude/skills/compliance-testing/SKILL.md +8 -0
- package/.claude/skills/compliance-testing/config.json +13 -0
- package/.claude/skills/consultancy-practices/SKILL.md +1 -32
- package/.claude/skills/context-driven-testing/SKILL.md +0 -41
- package/.claude/skills/contract-testing/SKILL.md +12 -0
- package/.claude/skills/contract-testing/config.json +13 -0
- package/.claude/skills/contract-testing/references/agent-commands.md +103 -0
- package/.claude/skills/contract-testing/references/provider-states.md +45 -0
- package/.claude/skills/coverage-drop-investigator/SKILL.md +90 -0
- package/.claude/skills/coverage-guard/SKILL.md +82 -0
- package/.claude/skills/coverage-guard/scripts/check-coverage.sh +42 -0
- package/.claude/skills/database-testing/SKILL.md +0 -10
- package/.claude/skills/debug-loop/SKILL.md +1 -1
- package/.claude/skills/e2e-flow-verifier/SKILL.md +78 -0
- package/.claude/skills/enterprise-integration-testing/SKILL.md +1 -1
- package/.claude/skills/exploratory-testing-advanced/SKILL.md +8 -0
- package/.claude/skills/exploratory-testing-advanced/references/heuristic-cheatsheet.md +48 -0
- package/.claude/skills/freeze-tests/SKILL.md +67 -0
- package/.claude/skills/freeze-tests/scripts/block-test-edits.sh +27 -0
- package/.claude/skills/localization-testing/SKILL.md +0 -17
- package/.claude/skills/mobile-testing/SKILL.md +2 -49
- package/.claude/skills/mutation-testing/SKILL.md +26 -0
- package/.claude/skills/mutation-testing/config.json +14 -0
- package/.claude/skills/mutation-testing/references/mutation-operators.md +38 -0
- package/.claude/skills/mutation-testing/run-history.json +6 -0
- package/.claude/skills/no-skip/SKILL.md +74 -0
- package/.claude/skills/no-skip/scripts/check-skips.sh +28 -0
- package/.claude/skills/pair-programming/SKILL.md +1 -1
- package/.claude/skills/pentest-validation/SKILL.md +2 -3
- package/.claude/skills/performance-testing/SKILL.md +21 -0
- package/.claude/skills/performance-testing/config.json +18 -0
- package/.claude/skills/performance-testing/references/k6-patterns.md +72 -0
- package/.claude/skills/performance-testing/run-history.json +6 -0
- package/.claude/skills/pr-review/SKILL.md +3 -3
- package/.claude/skills/qcsd-cicd-swarm/SKILL.md +1 -1
- package/.claude/skills/qcsd-development-swarm/SKILL.md +1 -1
- package/.claude/skills/qcsd-ideation-swarm/SKILL.md +1 -1
- package/.claude/skills/qcsd-production-swarm/SKILL.md +1 -1
- package/.claude/skills/qcsd-refinement-swarm/SKILL.md +1 -1
- package/.claude/skills/qe-chaos-resilience/SKILL.md +2 -2
- package/.claude/skills/qe-code-intelligence/SKILL.md +9 -1
- package/.claude/skills/qe-coverage-analysis/SKILL.md +28 -1
- package/.claude/skills/qe-coverage-analysis/run-history.json +6 -0
- package/.claude/skills/qe-defect-intelligence/SKILL.md +1 -1
- package/.claude/skills/qe-learning-optimization/SKILL.md +1 -1
- package/.claude/skills/qe-quality-assessment/SKILL.md +29 -2
- package/.claude/skills/qe-quality-assessment/run-history.json +6 -0
- package/.claude/skills/qe-requirements-validation/SKILL.md +1 -1
- package/.claude/skills/qe-test-execution/SKILL.md +9 -1
- package/.claude/skills/qe-test-generation/SKILL.md +15 -1
- package/.claude/skills/qe-test-generation/config.json +14 -0
- package/.claude/skills/qe-test-generation/templates/test-scaffold-jest.md +72 -0
- package/.claude/skills/qe-visual-accessibility/SKILL.md +1 -1
- package/.claude/skills/quality-metrics/SKILL.md +3 -77
- package/.claude/skills/regression-testing/SKILL.md +13 -48
- package/.claude/skills/risk-based-testing/SKILL.md +6 -51
- package/.claude/skills/security-testing/SKILL.md +30 -0
- package/.claude/skills/security-testing/config.json +13 -0
- package/.claude/skills/security-testing/references/compliance-agent-commands.md +131 -0
- package/.claude/skills/security-testing/references/owasp-top-10.md +66 -0
- package/.claude/skills/security-testing/run-history.json +6 -0
- package/.claude/skills/security-testing/templates/security-report.md +44 -0
- package/.claude/skills/security-watch/SKILL.md +93 -0
- package/.claude/skills/security-watch/scripts/scan-security.sh +46 -0
- package/.claude/skills/shift-left-testing/SKILL.md +16 -87
- package/.claude/skills/skill-stats/SKILL.md +79 -0
- package/.claude/skills/skills-manifest.json +1 -1
- package/.claude/skills/strict-tdd/SKILL.md +72 -0
- package/.claude/skills/strict-tdd/scripts/enforce-red-phase.sh +36 -0
- package/.claude/skills/tdd-london-chicago/SKILL.md +8 -0
- package/.claude/skills/test-automation-strategy/SKILL.md +13 -64
- package/.claude/skills/test-data-management/SKILL.md +1 -104
- package/.claude/skills/test-design-techniques/SKILL.md +2 -151
- package/.claude/skills/test-environment-management/SKILL.md +0 -47
- package/.claude/skills/test-failure-investigator/SKILL.md +99 -0
- package/.claude/skills/test-metrics-dashboard/SKILL.md +97 -0
- package/.claude/skills/trust-tier-manifest.json +135 -61
- package/.claude/skills/validation-pipeline/SKILL.md +1 -1
- package/.claude/skills/verification-quality/SKILL.md +15 -1
- package/.claude/skills/xp-practices/SKILL.md +2 -109
- package/CHANGELOG.md +29 -0
- package/README.md +5 -1
- package/assets/skills/README.md +173 -0
- package/assets/skills/TRUST-TIERS.md +174 -0
- package/assets/skills/a11y-ally/SKILL.md +10 -1
- package/assets/skills/accessibility-testing/SKILL.md +2 -0
- package/assets/skills/agentic-quality-engineering/SKILL.md +1 -1
- package/assets/skills/api-testing-patterns/SKILL.md +8 -0
- package/assets/skills/api-testing-patterns/config.json +14 -0
- package/assets/skills/api-testing-patterns/templates/api-test-scaffold.md +87 -0
- package/assets/skills/bug-reporting-excellence/SKILL.md +14 -0
- package/assets/skills/code-review-quality/SKILL.md +14 -0
- package/assets/skills/compatibility-testing/SKILL.md +1 -54
- package/assets/skills/compliance-testing/SKILL.md +8 -0
- package/assets/skills/compliance-testing/config.json +13 -0
- package/assets/skills/consultancy-practices/SKILL.md +1 -32
- package/assets/skills/context-driven-testing/SKILL.md +0 -41
- package/assets/skills/contract-testing/SKILL.md +12 -0
- package/assets/skills/contract-testing/config.json +13 -0
- package/assets/skills/contract-testing/references/agent-commands.md +103 -0
- package/assets/skills/contract-testing/references/provider-states.md +45 -0
- package/assets/skills/coverage-drop-investigator/SKILL.md +90 -0
- package/assets/skills/coverage-guard/SKILL.md +82 -0
- package/assets/skills/coverage-guard/scripts/check-coverage.sh +42 -0
- package/assets/skills/database-testing/SKILL.md +0 -10
- package/assets/skills/debug-loop/SKILL.md +1 -1
- package/assets/skills/e2e-flow-verifier/SKILL.md +78 -0
- package/assets/skills/enterprise-integration-testing/SKILL.md +1 -1
- package/assets/skills/exploratory-testing-advanced/SKILL.md +8 -0
- package/assets/skills/exploratory-testing-advanced/references/heuristic-cheatsheet.md +48 -0
- package/assets/skills/freeze-tests/SKILL.md +67 -0
- package/assets/skills/freeze-tests/scripts/block-test-edits.sh +27 -0
- package/assets/skills/localization-testing/SKILL.md +0 -17
- package/assets/skills/mobile-testing/SKILL.md +2 -49
- package/assets/skills/mutation-testing/SKILL.md +26 -0
- package/assets/skills/mutation-testing/config.json +14 -0
- package/assets/skills/mutation-testing/references/mutation-operators.md +38 -0
- package/assets/skills/mutation-testing/run-history.json +6 -0
- package/assets/skills/no-skip/SKILL.md +74 -0
- package/assets/skills/no-skip/scripts/check-skips.sh +28 -0
- package/assets/skills/pair-programming/SKILL.md +1 -1
- package/assets/skills/pentest-validation/SKILL.md +2 -3
- package/assets/skills/performance-testing/SKILL.md +21 -0
- package/assets/skills/performance-testing/config.json +18 -0
- package/assets/skills/performance-testing/references/k6-patterns.md +72 -0
- package/assets/skills/performance-testing/run-history.json +6 -0
- package/assets/skills/pr-review/SKILL.md +3 -3
- package/assets/skills/qcsd-cicd-swarm/SKILL.md +1 -1
- package/assets/skills/qcsd-development-swarm/SKILL.md +1 -1
- package/assets/skills/qcsd-ideation-swarm/SKILL.md +1 -1
- package/assets/skills/qcsd-production-swarm/SKILL.md +1 -1
- package/assets/skills/qcsd-refinement-swarm/SKILL.md +1 -1
- package/assets/skills/qe-chaos-resilience/SKILL.md +2 -2
- package/assets/skills/qe-code-intelligence/SKILL.md +9 -1
- package/assets/skills/qe-coverage-analysis/SKILL.md +28 -1
- package/assets/skills/qe-coverage-analysis/run-history.json +6 -0
- package/assets/skills/qe-defect-intelligence/SKILL.md +1 -1
- package/assets/skills/qe-learning-optimization/SKILL.md +1 -1
- package/assets/skills/qe-quality-assessment/SKILL.md +29 -2
- package/assets/skills/qe-quality-assessment/run-history.json +6 -0
- package/assets/skills/qe-requirements-validation/SKILL.md +1 -1
- package/assets/skills/qe-test-execution/SKILL.md +9 -1
- package/assets/skills/qe-test-generation/SKILL.md +15 -1
- package/assets/skills/qe-test-generation/config.json +14 -0
- package/assets/skills/qe-test-generation/templates/test-scaffold-jest.md +72 -0
- package/assets/skills/qe-visual-accessibility/SKILL.md +1 -1
- package/assets/skills/quality-metrics/SKILL.md +3 -77
- package/assets/skills/regression-testing/SKILL.md +13 -48
- package/assets/skills/risk-based-testing/SKILL.md +6 -51
- package/assets/skills/security-testing/SKILL.md +30 -0
- package/assets/skills/security-testing/config.json +13 -0
- package/assets/skills/security-testing/references/compliance-agent-commands.md +131 -0
- package/assets/skills/security-testing/references/owasp-top-10.md +66 -0
- package/assets/skills/security-testing/run-history.json +6 -0
- package/assets/skills/security-testing/templates/security-report.md +44 -0
- package/assets/skills/security-watch/SKILL.md +93 -0
- package/assets/skills/security-watch/scripts/scan-security.sh +46 -0
- package/assets/skills/shift-left-testing/SKILL.md +16 -87
- package/assets/skills/skill-stats/SKILL.md +79 -0
- package/assets/skills/strict-tdd/SKILL.md +72 -0
- package/assets/skills/strict-tdd/scripts/enforce-red-phase.sh +36 -0
- package/assets/skills/tdd-london-chicago/SKILL.md +8 -0
- package/assets/skills/test-automation-strategy/SKILL.md +13 -64
- package/assets/skills/test-data-management/SKILL.md +1 -104
- package/assets/skills/test-design-techniques/SKILL.md +2 -151
- package/assets/skills/test-environment-management/SKILL.md +0 -47
- package/assets/skills/test-failure-investigator/SKILL.md +99 -0
- package/assets/skills/test-metrics-dashboard/SKILL.md +97 -0
- package/assets/skills/trust-tier-manifest.json +135 -61
- package/assets/skills/validation-pipeline/SKILL.md +1 -1
- package/assets/skills/verification-quality/SKILL.md +15 -1
- package/assets/skills/xp-practices/SKILL.md +2 -109
- package/dist/cli/bundle.js +110 -24
- package/dist/init/opencode-installer.js +2 -3
- package/dist/init/phases/07-hooks.js +3 -3
- package/dist/init/settings-merge.js +1 -2
- package/dist/init/skills-installer.d.ts +10 -0
- package/dist/init/skills-installer.js +68 -6
- package/dist/integrations/ruvector/sona-persistence.d.ts +6 -0
- package/dist/integrations/ruvector/sona-persistence.js +26 -1
- package/dist/mcp/bundle.js +29 -8
- package/dist/mcp/entry.js +6 -6
- package/dist/migration/agent-compat.js +2 -2
- package/package.json +2 -2
- package/.claude/skills/aqe-v2-v3-migration/schemas/output.json +0 -513
- package/.claude/skills/aqe-v2-v3-migration/skill.md +0 -325
- package/.claude/skills/qe-contract-testing/SKILL.md +0 -223
- package/.claude/skills/qe-contract-testing/evals/qe-contract-testing.yaml +0 -513
- package/.claude/skills/qe-contract-testing/schemas/output.json +0 -295
- package/.claude/skills/qe-contract-testing/scripts/validate-config.json +0 -42
- package/.claude/skills/qe-security-compliance/SKILL.md +0 -260
- package/.claude/skills/qe-security-compliance/evals/qe-security-compliance.yaml +0 -595
- package/.claude/skills/qe-security-compliance/schemas/output.json +0 -498
- package/.claude/skills/qe-security-compliance/scripts/validate-config.json +0 -41
- package/.opencode/skills/qe-contract-testing.yaml +0 -45
- package/.opencode/skills/qe-security-compliance.yaml +0 -45
- package/assets/skills/aqe-v2-v3-migration/schemas/output.json +0 -513
- package/assets/skills/aqe-v2-v3-migration/skill.md +0 -325
- package/assets/skills/qe-contract-testing/SKILL.md +0 -223
- package/assets/skills/qe-contract-testing/evals/qe-contract-testing.yaml +0 -513
- package/assets/skills/qe-contract-testing/schemas/output.json +0 -295
- package/assets/skills/qe-contract-testing/scripts/validate-config.json +0 -42
- package/assets/skills/qe-security-compliance/SKILL.md +0 -260
- package/assets/skills/qe-security-compliance/evals/qe-security-compliance.yaml +0 -595
- package/assets/skills/qe-security-compliance/schemas/output.json +0 -498
- package/assets/skills/qe-security-compliance/scripts/validate-config.json +0 -41
|
@@ -22,23 +22,16 @@ validation:
|
|
|
22
22
|
|
|
23
23
|
<default_to_action>
|
|
24
24
|
When designing or improving test automation:
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3.
|
|
28
|
-
4.
|
|
29
|
-
5. MANAGE flaky tests: Quarantine, fix, or delete - never ignore
|
|
25
|
+
1. DETECT anti-patterns: Ice cream cone? Slow suite? Flaky tests?
|
|
26
|
+
2. USE patterns: Page Object Model, Builder pattern, Factory pattern
|
|
27
|
+
3. INTEGRATE in CI/CD: Every commit runs tests, fail fast
|
|
28
|
+
4. MANAGE flaky tests: Quarantine, fix, or delete - never ignore
|
|
30
29
|
|
|
31
30
|
**Quick Anti-Pattern Detection:**
|
|
32
31
|
- Ice cream cone (many E2E, few unit) → Invert to pyramid
|
|
33
32
|
- Slow tests (> 10 min suite) → Parallelize, mock external deps
|
|
34
33
|
- Flaky tests → Fix timing, isolate data, or quarantine
|
|
35
|
-
- Test duplication → Share fixtures, use page objects
|
|
36
34
|
- Brittle selectors → Use data-testid, semantic locators
|
|
37
|
-
|
|
38
|
-
**Critical Success Factors:**
|
|
39
|
-
- Fast feedback is the goal (< 10 min full suite)
|
|
40
|
-
- Automation supports testing, doesn't replace judgment
|
|
41
|
-
- Invest in test infrastructure like production code
|
|
42
35
|
</default_to_action>
|
|
43
36
|
|
|
44
37
|
## Quick Reference Card
|
|
@@ -49,23 +42,7 @@ When designing or improving test automation:
|
|
|
49
42
|
- Reducing flaky test burden
|
|
50
43
|
- Optimizing CI/CD pipeline speed
|
|
51
44
|
|
|
52
|
-
###
|
|
53
|
-
| Layer | % | Speed | Isolation | Examples |
|
|
54
|
-
|-------|---|-------|-----------|----------|
|
|
55
|
-
| **Unit** | 70% | < 1ms | Complete | Pure functions, logic |
|
|
56
|
-
| **Integration** | 20% | < 1s | Partial | API, database |
|
|
57
|
-
| **E2E** | 10% | < 30s | None | User journeys |
|
|
58
|
-
|
|
59
|
-
### F.I.R.S.T. Principles
|
|
60
|
-
| Principle | Meaning | How |
|
|
61
|
-
|-----------|---------|-----|
|
|
62
|
-
| **F**ast | Quick execution | Mock external deps |
|
|
63
|
-
| **I**solated | No shared state | Fresh fixtures per test |
|
|
64
|
-
| **R**epeatable | Same result every time | No random data |
|
|
65
|
-
| **S**elf-validating | Clear pass/fail | Assert, don't print |
|
|
66
|
-
| **T**imely | Written with code | TDD, not after |
|
|
67
|
-
|
|
68
|
-
### Anti-Patterns
|
|
45
|
+
### Anti-Patterns to Detect
|
|
69
46
|
| Problem | Symptom | Fix |
|
|
70
47
|
|---------|---------|-----|
|
|
71
48
|
| Ice cream cone | 80% E2E, 10% unit | Invert pyramid |
|
|
@@ -76,40 +53,6 @@ When designing or improving test automation:
|
|
|
76
53
|
|
|
77
54
|
---
|
|
78
55
|
|
|
79
|
-
## Page Object Model
|
|
80
|
-
|
|
81
|
-
```javascript
|
|
82
|
-
// pages/LoginPage.js
|
|
83
|
-
class LoginPage {
|
|
84
|
-
constructor(page) {
|
|
85
|
-
this.page = page;
|
|
86
|
-
this.emailInput = '[data-testid="email"]';
|
|
87
|
-
this.passwordInput = '[data-testid="password"]';
|
|
88
|
-
this.submitButton = '[data-testid="submit"]';
|
|
89
|
-
this.errorMessage = '[data-testid="error"]';
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async login(email, password) {
|
|
93
|
-
await this.page.fill(this.emailInput, email);
|
|
94
|
-
await this.page.fill(this.passwordInput, password);
|
|
95
|
-
await this.page.click(this.submitButton);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
async getError() {
|
|
99
|
-
return this.page.textContent(this.errorMessage);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Test uses page object
|
|
104
|
-
test('shows error for invalid credentials', async ({ page }) => {
|
|
105
|
-
const loginPage = new LoginPage(page);
|
|
106
|
-
await loginPage.login('bad@email.com', 'wrong');
|
|
107
|
-
expect(await loginPage.getError()).toBe('Invalid credentials');
|
|
108
|
-
});
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
56
|
## CI/CD Integration
|
|
114
57
|
|
|
115
58
|
```yaml
|
|
@@ -230,6 +173,12 @@ const automationFleet = await FleetManager.coordinate({
|
|
|
230
173
|
|
|
231
174
|
## Remember
|
|
232
175
|
|
|
233
|
-
**Pyramid: 70% unit, 20% integration, 10% E2E.** F.I.R.S.T. principles for every test. Page Object Model for E2E. Parallelize for speed. Quarantine flaky tests - never ignore them. Treat test code like production code.
|
|
234
|
-
|
|
235
176
|
**With Agents:** Agents generate pyramid-compliant tests, detect flaky patterns, optimize execution time, and maintain test infrastructure. Use agents to scale automation quality.
|
|
177
|
+
|
|
178
|
+
## Gotchas
|
|
179
|
+
|
|
180
|
+
- Agent generates 80% E2E tests and 20% unit tests (inverted pyramid) — explicitly enforce 70/20/10 ratio
|
|
181
|
+
- Page Object Model tests become brittle when selectors change — prefer data-testid attributes over CSS selectors
|
|
182
|
+
- Flaky tests quarantined but never fixed is technical debt — set a 2-week SLA to fix or delete
|
|
183
|
+
- Agent treats test code as second-class — test code needs the same review standards as production code
|
|
184
|
+
- Parallel test execution requires test isolation — shared state between tests causes non-deterministic failures
|
|
@@ -55,84 +55,6 @@ When creating or managing test data:
|
|
|
55
55
|
| **Volume** | Performance | 10k+ records |
|
|
56
56
|
| **Edge cases** | Boundary testing | Targeted |
|
|
57
57
|
|
|
58
|
-
### Privacy Techniques
|
|
59
|
-
| Technique | Use Case |
|
|
60
|
-
|-----------|----------|
|
|
61
|
-
| **Synthetic** | Generate fake data (preferred) |
|
|
62
|
-
| **Masking** | j***@example.com |
|
|
63
|
-
| **Hashing** | Irreversible pseudonymization |
|
|
64
|
-
| **Tokenization** | Reversible with key |
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Synthetic Data Generation
|
|
69
|
-
|
|
70
|
-
```javascript
|
|
71
|
-
import { faker } from '@faker-js/faker';
|
|
72
|
-
|
|
73
|
-
// Seed for reproducibility
|
|
74
|
-
faker.seed(123);
|
|
75
|
-
|
|
76
|
-
function generateUser() {
|
|
77
|
-
return {
|
|
78
|
-
id: faker.string.uuid(),
|
|
79
|
-
email: faker.internet.email(),
|
|
80
|
-
firstName: faker.person.firstName(),
|
|
81
|
-
lastName: faker.person.lastName(),
|
|
82
|
-
phone: faker.phone.number(),
|
|
83
|
-
address: {
|
|
84
|
-
street: faker.location.streetAddress(),
|
|
85
|
-
city: faker.location.city(),
|
|
86
|
-
zip: faker.location.zipCode()
|
|
87
|
-
},
|
|
88
|
-
createdAt: faker.date.past()
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Generate 1000 users
|
|
93
|
-
const users = Array.from({ length: 1000 }, generateUser);
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Test Data Builder Pattern
|
|
99
|
-
|
|
100
|
-
```typescript
|
|
101
|
-
class UserBuilder {
|
|
102
|
-
private user: Partial<User> = {};
|
|
103
|
-
|
|
104
|
-
asAdmin() {
|
|
105
|
-
this.user.role = 'admin';
|
|
106
|
-
this.user.permissions = ['read', 'write', 'delete'];
|
|
107
|
-
return this;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
asCustomer() {
|
|
111
|
-
this.user.role = 'customer';
|
|
112
|
-
this.user.permissions = ['read'];
|
|
113
|
-
return this;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
withEmail(email: string) {
|
|
117
|
-
this.user.email = email;
|
|
118
|
-
return this;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
build(): User {
|
|
122
|
-
return {
|
|
123
|
-
id: this.user.id ?? faker.string.uuid(),
|
|
124
|
-
email: this.user.email ?? faker.internet.email(),
|
|
125
|
-
role: this.user.role ?? 'customer',
|
|
126
|
-
...this.user
|
|
127
|
-
} as User;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Usage
|
|
132
|
-
const admin = new UserBuilder().asAdmin().withEmail('admin@test.com').build();
|
|
133
|
-
const customer = new UserBuilder().asCustomer().build();
|
|
134
|
-
```
|
|
135
|
-
|
|
136
58
|
---
|
|
137
59
|
|
|
138
60
|
## Data Anonymization
|
|
@@ -185,29 +107,6 @@ test('user registration', async () => {
|
|
|
185
107
|
|
|
186
108
|
---
|
|
187
109
|
|
|
188
|
-
## Volume Data Generation
|
|
189
|
-
|
|
190
|
-
```javascript
|
|
191
|
-
// Generate 10,000 users efficiently
|
|
192
|
-
async function generateLargeDataset(count = 10000) {
|
|
193
|
-
const batchSize = 1000;
|
|
194
|
-
const batches = Math.ceil(count / batchSize);
|
|
195
|
-
|
|
196
|
-
for (let i = 0; i < batches; i++) {
|
|
197
|
-
const users = Array.from({ length: batchSize }, (_, index) => ({
|
|
198
|
-
id: i * batchSize + index,
|
|
199
|
-
email: `user${i * batchSize + index}@example.com`,
|
|
200
|
-
firstName: faker.person.firstName()
|
|
201
|
-
}));
|
|
202
|
-
|
|
203
|
-
await db.users.insertMany(users); // Batch insert
|
|
204
|
-
console.log(`Batch ${i + 1}/${batches}`);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
110
|
## Agent-Driven Data Generation
|
|
212
111
|
|
|
213
112
|
```typescript
|
|
@@ -268,8 +167,6 @@ const dataFleet = await FleetManager.coordinate({
|
|
|
268
167
|
|
|
269
168
|
## Remember
|
|
270
169
|
|
|
271
|
-
**
|
|
272
|
-
|
|
273
|
-
**Never use production PII directly.** GDPR fines up to €20M or 4% of revenue. Always use synthetic data or properly anonymized production snapshots.
|
|
170
|
+
**Never use production PII directly.** Always use synthetic data or properly anonymized production snapshots.
|
|
274
171
|
|
|
275
172
|
**With Agents:** `qe-test-data-architect` generates 10k+ records/sec with realistic patterns, relationships, and constraints. Agents ensure GDPR/CCPA compliance automatically and eliminate test data bottlenecks.
|
|
@@ -21,23 +21,11 @@ validation:
|
|
|
21
21
|
# Test Design Techniques
|
|
22
22
|
|
|
23
23
|
<default_to_action>
|
|
24
|
-
When designing test cases
|
|
25
|
-
1. APPLY Boundary Value Analysis (test at min, max, edges)
|
|
26
|
-
2. USE Equivalence Partitioning (one test per partition)
|
|
27
|
-
3. CREATE Decision Tables (for complex business rules)
|
|
28
|
-
4. MODEL State Transitions (for stateful behavior)
|
|
29
|
-
5. REDUCE with Pairwise Testing (for combinations)
|
|
30
|
-
|
|
31
|
-
**Quick Design Selection:**
|
|
24
|
+
When designing test cases, select technique by input type:
|
|
32
25
|
- Numeric ranges → BVA + EP
|
|
33
26
|
- Multiple conditions → Decision Tables
|
|
34
27
|
- Workflows → State Transition
|
|
35
|
-
- Many
|
|
36
|
-
|
|
37
|
-
**Critical Success Factors:**
|
|
38
|
-
- Systematic design finds more bugs with fewer tests
|
|
39
|
-
- Random testing is inefficient
|
|
40
|
-
- 40+ years of research backs these techniques
|
|
28
|
+
- Many parameter combinations → Pairwise Testing
|
|
41
29
|
</default_to_action>
|
|
42
30
|
|
|
43
31
|
## Quick Reference Card
|
|
@@ -48,139 +36,6 @@ When designing test cases systematically:
|
|
|
48
36
|
- Complex business rules
|
|
49
37
|
- Reducing test redundancy
|
|
50
38
|
|
|
51
|
-
### Technique Selection Guide
|
|
52
|
-
| Scenario | Technique |
|
|
53
|
-
|----------|-----------|
|
|
54
|
-
| **Numeric input ranges** | BVA + EP |
|
|
55
|
-
| **Multiple conditions** | Decision Tables |
|
|
56
|
-
| **Stateful workflows** | State Transition |
|
|
57
|
-
| **Many parameter combinations** | Pairwise |
|
|
58
|
-
| **All combinations critical** | Full Factorial |
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Boundary Value Analysis (BVA)
|
|
63
|
-
|
|
64
|
-
**Principle:** Bugs cluster at boundaries.
|
|
65
|
-
|
|
66
|
-
**Test at boundaries:**
|
|
67
|
-
- Minimum valid value
|
|
68
|
-
- Just below minimum (invalid)
|
|
69
|
-
- Just above minimum (valid)
|
|
70
|
-
- Maximum valid value
|
|
71
|
-
- Just above maximum (invalid)
|
|
72
|
-
|
|
73
|
-
```javascript
|
|
74
|
-
// Age field: 18-120 valid
|
|
75
|
-
const boundaryTests = [
|
|
76
|
-
{ input: 17, expected: 'invalid' }, // Below min
|
|
77
|
-
{ input: 18, expected: 'valid' }, // Min boundary
|
|
78
|
-
{ input: 19, expected: 'valid' }, // Above min
|
|
79
|
-
{ input: 119, expected: 'valid' }, // Below max
|
|
80
|
-
{ input: 120, expected: 'valid' }, // Max boundary
|
|
81
|
-
{ input: 121, expected: 'invalid' } // Above max
|
|
82
|
-
];
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## Equivalence Partitioning (EP)
|
|
88
|
-
|
|
89
|
-
**Principle:** One test per equivalent class.
|
|
90
|
-
|
|
91
|
-
```javascript
|
|
92
|
-
// Discount rules:
|
|
93
|
-
// 1-10: No discount
|
|
94
|
-
// 11-100: 10% discount
|
|
95
|
-
// 101+: 20% discount
|
|
96
|
-
|
|
97
|
-
const partitionTests = [
|
|
98
|
-
{ quantity: -1, expected: 'invalid' }, // Invalid partition
|
|
99
|
-
{ quantity: 5, expected: 0 }, // Partition 1: 1-10
|
|
100
|
-
{ quantity: 50, expected: 0.10 }, // Partition 2: 11-100
|
|
101
|
-
{ quantity: 200, expected: 0.20 } // Partition 3: 101+
|
|
102
|
-
];
|
|
103
|
-
|
|
104
|
-
// 4 tests cover all behavior (vs 200+ if testing every value)
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## Decision Tables
|
|
110
|
-
|
|
111
|
-
**Use for:** Complex business rules with multiple conditions.
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
Loan Approval Rules:
|
|
115
|
-
┌──────────────┬───────┬───────┬───────┬───────┬───────┐
|
|
116
|
-
│ Conditions │ R1 │ R2 │ R3 │ R4 │ R5 │
|
|
117
|
-
├──────────────┼───────┼───────┼───────┼───────┼───────┤
|
|
118
|
-
│ Age ≥ 18 │ Yes │ Yes │ Yes │ No │ Yes │
|
|
119
|
-
│ Credit ≥ 700 │ Yes │ Yes │ No │ Yes │ No │
|
|
120
|
-
│ Income ≥ 50k │ Yes │ No │ Yes │ Yes │ Yes │
|
|
121
|
-
├──────────────┼───────┼───────┼───────┼───────┼───────┤
|
|
122
|
-
│ Result │Approve│Approve│Reject │Reject │Reject │
|
|
123
|
-
└──────────────┴───────┴───────┴───────┴───────┴───────┘
|
|
124
|
-
|
|
125
|
-
// 5 tests cover all decision combinations
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## State Transition Testing
|
|
131
|
-
|
|
132
|
-
**Model state changes:**
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
States: Logged Out → Logged In → Premium → Suspended
|
|
136
|
-
|
|
137
|
-
Valid Transitions:
|
|
138
|
-
- Login: Logged Out → Logged In
|
|
139
|
-
- Upgrade: Logged In → Premium
|
|
140
|
-
- Payment Fail: Premium → Suspended
|
|
141
|
-
- Logout: Any → Logged Out
|
|
142
|
-
|
|
143
|
-
Invalid Transitions to Test:
|
|
144
|
-
- Logged Out → Premium (should reject)
|
|
145
|
-
- Suspended → Premium (should reject)
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
```javascript
|
|
149
|
-
test('cannot upgrade without login', async () => {
|
|
150
|
-
const result = await user.upgrade(); // While logged out
|
|
151
|
-
expect(result.error).toBe('Login required');
|
|
152
|
-
});
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## Pairwise (Combinatorial) Testing
|
|
158
|
-
|
|
159
|
-
**Problem:** All combinations explode exponentially.
|
|
160
|
-
|
|
161
|
-
```javascript
|
|
162
|
-
// Parameters:
|
|
163
|
-
// Browser: Chrome, Firefox, Safari (3)
|
|
164
|
-
// OS: Windows, Mac, Linux (3)
|
|
165
|
-
// Screen: Desktop, Tablet, Mobile (3)
|
|
166
|
-
|
|
167
|
-
// All combinations: 3 × 3 × 3 = 27 tests
|
|
168
|
-
// Pairwise: 9 tests cover all pairs
|
|
169
|
-
|
|
170
|
-
const pairwiseTests = [
|
|
171
|
-
{ browser: 'Chrome', os: 'Windows', screen: 'Desktop' },
|
|
172
|
-
{ browser: 'Chrome', os: 'Mac', screen: 'Tablet' },
|
|
173
|
-
{ browser: 'Chrome', os: 'Linux', screen: 'Mobile' },
|
|
174
|
-
{ browser: 'Firefox', os: 'Windows', screen: 'Tablet' },
|
|
175
|
-
{ browser: 'Firefox', os: 'Mac', screen: 'Mobile' },
|
|
176
|
-
{ browser: 'Firefox', os: 'Linux', screen: 'Desktop' },
|
|
177
|
-
{ browser: 'Safari', os: 'Windows', screen: 'Mobile' },
|
|
178
|
-
{ browser: 'Safari', os: 'Mac', screen: 'Desktop' },
|
|
179
|
-
{ browser: 'Safari', os: 'Linux', screen: 'Tablet' }
|
|
180
|
-
];
|
|
181
|
-
// Each pair appears at least once
|
|
182
|
-
```
|
|
183
|
-
|
|
184
39
|
---
|
|
185
40
|
|
|
186
41
|
## Agent-Driven Test Design
|
|
@@ -242,8 +97,4 @@ const designFleet = await FleetManager.coordinate({
|
|
|
242
97
|
|
|
243
98
|
## Remember
|
|
244
99
|
|
|
245
|
-
**Systematic design > Random testing.** 40+ years of research shows these techniques find more bugs with fewer tests than ad-hoc approaches.
|
|
246
|
-
|
|
247
|
-
**Combine techniques for comprehensive coverage.** BVA for boundaries, EP for partitions, decision tables for rules, pairwise for combinations.
|
|
248
|
-
|
|
249
100
|
**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.
|
|
@@ -47,23 +47,6 @@ When managing test environments:
|
|
|
47
47
|
- Reducing test infrastructure costs
|
|
48
48
|
- Ensuring dev/prod parity
|
|
49
49
|
|
|
50
|
-
### Environment Types
|
|
51
|
-
| Type | Purpose | Lifetime |
|
|
52
|
-
|------|---------|----------|
|
|
53
|
-
| **Local** | Fast feedback | Developer session |
|
|
54
|
-
| **CI** | Automated tests | Per build (ephemeral) |
|
|
55
|
-
| **Staging** | Pre-prod validation | Persistent |
|
|
56
|
-
| **Production** | Canary/synthetic | Continuous |
|
|
57
|
-
|
|
58
|
-
### Dev/Prod Parity Checklist
|
|
59
|
-
| Item | Must Match |
|
|
60
|
-
|------|------------|
|
|
61
|
-
| OS | Same version |
|
|
62
|
-
| Database | Same type + version |
|
|
63
|
-
| Dependencies | Same versions |
|
|
64
|
-
| Config | Same structure |
|
|
65
|
-
| Env vars | Same names |
|
|
66
|
-
|
|
67
50
|
---
|
|
68
51
|
|
|
69
52
|
## Docker for Test Environments
|
|
@@ -103,32 +86,6 @@ docker-compose -f docker-compose.test.yml down
|
|
|
103
86
|
|
|
104
87
|
---
|
|
105
88
|
|
|
106
|
-
## Infrastructure as Code
|
|
107
|
-
|
|
108
|
-
```hcl
|
|
109
|
-
# test-environment.tf
|
|
110
|
-
resource "aws_instance" "test_server" {
|
|
111
|
-
ami = "ami-0c55b159cbfafe1f0"
|
|
112
|
-
instance_type = "t3.medium"
|
|
113
|
-
|
|
114
|
-
tags = {
|
|
115
|
-
Name = "test-environment"
|
|
116
|
-
Environment = "test"
|
|
117
|
-
AutoShutdown = "20:00" # Cost optimization
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
resource "aws_rds_instance" "test_db" {
|
|
122
|
-
engine = "postgres"
|
|
123
|
-
engine_version = "15"
|
|
124
|
-
instance_class = "db.t3.micro"
|
|
125
|
-
backup_retention_period = 0 # No backups needed for test
|
|
126
|
-
skip_final_snapshot = true
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
89
|
## Service Virtualization
|
|
133
90
|
|
|
134
91
|
```javascript
|
|
@@ -239,8 +196,4 @@ const envFleet = await FleetManager.coordinate({
|
|
|
239
196
|
|
|
240
197
|
## Remember
|
|
241
198
|
|
|
242
|
-
**Environment inconsistency = flaky tests.** "Works on my machine" problems come from: different OS/versions, missing dependencies, configuration differences, data differences.
|
|
243
|
-
|
|
244
|
-
**Infrastructure as Code ensures repeatability.** Version control your environment configurations. Spin up identical environments on demand.
|
|
245
|
-
|
|
246
199
|
**With Agents:** Agents automatically provision test environments matching production, ensure parity, mock external services, and optimize costs with auto-scaling and auto-shutdown.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-failure-investigator
|
|
3
|
+
description: "Use when a test is failing and you need to determine root cause: is it flaky, an environment issue, or a real regression? Traces failure from symptom to fix."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test Failure Investigator
|
|
8
|
+
|
|
9
|
+
Runbook-style skill for systematic test failure investigation. Given a failing test, determines root cause and recommends action.
|
|
10
|
+
|
|
11
|
+
## Activation
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/test-failure-investigator [test-name-or-file]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Investigation Flow
|
|
18
|
+
|
|
19
|
+
### Step 1: Classify the Failure
|
|
20
|
+
|
|
21
|
+
Run the test 3 times and classify:
|
|
22
|
+
|
|
23
|
+
| Result Pattern | Classification | Action |
|
|
24
|
+
|---------------|---------------|--------|
|
|
25
|
+
| Fails consistently | **Regression** or **Environment** | Continue to Step 2 |
|
|
26
|
+
| Fails intermittently | **Flaky** | Skip to Step 4 |
|
|
27
|
+
| Passes now | **Transient** | Check CI logs, environment diff |
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Run test 3 times
|
|
31
|
+
for i in 1 2 3; do npx jest {{test_file}} 2>&1 | tail -5; echo "--- Run $i ---"; done
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Step 2: Narrow the Scope
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# When did it start failing?
|
|
38
|
+
git log --oneline -20 -- {{related_source_files}}
|
|
39
|
+
|
|
40
|
+
# What changed recently?
|
|
41
|
+
git diff HEAD~5 -- {{related_source_files}}
|
|
42
|
+
|
|
43
|
+
# Does it fail in isolation?
|
|
44
|
+
npx jest {{test_file}} --testNamePattern="{{test_name}}"
|
|
45
|
+
|
|
46
|
+
# Does it fail with other tests?
|
|
47
|
+
npx jest --runInBand # sequential execution
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Step 3: Root Cause Analysis
|
|
51
|
+
|
|
52
|
+
| Symptom | Likely Cause | Investigation |
|
|
53
|
+
|---------|-------------|--------------|
|
|
54
|
+
| Timeout | Network/DB dependency | Check external service availability |
|
|
55
|
+
| Assertion mismatch | Logic change | Compare expected vs actual, check git blame |
|
|
56
|
+
| Import error | Dependency change | Check package.json changes, run `npm ci` |
|
|
57
|
+
| Permission denied | Environment | Check file permissions, Docker volumes |
|
|
58
|
+
| Out of memory | Resource leak | Profile with `--detectOpenHandles` |
|
|
59
|
+
|
|
60
|
+
### Step 4: Flaky Test Investigation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Run 10 times to confirm flakiness
|
|
64
|
+
for i in $(seq 1 10); do npx jest {{test_file}} --forceExit 2>&1 | grep -E 'PASS|FAIL'; done
|
|
65
|
+
|
|
66
|
+
# Common flaky causes:
|
|
67
|
+
# - Shared state between tests (missing cleanup)
|
|
68
|
+
# - Time-dependent assertions (use fake timers)
|
|
69
|
+
# - Race conditions (missing await)
|
|
70
|
+
# - Port conflicts (use random ports)
|
|
71
|
+
# - Order dependency (run with --randomize)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Step 5: Report
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
## Test Failure Report
|
|
78
|
+
- **Test**: {{test_name}}
|
|
79
|
+
- **File**: {{test_file}}
|
|
80
|
+
- **Classification**: Regression / Flaky / Environment / Transient
|
|
81
|
+
- **Root Cause**: {{description}}
|
|
82
|
+
- **First Failed**: {{commit_hash}} ({{date}})
|
|
83
|
+
- **Fix**: {{recommended_action}}
|
|
84
|
+
- **Verified**: [ ] Fix applied and test passes 3x consecutively
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Composition
|
|
88
|
+
|
|
89
|
+
After investigation, compose with:
|
|
90
|
+
- **`/bug-reporting-excellence`** — if regression found, file a bug report
|
|
91
|
+
- **`/regression-testing`** — if regression, add to regression suite
|
|
92
|
+
- **`/qe-test-execution`** — for re-running tests after fix
|
|
93
|
+
|
|
94
|
+
## Gotchas
|
|
95
|
+
|
|
96
|
+
- Agent may guess at root cause without running the test — always reproduce first
|
|
97
|
+
- "Works on my machine" is not a diagnosis — compare environments (node version, OS, deps)
|
|
98
|
+
- Flaky tests that pass 9/10 times will still be reported as "passing" by CI — run 10+ times
|
|
99
|
+
- Test isolation failures are the #1 cause of flaky tests — check for shared state in beforeAll/afterAll
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-metrics-dashboard
|
|
3
|
+
description: "Use when querying test history, analyzing flakiness rates, tracking MTTR, or building quality trend dashboards from test execution data."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test Metrics Dashboard
|
|
8
|
+
|
|
9
|
+
Data & Analysis skill for querying test execution history, identifying trends, and surfacing actionable quality metrics.
|
|
10
|
+
|
|
11
|
+
## Activation
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/test-metrics-dashboard
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Key Metrics
|
|
18
|
+
|
|
19
|
+
### Test Health Metrics
|
|
20
|
+
|
|
21
|
+
| Metric | Formula | Target | Alert |
|
|
22
|
+
|--------|---------|--------|-------|
|
|
23
|
+
| **Pass Rate** | Passed / Total | > 95% | < 90% |
|
|
24
|
+
| **Flakiness Rate** | Flaky / Total | < 5% | > 10% |
|
|
25
|
+
| **MTTR** | Avg time from failure to fix | < 4 hours | > 24 hours |
|
|
26
|
+
| **Execution Time** | Total suite duration | < 10 min | > 20 min |
|
|
27
|
+
| **Coverage Delta** | Current - Previous | >= 0% | < -2% |
|
|
28
|
+
|
|
29
|
+
### Data Collection
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Export Jest results to JSON
|
|
33
|
+
npx jest --json --outputFile=test-results/$(date +%Y-%m-%d).json
|
|
34
|
+
|
|
35
|
+
# Parse results for dashboard
|
|
36
|
+
jq '{
|
|
37
|
+
date: .startTime,
|
|
38
|
+
total: .numTotalTests,
|
|
39
|
+
passed: .numPassedTests,
|
|
40
|
+
failed: .numFailedTests,
|
|
41
|
+
duration_ms: (.testResults | map(.endTime - .startTime) | add),
|
|
42
|
+
pass_rate: ((.numPassedTests / .numTotalTests) * 100),
|
|
43
|
+
flaky: [.testResults[] | select(.numPendingTests > 0)] | length
|
|
44
|
+
}' test-results/$(date +%Y-%m-%d).json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Trend Analysis
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Compare last 5 runs
|
|
51
|
+
for f in $(ls -t test-results/*.json | head -5); do
|
|
52
|
+
jq --arg file "$f" '{
|
|
53
|
+
file: $file,
|
|
54
|
+
pass_rate: ((.numPassedTests / .numTotalTests) * 100 | floor),
|
|
55
|
+
duration_s: ((.testResults | map(.endTime - .startTime) | add) / 1000 | floor)
|
|
56
|
+
}' "$f"
|
|
57
|
+
done
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Top Failing Tests
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Find most frequently failing tests across runs
|
|
64
|
+
for f in test-results/*.json; do
|
|
65
|
+
jq -r '.testResults[] | select(.numFailingTests > 0) | .testFilePath' "$f"
|
|
66
|
+
done | sort | uniq -c | sort -rn | head -10
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Run History
|
|
70
|
+
|
|
71
|
+
Store dashboard data in `${CLAUDE_PLUGIN_DATA}/test-metrics.log`:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
2026-03-18|95.2|4.1|312|82.5|3
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Format: `date|pass_rate|flakiness_rate|duration_s|coverage_pct|failed_count`
|
|
78
|
+
|
|
79
|
+
Read history for trend detection:
|
|
80
|
+
```bash
|
|
81
|
+
# Coverage trending down?
|
|
82
|
+
tail -5 "${CLAUDE_PLUGIN_DATA}/test-metrics.log" | awk -F'|' '{print $5}' | sort -n | head -1
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Composition
|
|
86
|
+
|
|
87
|
+
Feeds into:
|
|
88
|
+
- **`/qe-quality-assessment`** — quality gate decisions based on metrics
|
|
89
|
+
- **`/test-failure-investigator`** — investigate top failing tests
|
|
90
|
+
- **`/coverage-drop-investigator`** — when coverage trends down
|
|
91
|
+
|
|
92
|
+
## Gotchas
|
|
93
|
+
|
|
94
|
+
- Metrics without baselines are meaningless — establish baselines before tracking trends
|
|
95
|
+
- Flakiness rate is underreported — a test that fails 1/100 times still breaks CI weekly
|
|
96
|
+
- Duration trends upward over time as test count grows — set alerts on rate of increase, not absolute value
|
|
97
|
+
- Agent may report metrics from a single run as "trends" — need 5+ data points for meaningful trends
|