qa-expert

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

QA Expert

QA专家

Quality assurance specialist for developing comprehensive testing strategies and quality gates.
专注于制定全面测试策略与质量门的质量保障专员。

When This Skill Activates

何时激活该Skill

Activates when you:
  • Ask for QA strategy
  • Need quality gates
  • Want to improve test coverage
  • Plan testing approach
当你有以下需求时激活:
  • 咨询QA策略
  • 需要设置质量门
  • 想要提升测试覆盖范围
  • 规划测试方案

Quality Assurance Strategy

质量保障策略

1. Risk-Based Testing

1. 基于风险的测试

Prioritize testing based on risk:
Risk LevelTesting Approach
Critical (Money, Security, Data)100% automation, chaos testing
High (Core features)Full E2E, integration, unit
Medium (Secondary features)Integration, unit
Low (Edge features)Unit tests only
根据风险优先级安排测试:
风险等级测试方案
关键级(涉及资金、安全、数据)100%自动化测试、混沌测试
高级(核心功能)完整端到端测试、集成测试、单元测试
中级(次要功能)集成测试、单元测试
低级(边缘功能)仅单元测试

2. Testing Pyramid Allocation

2. 测试金字塔分配

Level% of TestsFocus
E2E10%Critical user journeys
Integration30%API interactions
Unit60%Business logic, utilities
层级测试占比关注重点
E2E10%关键用户流程
集成测试30%API交互
单元测试60%业务逻辑、工具类

3. Quality Gates

3. 质量门

Pre-Commit

提交前

bash
- Lint: npm run lint
- Format check: npm run format:check
- Type check: npm run type-check
- Unit tests: npm run test:unit
bash
- Lint: npm run lint
- Format check: npm run format:check
- Type check: npm run type-check
- Unit tests: npm run test:unit

Pre-Merge

合并前

bash
- All tests: npm test
- Coverage threshold: > 80%
- Security scan: npm audit
- License check: npm run check:licenses
bash
- All tests: npm test
- Coverage threshold: > 80%
- Security scan: npm audit
- License check: npm run check:licenses

Pre-Production

上线前

bash
- Full test suite: npm run test:all
- E2E tests: npm run test:e2e
- Performance tests: npm run test:perf
- Security audit: npm audit --audit-level high
bash
- Full test suite: npm run test:all
- E2E tests: npm run test:e2e
- Performance tests: npm run test:perf
- Security audit: npm audit --audit-level high

Test Categories

测试分类

Functional Testing

功能测试

Purpose: Verify features work as specified
  • Happy path testing
  • Edge case testing
  • Boundary value analysis
  • Error handling
目的:验证功能是否符合规格要求
  • 正常流程测试
  • 边缘场景测试
  • 边界值分析
  • 错误处理测试

Non-Functional Testing

非功能测试

Performance
  • Response time < 200ms (p95)
  • Throughput > 1000 req/s
  • Memory usage stable
  • No memory leaks
Security
  • OWASP Top 10 coverage
  • Penetration testing
  • Dependency vulnerability scan
  • Secrets detection
Compatibility
  • Browser testing (Chrome, Firefox, Safari, Edge)
  • Device testing (Mobile, Desktop, Tablet)
  • OS testing (Windows, macOS, Linux)
  • Version testing (N-1 browser versions)
性能测试
  • 响应时间 < 200ms(p95)
  • 吞吐量 > 1000 请求/秒
  • 内存使用稳定
  • 无内存泄漏
安全测试
  • 覆盖OWASP Top 10
  • 渗透测试
  • 依赖漏洞扫描
  • 敏感信息检测
兼容性测试
  • 浏览器测试(Chrome、Firefox、Safari、Edge)
  • 设备测试(移动端、桌面端、平板)
  • 操作系统测试(Windows、macOS、Linux)
  • 版本测试(浏览器N-1版本)

Regression Testing

回归测试

  • Previous bugs don't reappear
  • New features don't break existing features
  • Performance doesn't degrade
  • 已修复的Bug不再复现
  • 新功能不影响现有功能
  • 性能无退化

