qe-coverage-analysis

Analyzes test coverage data (Istanbul, c8, lcov) to identify uncovered lines, branches, and functions with risk-weighted gap detection. Use when analyzing coverage reports, identifying coverage gaps, comparing coverage between branches, or prioritizing which untested code to cover first.

Best use case

qe-coverage-analysis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Analyzes test coverage data (Istanbul, c8, lcov) to identify uncovered lines, branches, and functions with risk-weighted gap detection. Use when analyzing coverage reports, identifying coverage gaps, comparing coverage between branches, or prioritizing which untested code to cover first.

Teams using qe-coverage-analysis should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/qe-coverage-analysis/SKILL.md --create-dirs "https://raw.githubusercontent.com/proffesor-for-testing/agentic-qe/main/.claude/skills/qe-coverage-analysis/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/qe-coverage-analysis/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How qe-coverage-analysis Compares

Feature / Agentqe-coverage-analysisStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Analyzes test coverage data (Istanbul, c8, lcov) to identify uncovered lines, branches, and functions with risk-weighted gap detection. Use when analyzing coverage reports, identifying coverage gaps, comparing coverage between branches, or prioritizing which untested code to cover first.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# QE Coverage Analysis

## Purpose

Guide the use of v3's advanced coverage analysis capabilities including sublinear gap detection algorithms, risk-weighted coverage scoring, and intelligent test prioritization based on code criticality.

## Activation

- When analyzing test coverage
- When identifying coverage gaps
- When prioritizing testing effort
- When setting coverage targets
- When assessing code risk

## Quick Start

```bash
# Analyze coverage with gap detection
aqe coverage analyze --source src/ --tests tests/

# Find high-risk uncovered code
aqe coverage gaps --risk-weighted --threshold 80

# Generate coverage report
aqe coverage report --format html --output coverage-report/

# Compare coverage between branches
aqe coverage diff --base main --head feature-branch
```

## Agent Workflow

```typescript
// Comprehensive coverage analysis
Task("Analyze coverage gaps", `
  Perform O(log n) coverage analysis on src/:
  - Calculate statement, branch, function coverage
  - Identify uncovered critical paths
  - Risk-weight gaps by code complexity and change frequency
  - Recommend tests to write for maximum coverage impact
`, "qe-coverage-specialist")

// Risk-based prioritization
Task("Prioritize coverage effort", `
  Analyze coverage gaps and prioritize by:
  - Business criticality (payment, auth, data)
  - Code complexity (cyclomatic > 10)
  - Recent bug history
  - Change frequency
  Output prioritized list of files needing tests.
`, "qe-coverage-analyzer")
```

## Analysis Strategies

### 1. Sublinear Gap Detection

```typescript
await coverageAnalyzer.detectGaps({
  algorithm: 'sublinear',  // O(log n) complexity
  source: 'src/**/*.ts',
  metrics: ['statement', 'branch', 'function'],
  sampling: {
    enabled: true,
    confidence: 0.95,
    maxSamples: 1000
  }
});
```

### 2. Risk-Weighted Coverage

```typescript
await coverageAnalyzer.riskWeightedAnalysis({
  coverage: coverageReport,
  riskFactors: {
    complexity: { weight: 0.3, threshold: 10 },
    changeFrequency: { weight: 0.25, window: '90d' },
    bugHistory: { weight: 0.25, window: '180d' },
    criticality: { weight: 0.2, tags: ['payment', 'auth'] }
  },
  output: {
    riskScore: true,
    prioritizedGaps: true
  }
});
```

### 3. Differential Coverage

```typescript
await coverageAnalyzer.diffCoverage({
  base: 'main',
  head: 'feature-branch',
  requirements: {
    newCode: 80,           // New code must have 80% coverage
    modifiedCode: 'maintain',  // Don't decrease existing
    deletedCode: 'ignore'
  }
});
```

## Coverage Thresholds

```yaml
thresholds:
  global:
    statements: 80
    branches: 75
    functions: 85
    lines: 80

  per_file:
    min_statements: 70
    critical_paths: 90

  new_code:
    statements: 85
    branches: 80

  exceptions:
    - path: "src/migrations/**"
      reason: "Database migrations"
    - path: "src/generated/**"
      reason: "Auto-generated code"
```

## Coverage Report

```typescript
interface CoverageAnalysis {
  summary: {
    statements: { covered: number; total: number; percentage: number };
    branches: { covered: number; total: number; percentage: number };
    functions: { covered: number; total: number; percentage: number };
  };
  gaps: {
    file: string;
    uncoveredLines: number[];
    uncoveredBranches: BranchInfo[];
    riskScore: number;
    suggestedTests: string[];
  }[];
  trends: {
    period: string;
    coverageChange: number;
    newGaps: number;
    closedGaps: number;
  };
  recommendations: {
    priority: 'critical' | 'high' | 'medium' | 'low';
    file: string;
    action: string;
    expectedImpact: number;
  }[];
}
```

