Command Palette

Search for a command to run...

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

test-gap-analyzer

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

Analyzes code to identify untested functions, low coverage areas, and missing edge cases. Use when reviewing test coverage or planning test improvements…

rysweetот rysweet★ 77 звёзд на GitHub16 установок в других каталогах

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

Test Gap Analyzer Skill

Purpose

This skill automatically analyzes codebases to identify untested functions, low coverage areas, and missing edge case tests. It generates actionable test suggestions organized by priority and risk impact, following amplihack's testing pyramid (60% unit, 30% integration, 10% E2E).

When to Use This Skill

  • Code review: Before merging PRs, identify test gaps
  • Test planning: Prioritize what to test next based on risk
  • Coverage improvement: Target low-coverage areas systematically
  • Edge case discovery: Find untested failure modes and boundaries
  • New modules: Ensure comprehensive test coverage before release
  • Legacy code: Incrementally improve test coverage
  • Refactoring: Verify coverage before and after changes

Core Concepts

Testing Pyramid in Amplihack

Tests should follow this distribution:

  • 60% Unit Tests: Individual function/method behavior with mocked dependencies
  • 30% Integration Tests: Multiple components working together
  • 10% E2E Tests: Full user workflows end-to-end

This skill helps balance tests across these layers while prioritizing coverage.

Gap Analysis Categories

The skill identifies gaps in these areas:

  1. Untested Functions/Methods: Functions with zero test coverage
  2. Low Coverage Areas: Modules/functions below target threshold (85%+)
  3. Missing Edge Cases: Boundary conditions, error paths, null checks
  4. Integration Gaps: Component interactions not tested
  5. Error Path Coverage: Exception handling and failure modes

Analysis Process

Step 1: Codebase Scanning

The analyzer:

  1. Discovers all source code files in specified directory
  2. Identifies all functions, methods, and classes
  3. Maps code structure and dependencies
  4. Determines current test coverage (if available)

Step 2: Coverage Analysis

For each function/method:

  1. Check if tests exist
  2. Calculate line coverage if coverage data available
  3. Identify untested branches and paths
  4. Note error handling coverage

Step 3: Gap Identification

Classify gaps by:

  1. Risk Level: High/Medium/Low based on function complexity and criticality
  2. Type: Untested, partial coverage, missing edge cases
  3. Effort: Estimate time to write adequate tests
  4. Impact: How important this function is to system reliability

Step 4: Test Suggestion Generation

For each gap, generate:

  1. Specific test case descriptions
  2. Test templates with example code
  3. Edge cases to cover
  4. Expected behaviors
  5. Error conditions to test

Step 5: Prioritization

Organize suggestions by:

  1. Risk impact (critical functions first)
  2. Test pyramid distribution
  3. Effort required
  4. Dependency relationships

Skill Capabilities

Code Analysis

  • Scans Python, JavaScript, TypeScript, Go codebases
  • Identifies all public and private functions
  • Detects complex functions needing more tests
  • Maps function dependencies
  • Finds unused parameters and dead code paths

Coverage Detection

  • Parses .coverage files (Python)
  • Analyzes coverage.json reports
  • Identifies uncovered branches
  • Finds partially tested functions
  • Detects coverage threshold violations

Test Gap Discovery

  • Functions with zero tests
  • Branches never executed
  • Error paths untested
  • Boundary conditions missed
  • Integration points not covered
  • Timeout scenarios missing
  • Resource exhaustion cases

Edge Case Identification

  • Null/None inputs
  • Empty collections
  • Boundary values (0, max_int, etc.)
  • Unicode/multibyte strings
  • Concurrency issues
  • Resource limits
  • Type mismatches
  • Async/await patterns

Test Template Generation

Provides ready-to-use test templates for:

  • Unit tests (mocked dependencies)
  • Integration tests (real components)
  • E2E tests (full workflows)
  • Parametrized tests
  • Property-based tests
  • Performance tests

Usage Examples

Example 1: Analyze Python Project

User: Analyze test coverage gaps in my src/ directory

Claude:
1. Scans src/ for all Python files
2. Reads .coverage or uses ast analysis
3. Identifies untested functions
4. Generates gap report with suggestions

Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Test Gap Analysis Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Summary:
- Total functions: 145
- Untested: 23 (16%)
- Low coverage (< 85%): 34 (23%)

CRITICAL GAPS (High Risk):
1. payment_processor.py::process_payment()
   - Untested | Handles money | 15 min effort
   - Suggested tests:
     - Valid payment processing
     - Insufficient funds error
     - Payment timeout
     - Currency conversion

MEDIUM GAPS:
2. user_service.py::validate_email()
   - 40% coverage | Missing edge cases
   - Suggested tests:
     - Unicode characters
     - Long email addresses
     - Special characters

LOW GAPS:
3. utils.py::format_date()
   - 60% coverage
   - Suggested tests:
     - Timezone handling
     - Daylight saving transitions

Example 2: Get Test Templates

`

Полный SKILL.md на GitHub

Установить test-gap-analyzer в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл test-gap-analyzer?

Analyzes code to identify untested functions, low coverage areas, and missing edge cases. Use when reviewing test coverage or planning test improvements. Generates specific test suggestions with example templates following amplihack's testing pyramid (60% unit, 30% integration, 10% E2E). Can use coverage.py for Python projects.

Как установить скилл test-gap-analyzer?

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

Скилл test-gap-analyzer запускает скрипты?

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

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

Сравнить test-gap-analyzer с