quality-engineering
Use when designing test strategies, implementing test automation, or establishing QA processes
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Quality Engineering
Guidelines for QA processes, test automation, and performance engineering.
When to Use
- Designing test strategies for new features
- Setting up or improving test automation
- Performance testing and optimization
- Capacity planning and load testing
- Establishing quality metrics
- Fixing flaky tests
- Improving test coverage
- Debugging integration test failures
When NOT to Use
- Writing specific test cases (follow TDD patterns)
- Language-specific testing (use language skills)
- End-to-end test implementation details
Quality Philosophy
- Prevention over detection - Engage early to prevent defects
- Test behavior, not implementation - Focus on observable outcomes
- No failing builds - Never merge broken code
- Continuous improvement - Regularly refine processes
Test Strategy
Test Pyramid
/\
/E2E\ ← Few, critical paths
/------\
/ Integ \ ← Moderate, key integrations
/------------\
/ Unit \ ← Many, fast, isolated
Coverage Targets
- Unit tests: > 80% line coverage
- Integration: Key API paths covered
- E2E: Critical user journeys
Test Design Patterns
Arrange-Act-Assert (AAA)
// Arrange: Setup preconditions
const user = createTestUser();
// Act: Execute behavior
const result = await login(user);
// Assert: Verify outcome
expect(result.success).toBe(true);
Test Characteristics
- Isolated: No shared state between tests
- Deterministic: Same result every run
- Fast: Quick feedback loop
- Readable: Self-documenting names
Definition of Done
Feature is complete when:
- All tests passing (unit, integration, E2E)
- Code meets style guides
- No console errors or unhandled exceptions
- API changes documented
- Performance budgets met
Performance Engineering
Systematic Approach
- Baseline: Measure before optimizing
- Identify: Profile to find bottlenecks
- Budget: Set clear SLOs
- Optimize: Implement improvements
- Validate: Measure impact
- Monitor: Continuous production tracking
Key Metrics
| Layer | Metrics |
|---|---|
| Frontend | LCP, INP, CLS, TTFB |
| API | Response time, throughput, error rate |
| Database | Query time, connections, locks |
| Infrastructure | CPU, memory, I/O, network |
Performance Checklist
- Established performance baselines
- Load testing simulates realistic traffic
- Database queries optimized
- Caching strategy implemented
- CDN configured for static assets
- Monitoring dashboards in place
- Alerting on SLO breaches
Test Automation
Framework Selection
| Type | Recommended Tools |
|---|---|
| Unit | Jest, Pytest, JUnit |
| Integration | Testcontainers, SuperTest |
| E2E | Playwright, Cypress |
| Load | k6, Locust, Gatling |
| Coverage | Istanbul, JaCoCo |
CI/CD Integration
# Pipeline stages
stages:
- lint # Fast feedback
- unit # Parallel execution
- build # Artifact creation
- integration # Service testing
- e2e # Critical paths
- performance # Load testing (optional)
Test Data Management
- Use factories/fixtures for consistent data
- Isolate test data from production
- Clean up after tests
- Consider data masking for sensitive info
Quality Metrics
| Metric | Target | Purpose |
|---|---|---|
| Test Coverage | > 80% | Code confidence |
| Test Pass Rate | > 98% | Stability |
| Flaky Test Rate | < 2% | Reliability |
| Build Time | < 10 min | Fast feedback |
| MTTR | < 1 hour | Recovery speed |
Deliverables
- Test Strategy Document: Scope, objectives, methodology
- Test Cases: Step-by-step with expected results
- Automated Test Suite: Maintainable, organized tests
- CI Pipeline Config: Automated quality gates
- Coverage Reports: Visibility into tested code
- Performance Dashboards: Real-time metrics
- Bug Reports: Clear reproduction steps, severity
Anti-Patterns to Avoid
- Testing implementation details instead of behavior
- Flaky tests that pass/fail randomly
- Slow test suites blocking development
- Missing edge case coverage
- Manual-only regression testing
- No performance testing until production issues
Quick Reference
| Test Type | Ratio | Tools | Speed |
|---|---|---|---|
| Unit | 70% | Jest, Pytest | < 1s |
| Integration | 20% | Testcontainers | < 5s |
| E2E | 10% | Playwright | < 30s |
Common Issues
| Symptom | Cause | Fix |
|---|---|---|
| Flaky tests | Race conditions, timing | Use condition-based waiting |
| Low coverage | Missing test cases | Add edge case tests |
| Slow CI | Too many E2E tests | Shift left to unit tests |
| Test pollution | Shared state | Isolate tests, clean fixtures |
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!