regression-testing
关于
This skill strategically selects and runs regression tests based on code changes and risk, ensuring fixes don't break existing functionality. It analyzes impact, optimizes test execution for faster feedback, and helps manage continuous regression within CI/CD. Use it for verifying changes, planning test suites, or streamlining test execution.
快速安装
Claude Code
推荐/plugin add https://github.com/proffesor-for-testing/agentic-qegit clone https://github.com/proffesor-for-testing/agentic-qe.git ~/.claude/skills/regression-testing在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Regression Testing
<default_to_action> When verifying changes don't break existing functionality:
- ANALYZE what changed (git diff, impact analysis)
- SELECT tests based on change + risk (not everything)
- RUN in priority order (smoke → selective → full)
- OPTIMIZE execution (parallel, sharding)
- MONITOR suite health (flakiness, execution time)
Quick Regression Strategy:
- Per-commit: Smoke + changed code tests (5-10 min)
- Nightly: Extended regression (30-60 min)
- Pre-release: Full regression (2-4 hours)
Critical Success Factors:
- Smart selection catches 90% of regressions in 10% of time
- Flaky tests waste more time than they save
- Every production bug becomes a regression test </default_to_action>
Quick Reference Card
When to Use
- After any code change
- Before release
- After dependency updates
- After environment changes
Regression Types
| Type | When | Scope |
|---|---|---|
| Corrective | No code change | Full suite |
| Progressive | New features | Existing + new |
| Selective | Specific changes | Changed + dependent |
| Complete | Major refactor | Everything |
Test Selection Strategies
| Strategy | How | Reduction |
|---|---|---|
| Change-based | Git diff analysis | 70-90% |
| Risk-based | Priority by impact | 50-70% |
| Historical | Frequently failing | 40-60% |
| Time-budget | Fixed time window | Variable |
Change-Based Test Selection
// Analyze changed files and select impacted tests
function selectTests(changedFiles: string[]): string[] {
const testsToRun = new Set<string>();
for (const file of changedFiles) {
// Direct tests
testsToRun.add(`${file.replace('.ts', '.test.ts')}`);
// Dependent tests (via coverage mapping)
const dependentTests = testCoverage[file] || [];
dependentTests.forEach(t => testsToRun.add(t));
}
return Array.from(testsToRun);
}
// Example: payment.ts changed
// Runs: payment.test.ts, checkout.integration.test.ts, e2e/purchase.test.ts
Regression Suite Pyramid
/\
/ \ Full Regression (weekly)
/ \ - All tests (2-4 hours)
/------\
/ \ Extended Regression (nightly)
/ \ - Unit + integration + critical E2E (30-60 min)
/------------\
/ \ Quick Regression (per commit)
/________________\ - Changed code + smoke tests (5-10 min)
CI/CD Integration
# .github/workflows/regression.yml
jobs:
quick-regression:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Analyze changes
id: changes
uses: dorny/paths-filter@v2
with:
filters: |
payment:
- 'src/payment/**'
auth:
- 'src/auth/**'
- name: Run affected tests
run: npm run test:affected
- name: Smoke tests (always)
run: npm run test:smoke
nightly-regression:
if: github.event_name == 'schedule'
timeout-minutes: 120
steps:
- run: npm test -- --coverage
Optimization Techniques
// 1. Parallel execution
module.exports = {
maxWorkers: '50%', // Use half CPU cores
testTimeout: 30000
};
// 2. Sharding across CI workers
// npm test -- --shard=1/4
// 3. Incremental testing (only changed since last run)
// Track last run state, skip passing unchanged tests
// 4. Fast-fail on smoke
// Run critical tests first, abort if they fail
Agent-Driven Regression
// Smart test selection
await Task("Regression Analysis", {
pr: 1234,
strategy: 'change-based-with-risk',
timeBudget: '15min'
}, "qe-regression-risk-analyzer");
// Returns:
// {
// mustRun: ['payment.test.ts', 'checkout.integration.test.ts'],
// shouldRun: ['order.test.ts'],
// canSkip: ['profile.test.ts', 'search.test.ts'],
// estimatedTime: '12 min',
// riskCoverage: 0.94
// }
// Generate regression test from production bug
await Task("Bug Regression Test", {
bug: { id: 'BUG-567', description: 'Checkout fails > 100 items' },
preventRecurrence: true
}, "qe-test-generator");
Agent Coordination Hints
Memory Namespace
aqe/regression-testing/
├── test-selection/* - Impact analysis results
├── suite-health/* - Flakiness, timing trends
├── coverage-maps/* - Test-to-code mapping
└── bug-regressions/* - Tests from production bugs
Fleet Coordination
const regressionFleet = await FleetManager.coordinate({
strategy: 'comprehensive-regression',
agents: [
'qe-regression-risk-analyzer', // Analyze changes, select tests
'qe-test-executor', // Execute selected tests
'qe-coverage-analyzer', // Analyze coverage gaps
'qe-quality-gate' // Go/no-go decision
],
topology: 'sequential'
});
Related Skills
- risk-based-testing - Risk-based prioritization
- test-automation-strategy - Automation pyramid
- continuous-testing-shift-left - CI/CD integration
Remember
Regression testing is insurance against change. Every code change is a risk. Smart regression testing mitigates that risk by testing what matters based on what changed.
Good regression testing is strategic, not exhaustive. You cannot test everything, every time. Select based on changes, risk, and time budget.
With Agents: qe-regression-risk-analyzer provides intelligent test selection achieving 90% defect detection in 10% of execution time. Agents generate regression tests from production bugs automatically.
GitHub 仓库
相关推荐技能
Verification & Quality Assurance
其他该Skill为开发者提供自动化代码质量验证和可靠性保障系统,通过实时真值评分(0-1分制)和代码质量检查确保输出质量。当评分低于0.95阈值时会自动回滚问题代码,有效维护代码库稳定性。特别适合集成至CI/CD流程,用于监控Agent输出质量和保障项目可靠性。
test-automation-strategy
其他该Skill为开发者提供完整的测试自动化策略指导,涵盖测试金字塔设计、FIRST原则应用和CI/CD集成。它适用于构建新自动化框架或优化现有测试效率的场景,内置页面对象模式等最佳实践模板。通过结构化方法帮助团队建立可靠、可维护且与开发流程深度集成的自动化测试体系。
github-workflow-automation
其他这是一个为开发者提供的GitHub工作流自动化技能,通过AI群体协调实现智能CI/CD流水线和全面的仓库管理。它能自动生成和优化GitHub Actions工作流,支持多智能体协作进行代码分析、测试和部署。开发者可以用它快速建立自适应的工作流系统,提升开发效率和代码质量。
github-release-management
其他这个Skill为开发者提供基于AI集群协作的GitHub发布全流程自动化管理。它能自动处理版本管理、测试、部署和回滚等发布环节,特别适合需要协调多步骤发布的复杂CI/CD场景。通过集成GitHub CLI和可选的多AI协调工具,可以显著提升软件发布的效率和可靠性。
