Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Test Debt Calculator

БесплатноБез исполняемых скриптовНе проверен

Quantify and prioritize test technical debt by analyzing coverage gaps, flaky test ratios, outdated assertions, and missing test categories across codebases.

PramodDuttaот PramodDutta★ 253 звезды на GitHub

Об этом скилле

Test Debt Calculator

Test technical debt is the accumulated cost of shortcuts, neglect, and decay in a test suite over time. Unlike application technical debt, test debt is insidious because it silently erodes confidence in deployments without producing visible bugs. A team with 80% code coverage might still have massive test debt if that coverage is concentrated on trivial paths, if 15% of tests are flaky, or if assertions are testing implementation details rather than behavior. This skill provides a systematic framework for quantifying test debt across multiple dimensions, prioritizing remediation efforts, and integrating debt tracking into your development workflow so that test quality improves continuously rather than degrading silently.

Core Principles

1. Test Debt Is Measurable

Test debt is not a vague feeling; it is a collection of concrete, measurable metrics. Coverage gaps, flaky test ratios, test execution time regression, assertion staleness, and missing test categories can all be quantified with automated tooling. The first step to reducing test debt is measuring it with precision.

2. Not All Debt Is Equal

A missing integration test for a payment processing endpoint is fundamentally different from a missing unit test for a string formatting utility. Test debt must be weighted by the risk and business impact of the uncovered or poorly covered code. A risk-weighted model ensures remediation effort goes where it matters most.

3. Debt Accumulates Compounding Interest

Ignoring test debt does not keep it constant; it grows. Flaky tests slow down CI, which encourages developers to skip tests, which creates more coverage gaps, which leads to more production bugs, which erodes trust in testing itself. Breaking this cycle requires proactive measurement and remediation before the debt compounds beyond the team's capacity to address it.

4. Track Trends, Not Snapshots

A single debt measurement tells you where you are. Trend data tells you where you are heading. Track test debt metrics over time to distinguish between "we have debt but it is shrinking" and "we have debt and it is growing." Trend direction is more important than absolute numbers.

5. Automate the Calculation

Manual test debt assessments happen infrequently and become outdated quickly. Automated calculation integrated into CI ensures that every pull request and every sprint has up-to-date debt metrics available without any manual effort.

Project Structure

test-debt-calculator/
  src/
    analyzers/
      coverage-analyzer.ts
      flaky-analyzer.ts
      staleness-analyzer.ts
      category-analyzer.ts
      complexity-analyzer.ts
      duration-analyzer.ts
    collectors/
      jest-collector.ts
      vitest-collector.ts
      pytest-collector.ts
    scoring/
      debt-scorer.ts
      risk-weights.ts
      priority-calculator.ts
    reporters/
      console-reporter.ts
      json-reporter.ts
      markdown-reporter.ts
      dashboard-reporter.ts
    config/
      debt-config.ts
      thresholds.ts
    index.ts
  scripts/
    calculate-debt.ts
    generate-report.ts
    compare-snapshots.ts
  tests/
    analyzers/
    scoring/
    reporters/
  package.json
  tsconfig.json
  debt-config.json

The src/analyzers/ directory contains one analyzer per debt dimension. The src/collectors/ directory provides framework-specific adapters for extracting raw data from Jest, Vitest, and Pytest. The src/scoring/ directory contains the composite scoring logic and risk weight configuration. The src/reporters/ directory formats debt reports for various output targets.

Debt Dimensions

Test debt is not a single number. It is a multi-dimensional assessment across these categories:

1. Coverage Gaps

Coverage gap analysis goes beyond simple percentage checks. It identifies which specific files and functions lack coverage, weights them by business risk, and produces a prioritized list of gaps to address:

// src/analyzers/coverage-analyzer.ts

interface CoverageGap {
  file: string;
  lineCoverage: number;
  branchCoverage: number;
  functionCoverage: number;
  uncoveredLines: number[];
  uncoveredBranches: string[];
  riskScore: number;
}

interface CoverageDebtReport {
  totalFiles: number;
  filesWithoutTests: number;
  averageLineCoverage: number;
  averageBranchCoverage: number;
  criticalGaps: CoverageGap[];
  debtScore: number;
}

interface CoverageData {
  [filePath: string]: {
    lines: { total: number; covered: number; pct: number };
    branches: { total: number; covered: number; pct: number };
    functions: { total: number; covered: number; pct: number };
    lineMap: Record<string, number>;
    branchMap: Record<string, [number, number]>;
  };
}

export function analyzeCoverageDebt(
  coverageData: CoverageData,
  riskWeights: Map<string, number>
): CoverageDebtReport {
  const gaps: CoverageGap[] = [];
  let totalLineCoverage = 0;
  let totalBranchCoverage = 0;
  let file
Полный SKILL.md на GitHub

Установить Test Debt Calculator в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Test Debt Calculator?

Quantify and prioritize test technical debt by analyzing coverage gaps, flaky test ratios, outdated assertions, and missing test categories across codebases.

Как установить скилл Test Debt Calculator?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Test Debt Calculator запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Test Debt Calculator с