Exploratory Testing

探索性测试

  • Find unexpected issues
  • Test edge cases
  • User experience issues
  • 发现未预期的问题
  • 测试边缘场景
  • 排查用户体验问题

Test Planning

测试规划

Test Plan Template

测试计划模板

markdown
undefined
markdown
undefined

Test Plan: [Feature Name]

测试计划: [功能名称]

Overview

概述

[Feature description]
[功能描述]

Scope

范围

[In scope / Out of scope]
[测试范围 / 非测试范围]

Test Cases

测试用例

Functional

功能测试

  • TC001: [Description]
  • TC002: [Description]
  • TC001: [描述]
  • TC002: [描述]

Integration

集成测试

  • TC101: [Description]
  • TC101: [描述]

E2E

E2E测试

  • TC201: [Description]
  • TC201: [描述]

Test Data

测试数据

[Required test data]
[所需测试数据]

Environment

测试环境

[Test environment setup]
[测试环境配置]

Schedule

时间安排

[Testing timeline]
[测试时间线]

Exit Criteria

退出标准

[Definition of done]
undefined
[测试完成定义]
undefined

Quality Metrics

质量指标

Code Quality

代码质量

  • Test Coverage: > 80%
  • Cyclomatic Complexity: < 10 per function
  • Code Duplication: < 5%
  • Technical Debt Ratio: < 5%
  • 测试覆盖率: > 80%
  • 圈复杂度: 每个函数 < 10
  • 代码重复率: < 5%
  • 技术债务占比: < 5%

Defect Metrics

缺陷指标

  • Defect Density: < 1 defect per 1000 LOC
  • Critical Defects: 0
  • High Defects: 0
  • Medium Defects: < 3
  • 缺陷密度: < 1个缺陷/1000 LOC
  • 关键缺陷: 0
  • 高级缺陷: 0
  • 中级缺陷: < 3

Test Metrics

测试指标

  • Test Pass Rate: > 95%
  • Flaky Tests: 0
  • Test Execution Time: < 10 minutes
  • 测试通过率: > 95%
  • 不稳定测试: 0
  • 测试执行时间: < 10分钟

Automation Strategy

自动化策略

Automate When

适合自动化的场景

  • Test is run frequently
  • Test has deterministic results
  • Test is stable
  • ROI justifies automation cost
  • 测试执行频率高
  • 测试结果可预测
  • 测试场景稳定
  • 自动化投入产出比合理

Don't Automate When

不适合自动化的场景

  • Test requires human judgment
  • Test is exploratory
  • Test is one-time only
  • Test changes frequently
  • 测试需要人工判断
  • 测试为探索性测试
  • 测试仅执行一次
  • 测试场景频繁变更

Bug Report Template

Bug报告模板

markdown
undefined
markdown
undefined

Bug Summary

Bug摘要

[One-line summary]
[一句话总结]

Severity

严重程度

Critical / High / Medium / Low
Critical / High / Medium / Low

Steps to Reproduce

复现步骤

Expected Behavior

预期结果

[What should happen]
[应该发生的情况]

Actual Behavior

实际结果

[What actually happens]
[实际发生的情况]

Environment

环境

  • OS:
  • Browser:
  • Version:
  • 操作系统:
  • 浏览器:
  • 版本:

Attachments

附件

[Screenshots, logs, etc.]
undefined
[截图、日志等]
undefined

Scripts

脚本

Generate test plan:
bash
python scripts/generate_test_plan.py <feature>
Analyze test coverage:
bash
python scripts/coverage_analysis.py
生成测试计划:
bash
python scripts/generate_test_plan.py <feature>
分析测试覆盖率:
bash
python scripts/coverage_analysis.py

References

参考资料

  • references/strategy.md
    - Testing strategies
  • references/gates.md
    - Quality gate definitions
  • references/metrics.md
    - QA metrics and KPIs
  • references/strategy.md
    - 测试策略
  • references/gates.md
    - 质量门定义
  • references/metrics.md
    - QA指标与关键绩效指标