qa-testing-strategy by vasilyu1983/ai-agents-public
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill qa-testing-strategy面向现代软件交付的基于风险的质量工程策略。
核心参考资料:精选链接位于 data/sources.json(SLO/错误预算、契约、端到端测试、OpenTelemetry)。请从 references/operational-playbook.md 开始,以获取简洁、可导航的概览。
| 需求 | 技能 |
|---|---|
| 调试失败的测试或事件 | qa-debugging |
| 测试 LLM 智能体/角色 | qa-agent-testing |
| 执行安全审计/威胁建模 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 设计 CI/CD 流水线和基础设施 | ops-devops-platform |
| 测试类型 | 目标 | 典型用途 |
|---|---|---|
| 单元测试 | 快速验证逻辑和不变量 | 纯函数、核心业务规则 |
| 组件测试 | 隔离验证 UI 行为 | UI 组件和状态转换 |
| 集成测试 | 验证与真实依赖的边界 | API + 数据库、队列、外部适配器 |
| 契约测试 | 防止跨团队破坏性变更 | OpenAPI/AsyncAPI/JSON Schema/Protobuf |
| 端到端测试 | 验证关键用户旅程 | 每个产品领域 1-2 条“核心路径” |
| 性能测试 | 强制执行预算和容量 | 负载、压力、浸泡、回归趋势 |
| 视觉测试 | 捕获 UI 回归 | 稳定页面上的布局/视觉差异 |
| 无障碍测试 | 自动化 WCAG 检查 | axe 冒烟测试 + 针对性手动审计 |
| 安全测试 | 及早发现常见 Web 漏洞 | CI 中的 DAST 冒烟测试 + 关键检查 |
/\
/E2E\ 5-10% - 关键旅程
/------\
/Integr. \ 15-25% - API、数据库、队列
/----------\
/Component \ 20-30% - UI 模块
/------------\
/ Unit \ 40-60% - 逻辑和不变量
/--------------\
Need to test: [Feature Type]
│
├─ Pure business logic/invariants? → Unit tests (mock boundaries)
│
├─ UI component/state transitions? → Component tests
│ └─ Cross-page user journey? → E2E tests
│
├─ API Endpoint?
│ ├─ Single service boundary? → Integration tests (real DB/deps)
│ └─ Cross-service compatibility? → Contract tests (schema/versioning)
│
├─ Event-driven/API schema evolution? → Contract + backward-compat tests
│
└─ Performance-critical? → k6 load testing
| 预算 | 目标 |
|---|---|
| PR 门禁 | p50 ≤ 10 分钟,p95 ≤ 20 分钟 |
| 主线健康度 | ≥ 99% 绿色构建/天 |
flaky_failures / total_test_executions(其中 flaky_failure = fail_then_pass_on_rerun) it('should apply discount', () => {
// Arrange
const order = { total: 150 };
// Act
const result = calculateDiscount(order);
// Assert
expect(result.discount).toBe(15);
});
class LoginPage {
async login(email: string, password: string) {
await this.page.fill('[data-testid="email"]', email);
await this.page.fill('[data-testid="password"]', password);
await this.page.click('[data-testid="submit"]');
}
}
| 反模式 | 问题 | 解决方案 |
|---|---|---|
| 测试实现 | 重构时中断 | 测试行为 |
| 共享可变状态 | 不稳定测试 | 隔离测试数据 |
| 测试中使用 sleep() | 缓慢、不可靠 | 使用适当的等待 |
| 一切皆端到端测试 | 缓慢、昂贵 | 使用测试金字塔 |
| 忽略不稳定测试 | 虚假信心 | 修复或隔离 |
在发布前,运行一次覆盖率审计,将产品功能/待办事项 ID 映射到直接的测试证据。
direct、indirect、none)| 资源 | 用途 |
|---|---|
| comprehensive-testing-guide.md | 跨层级的端到端操作手册 |
| operational-playbook.md | 测试金字塔、BDD、CI 门禁 |
| shift-left-testing.md | 契约优先、BDD、持续测试 |
| test-automation-patterns.md | 可靠模式和反模式 |
| playwright-webapp-testing.md | Playwright 模式 |
| chaos-resilience-testing.md | 混沌工程 |
| observability-driven-testing.md | OpenTelemetry、基于追踪的测试 |
| contract-testing-2026.md | Pact、Specmatic |
| synthetic-test-data.md | 隐私安全、临时的测试数据 |
| test-environment-management.md | 环境配置和生命周期管理 |
| quality-metrics-dashboard.md | 质量指标和仪表板 |
| compliance-testing.md | SOC2、HIPAA、GDPR、PCI-DSS 测试 |
| feature-matrix-vs-test-matrix-gate.md | 发布阻塞的功能到测试覆盖率审计 |
| 模板 | 用途 |
|---|---|
| template-test-case-design.md | Given/When/Then 和测试预言 |
| test-strategy-template.md | 基于风险的策略 |
| template-flaky-test-triage.md | 不稳定测试分类运行手册 |
| template-jest-vitest.md | 单元测试模式 |
| template-api-integration.md | API + 数据库集成测试 |
| template-playwright.md | Playwright 端到端测试 |
| template-visual-testing.md | 视觉回归测试 |
| template-k6-load-testing.md | k6 性能测试 |
| automation-pipeline-template.md | CI 阶段、预算、门禁 |
| template-cucumber-gherkin.md | BDD 特性文件和步骤 |
| template-release-coverage-audit.md | 功能矩阵 vs 测试矩阵发布审计 |
| 文件 | 用途 |
|---|---|
| sources.json | 外部参考资料 |
将此序列用于涉及用户流程、定价、本地化或分析的功能分支。
# 1) Static checks
npm run lint
npm run typecheck
# 2) Fast correctness
npm run test:unit
# 3) Critical path checks
npm run test:e2e -- --grep "@critical"
# 4) Instrumentation gate (if configured)
npm run test:analytics-gate
# 5) Production build
npm run build
始终报告:
每周安装次数
173
代码仓库
GitHub 星标
47
首次出现
2026年1月23日
安全审计
安装于
opencode152
codex149
gemini-cli147
cursor144
github-copilot140
kimi-cli127
Risk-based quality engineering strategy for modern software delivery.
Core references : curated links in data/sources.json (SLOs/error budgets, contracts, E2E, OpenTelemetry). Start with references/operational-playbook.md for a compact, navigable overview.
| Need | Skill |
|---|---|
| Debug failing tests or incidents | qa-debugging |
| Test LLM agents/personas | qa-agent-testing |
| Perform security audit/threat model | software-security-appsec |
| Design CI/CD pipelines and infra | ops-devops-platform |
| Test Type | Goal | Typical Use |
|---|---|---|
| Unit | Prove logic and invariants fast | Pure functions, core business rules |
| Component | Validate UI behavior in isolation | UI components and state transitions |
| Integration | Validate boundaries with real deps | API + DB, queues, external adapters |
| Contract | Prevent breaking changes cross-team | OpenAPI/AsyncAPI/JSON Schema/Protobuf |
| E2E | Validate critical user journeys | 1–2 “money paths” per product area |
| Performance | Enforce budgets and capacity | Load, stress, soak, regression trends |
| Visual | Catch UI regressions | Layout/visual diffs on stable pages |
| Accessibility | Automate WCAG checks | axe smoke + targeted manual audits |
| Security | Catch common web vulns early |
/\
/E2E\ 5-10% - Critical journeys
/------\
/Integr. \ 15-25% - API, DB, queues
/----------\
/Component \ 20-30% - UI modules
/------------\
/ Unit \ 40-60% - Logic and invariants
/--------------\
Need to test: [Feature Type]
│
├─ Pure business logic/invariants? → Unit tests (mock boundaries)
│
├─ UI component/state transitions? → Component tests
│ └─ Cross-page user journey? → E2E tests
│
├─ API Endpoint?
│ ├─ Single service boundary? → Integration tests (real DB/deps)
│ └─ Cross-service compatibility? → Contract tests (schema/versioning)
│
├─ Event-driven/API schema evolution? → Contract + backward-compat tests
│
└─ Performance-critical? → k6 load testing
| Budget | Target |
|---|---|
| PR gate | p50 ≤ 10 min, p95 ≤ 20 min |
| Mainline health | ≥ 99% green builds/day |
flaky_failures / total_test_executions (where flaky_failure = fail_then_pass_on_rerun)it('should apply discount', () => {
// Arrange
const order = { total: 150 };
// Act
const result = calculateDiscount(order);
// Assert
expect(result.discount).toBe(15);
});
class LoginPage {
async login(email: string, password: string) {
await this.page.fill('[data-testid="email"]', email);
await this.page.fill('[data-testid="password"]', password);
await this.page.click('[data-testid="submit"]');
}
}
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Testing implementation | Breaks on refactor | Test behavior |
| Shared mutable state | Flaky tests | Isolate test data |
| sleep() in tests | Slow, unreliable | Use proper waits |
| Everything E2E | Slow, expensive | Use test pyramid |
| Ignoring flaky tests | False confidence | Fix or quarantine |
Before release, run a coverage audit that maps product features/backlog IDs to direct test evidence.
direct, indirect, none)| Resource | Purpose |
|---|---|
| comprehensive-testing-guide.md | End-to-end playbook across layers |
| operational-playbook.md | Testing pyramid, BDD, CI gates |
| shift-left-testing.md | Contract-first, BDD, continuous testing |
| test-automation-patterns.md | Reliable patterns and anti-patterns |
| playwright-webapp-testing.md | Playwright patterns |
| chaos-resilience-testing.md | Chaos engineering |
| Template | Purpose |
|---|---|
| template-test-case-design.md | Given/When/Then and test oracles |
| test-strategy-template.md | Risk-based strategy |
| template-flaky-test-triage.md | Flake triage runbook |
| template-jest-vitest.md | Unit test patterns |
| template-api-integration.md | API + DB integration tests |
| template-playwright.md | Playwright E2E |
| File | Purpose |
|---|---|
| sources.json | External references |
Use this sequence for feature branches that touch user flows, pricing, localization, or analytics.
# 1) Static checks
npm run lint
npm run typecheck
# 2) Fast correctness
npm run test:unit
# 3) Critical path checks
npm run test:e2e -- --grep "@critical"
# 4) Instrumentation gate (if configured)
npm run test:analytics-gate
# 5) Production build
npm run build
Always report:
Weekly Installs
173
Repository
GitHub Stars
47
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode152
codex149
gemini-cli147
cursor144
github-copilot140
kimi-cli127
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
85,700 周安装
| DAST smoke + critical checks in CI |
| observability-driven-testing.md | OpenTelemetry, trace-based |
| contract-testing-2026.md | Pact, Specmatic |
| synthetic-test-data.md | Privacy-safe, ephemeral test data |
| test-environment-management.md | Environment provisioning and lifecycle |
| quality-metrics-dashboard.md | Quality metrics and dashboards |
| compliance-testing.md | SOC2, HIPAA, GDPR, PCI-DSS testing |
| feature-matrix-vs-test-matrix-gate.md | Release-blocking feature-to-test coverage audit |
| template-visual-testing.md |
| Visual regression testing |
| template-k6-load-testing.md | k6 performance |
| automation-pipeline-template.md | CI stages, budgets, gates |
| template-cucumber-gherkin.md | BDD feature files and steps |
| template-release-coverage-audit.md | Feature matrix vs test matrix release audit |