## Quality Gates

```yaml
quality_gates:
  coverage:
    block_merge:
      - new_code_coverage < 80
      - coverage_regression > 5
      - critical_path_uncovered

    warn:
      - overall_coverage < 75
      - branch_coverage < 70

    metrics:
      - track_trends: true
      - alert_on_decline: 3  # consecutive PRs
```

## Run History

After each coverage analysis, append results to `run-history.json` in this skill directory:
```bash
# Read current history, append new entry, write back
node -e "
const fs = require('fs');
const h = JSON.parse(fs.readFileSync('.claude/skills/qe-coverage-analysis/run-history.json'));
h.runs.push({date: new Date().toISOString().split('T')[0], statements_pct: STATEMENTS, branches_pct: BRANCHES, gaps_found: GAPS});
fs.writeFileSync('.claude/skills/qe-coverage-analysis/run-history.json', JSON.stringify(h, null, 2));
"
```
Read `run-history.json` before each run to detect trends (e.g., "coverage dropped 3 consecutive times").

## Skill Composition

- **Coverage dropped?** → Use `/coverage-drop-investigator` to trace the cause
- **Need more tests** → Use `/qe-test-generation` to fill gaps
- **Validate quality** → Use `/mutation-testing` to ensure coverage means quality
- **Ship decision** → Feed into `/qe-quality-assessment` for deployment readiness

## Gotchas

- High line coverage does NOT mean good tests — 100% coverage with 0% assertions is common agent output. Use mutation testing to verify
- coverage-analysis domain has 86% success rate — 14% of runs fail on initialization. Always verify results and have fallback plan (e.g. manual coverage tools)
- Self-learning pipeline may silently stop learning (statusline frozen for days) — only human inspection catches this

## Coordination

**Primary Agents**: qe-coverage-specialist, qe-coverage-analyzer, qe-gap-detector
**Coordinator**: qe-coverage-coordinator
**Related Skills**: qe-test-generation, qe-quality-assessment

Related Skills

qe-performance-analysis

298
from proffesor-for-testing/agentic-qe

Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms

coverage-guard

298
from proffesor-for-testing/agentic-qe

Use when you want to prevent coverage regressions during development. Activate with /coverage-guard to warn when coverage drops below threshold after code changes.

coverage-drop-investigator

298
from proffesor-for-testing/agentic-qe

Use when test coverage has dropped and you need to find which changes caused it and what tests to add. Traces coverage regressions to specific commits and files.

qe-visual-testing-advanced

298
from proffesor-for-testing/agentic-qe

Advanced visual regression testing with pixel-perfect comparison, AI-powered diff analysis, responsive design validation, and cross-browser visual consistency. Use when detecting UI regressions, validating designs, or ensuring visual consistency.

qe-verification-quality

298
from proffesor-for-testing/agentic-qe

Comprehensive truth scoring, code quality verification, and automatic rollback system with 0.95 accuracy threshold for ensuring high-quality agent outputs and codebase reliability.

qe-testability-scoring

298
from proffesor-for-testing/agentic-qe

AI-powered testability assessment using 10 principles of intrinsic testability with Playwright and optional Vibium integration. Evaluates web applications against Observability, Controllability, Algorithmic Simplicity, Transparency, Stability, Explainability, Unbugginess, Smallness, Decomposability, and Similarity. Use when assessing software testability, evaluating test readiness, identifying testability improvements, or generating testability reports.

qe-test-reporting-analytics

298
from proffesor-for-testing/agentic-qe

Advanced test reporting, quality dashboards, predictive analytics, trend analysis, and executive reporting for QE metrics. Use when communicating quality status, tracking trends, or making data-driven decisions.

qe-test-idea-rewriting

298
from proffesor-for-testing/agentic-qe

Transform passive 'Verify X' test descriptions into active, observable test actions. Use when test ideas lack specificity, use vague language, or fail quality validation. Converts to action-verb format for clearer, more testable descriptions.

qe-test-environment-management

298
from proffesor-for-testing/agentic-qe

Test environment provisioning, infrastructure as code for testing, Docker/Kubernetes for test environments, service virtualization, and cost optimization. Use when managing test infrastructure, ensuring environment parity, or optimizing testing costs.

qe-test-design-techniques

298
from proffesor-for-testing/agentic-qe

Systematic test design with boundary value analysis, equivalence partitioning, decision tables, state transition testing, and combinatorial testing. Use when designing comprehensive test cases, reducing redundant tests, or ensuring systematic coverage.

qe-test-data-management

298
from proffesor-for-testing/agentic-qe

Strategic test data generation, management, and privacy compliance. Use when creating test data, handling PII, ensuring GDPR/CCPA compliance, or scaling data generation for realistic testing scenarios.

qe-test-automation-strategy

298
from proffesor-for-testing/agentic-qe

Design and implement effective test automation with proper pyramid, patterns, and CI/CD integration. Use when building automation frameworks or improving test efficiency.