Skip to content
Back to skills

Collection

ASecurity

Focus testing effort on highest-risk areas using risk assessment and prioritization. Use when planning test strategy, allocating testing resources, or making coverage decisions.

  • 24 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 8, 2026
code-qualitytypescriptgotestinggitdatabaseci/cdsecurityperformance

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add mattnigh/skills_collection --skill collection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Collection?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Collection
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mattnigh-collection-d1b26f15/badge)](https://www.skillsdirectory.com/skills/mattnigh-collection-d1b26f15)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: risk-based-testing
description: 'Focus testing effort on highest-risk areas using risk assessment and prioritization. Use when planning test strategy, allocating testing resources, or making coverage decisions.'
category: testing-methodologies
priority: high
tokenEstimate: 1000
agents:
  [qe-regression-risk-analyzer, qe-test-generator, qe-production-intelligence, qe-quality-gate]
implementation_status: optimized
optimization_version: 1.0
last_optimized: 2025-12-02
dependencies: []
quick_reference_card: true
tags: [risk, prioritization, test-planning, coverage, impact-analysis]
---

# Risk-Based Testing

<default_to_action>
When planning tests or allocating testing resources:

1. IDENTIFY risks: What can go wrong? What's the impact? What's the likelihood?
2. CALCULATE risk: Risk = Probability × Impact (use 1-5 scale for each)
3. PRIORITIZE: Critical (20+) → High (12-19) → Medium (6-11) → Low (1-5)
4. ALLOCATE effort: 60% critical, 25% high, 10% medium, 5% low
5. REASSESS continuously: New info, changes, production incidents

**Quick Risk Assessment:**

- Probability factors: Complexity, change frequency, developer experience, technical debt
- Impact factors: User count, revenue, safety, reputation, regulatory
- Dynamic adjustment: Production bugs increase risk; stable code decreases

**Critical Success Factors:**

- Test where bugs hurt most, not everywhere equally
- Risk is dynamic - reassess with new information
- Production data informs risk (shift-right feeds shift-left)
  </default_to_action>

## Quick Reference Card

### When to Use

- Planning sprint/release test strategy
- Deciding what to automate first
- Allocating limited testing time
- Justifying test coverage decisions

### Risk Calculation

```
Risk Score = Probability (1-5) × Impact (1-5)
```

| Score | Priority | Effort | Action                                     |
| ----- | -------- | ------ | ------------------------------------------ |
| 20-25 | Critical | 60%    | Comprehensive testing, multiple techniques |
| 12-19 | High     | 25%    | Thorough testing, automation priority      |
| 6-11  | Medium   | 10%    | Standard testing, basic automation         |
| 1-5   | Low      | 5%     | Smoke test, exploratory only               |

### Probability Factors

| Factor               | Low (1)               | Medium (3)      | High (5)                 |
| -------------------- | --------------------- | --------------- | ------------------------ |
| Complexity           | Simple CRUD           | Business logic  | Algorithms, integrations |
| Change Rate          | Stable 6+ months      | Monthly changes | Weekly/daily changes     |
| Developer Experience | Senior, domain expert | Mid-level       | Junior, new to codebase  |
| Technical Debt       | Clean code            | Some debt       | Legacy, no tests         |

### Impact Factors

| Factor         | Low (1)     | Medium (3) | High (5)          |
| -------------- | ----------- | ---------- | ----------------- |
| Users Affected | Admin only  | Department | All users         |
| Revenue        | None        | Indirect   | Direct (checkout) |
| Safety         | Convenience | Data loss  | Physical harm     |
| Reputation     | Internal    | Industry   | Public scandal    |

---

## Risk Assessment Workflow

### Step 1: List Features/Components

```
Feature | Probability | Impact | Risk | Priority
--------|-------------|--------|------|----------
Checkout | 4 | 5 | 20 | Critical
User Auth | 3 | 5 | 15 | High
Admin Panel | 2 | 2 | 4 | Low
Search | 3 | 3 | 9 | Medium
```

### Step 2: Apply Test Depth

```typescript
await Task(
  'Risk-Based Test Generation',
  {
    critical: {
      features: ['checkout', 'payment'],
      depth: 'comprehensive',
      techniques: ['unit', 'integration', 'e2e', 'performance', 'security'],
    },
    high: {
      features: ['auth', 'user-profile'],
      depth: 'thorough',
      techniques: ['unit', 'integration', 'e2e'],
    },
    medium: {
      features: ['search', 'notifications'],
      depth: 'standard',
      techniques: ['unit', 'integration'],
    },
    low: {
      features: ['admin-panel', 'settings'],
      depth: 'smoke',
      techniques: ['smoke-tests'],
    },
  },
  'qe-test-generator'
);
```

### Step 3: Reassess Dynamically

```typescript
// Production incident increases risk
await Task(
  'Update Risk Score',
  {
    feature: 'search',
    event: 'production-incident',
    previousRisk: 9,
    newProbability: 5, // Increased due to incident
    newRisk: 15, // Now HIGH priority
  },
  'qe-regression-risk-analyzer'
);
```

---

## ML-Enhanced Risk Analysis

```typescript
// Agent predicts risk using historical data
const riskAnalysis = await Task(
  'ML Risk Analysis',
  {
    codeChanges: changedFiles,
    historicalBugs: bugDatabase,
    prediction: {
      model: 'gradient-boosting',
      factors: ['complexity', 'change-frequency', 'author-experience', 'file-age'],
    },
  },
  'qe-regression-risk-analyzer'
);

// Output: 95% accuracy risk prediction per file
```

---

## Agent Coordination Hints

### Memory Namespace

```
aqe/risk-based/
├── risk-scores/*        - Current risk assessments
├── historical-bugs/*    - Bug patterns by area
├── production-data/*    - Incident data for risk
└── coverage-map/*       - Test depth by risk level
```

### Fleet Coordination

```typescript
const riskFleet = await FleetManager.coordinate({
  strategy: 'risk-based-testing',
  agents: [
    'qe-regression-risk-analyzer', // Risk scoring
    'qe-test-generator', // Risk-appropriate tests
    'qe-production-intelligence', // Production feedback
    'qe-quality-gate', // Risk-based gates
  ],
  topology: 'sequential',
});
```

---

## Integration with CI/CD

```yaml
# Risk-based test selection in pipeline
- name: Risk Analysis
  run: aqe risk-analyze --changes ${{ github.event.pull_request.files }}

- name: Run Critical Tests
  if: risk.critical > 0
  run: npm run test:critical

- name: Run High Tests
  if: risk.high > 0
  run: npm run test:high

- name: Skip Low Risk
  if: risk.low_only
  run: npm run test:smoke
```

---

## Related Skills

- [agentic-quality-engineering](../agentic-quality-engineering/) - Risk-aware agents
- [context-driven-testing](../context-driven-testing/) - Context affects risk
- [regression-testing](../regression-testing/) - Risk-based regression selection
- [shift-right-testing](../shift-right-testing/) - Production informs risk

---

## Remember

**Risk = Probability × Impact.** Test where bugs hurt most. Critical gets 60%, low gets 5%. Risk is dynamic - reassess with new info. Production incidents raise risk scores.

**With Agents:** Agents calculate risk using ML on historical data, select risk-appropriate tests, and adjust scores from production feedback. Use agents to maintain dynamic risk profiles at scale.

Files in this skill

  • 0Chan-smc__claude-code-workflow-lab__claude__skills__frontend-dev-guidelines__SKILL.md15.1 KB
  • 17hz__nextjs-template__claude__skills__example-skill__SKILL.md316 B
  • 1ambda__dataops-platform__claude__skills__context-synthesis__SKILL.md3.5 KB
  • 1natsu172__dotfiles__claude__skills__git-analysis__SKILL.md5.4 KB
  • 1natsu172__dotfiles__claude__skills__github-pr-best-practices__SKILL.md7.7 KB
  • 23Maestro__prospect-pipeline__claude__skills__npid-fastapi-skill.md26.1 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-javascript__SKILL.md15.7 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-python__SKILL.md17.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-expression-syntax__SKILL.md9.4 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-mcp-tools-expert__SKILL.md12.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-node-configuration__SKILL.md16.6 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-workflow-patterns__SKILL.md11.2 KB
  • 3x-Projetos__claude-memory-framework__claude__skills__scientist__SKILL.md14.8 KB
  • 5MinFutures__futures-arena__claude__skills__migration-tracker__SKILL.md16.2 KB
  • 5MinFutures__futures-arena__claude__skills__planning-guidelines__SKILL.md11.8 KB
  • 92Bilal26__TaskPilotAI__claude__skills__assessment-builder__SKILL.md17.5 KB
  • 92Bilal26__TaskPilotAI__claude__skills__book-scaffolding__SKILL.md19.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__code-validation-sandbox__SKILL.md6.2 KB
  • 92Bilal26__TaskPilotAI__claude__skills__exercise-designer__SKILL.md18.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__learning-objectives__SKILL.md24.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in code-quality →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.