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…
Об этом скилле
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:
- Untested Functions/Methods: Functions with zero test coverage
- Low Coverage Areas: Modules/functions below target threshold (85%+)
- Missing Edge Cases: Boundary conditions, error paths, null checks
- Integration Gaps: Component interactions not tested
- Error Path Coverage: Exception handling and failure modes
Analysis Process
Step 1: Codebase Scanning
The analyzer:
- Discovers all source code files in specified directory
- Identifies all functions, methods, and classes
- Maps code structure and dependencies
- Determines current test coverage (if available)
Step 2: Coverage Analysis
For each function/method:
- Check if tests exist
- Calculate line coverage if coverage data available
- Identify untested branches and paths
- Note error handling coverage
Step 3: Gap Identification
Classify gaps by:
- Risk Level: High/Medium/Low based on function complexity and criticality
- Type: Untested, partial coverage, missing edge cases
- Effort: Estimate time to write adequate tests
- Impact: How important this function is to system reliability
Step 4: Test Suggestion Generation
For each gap, generate:
- Specific test case descriptions
- Test templates with example code
- Edge cases to cover
- Expected behaviors
- Error conditions to test
Step 5: Prioritization
Organize suggestions by:
- Risk impact (critical functions first)
- Test pyramid distribution
- Effort required
- 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
.coveragefiles (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
`
Установить 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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic