feat: Add comprehensive test coverage assessment system

- Add CoverageAnalyzer class for analyzing functional test coverage against issues
- Intelligent requirement extraction from issue descriptions using regex patterns
- Automatic coverage gap detection with priority classification (critical/important/nice-to-have)
- Smart keyword matching between requirements and existing tests
- Comprehensive CLI interface with make test-coverage NUM=X command
- Detailed recommendations with specific test suggestions and TDD workflow guidance

Features:
- Extracts requirements from issue text patterns (user can, must, should, examples, etc.)
- Analyzes existing test files and methods for coverage keywords
- Calculates coverage percentage based on requirement-to-test matching
- Provides specific test name and file suggestions for gaps
- Prioritizes recommendations by requirement criticality
- Integrates with existing TDD workflow (tdd-start, tdd-add-test)

Usage: make test-coverage NUM=5
Example output shows 28.6% coverage for Issue #5 with specific gap recommendations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-23 03:35:20 +02:00
parent 386bafe130
commit f485b24a5a
4 changed files with 452 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ Provides workspace management, test generation, and issue integration.
from .workspace import WorkspaceManager, Workspace, WorkspaceStatus
from .issue_fetcher import IssueFetcher, Issue
from .test_generator import TestGenerator
from .coverage_analyzer import CoverageAnalyzer, CoverageAssessment, TestRequirement, CoverageGap
from .exceptions import TddaiError, WorkspaceError, IssueError, ConfigurationError, TestGenerationError
__version__ = "0.1.0"
@@ -18,6 +19,10 @@ __all__ = [
"IssueFetcher",
"Issue",
"TestGenerator",
"CoverageAnalyzer",
"CoverageAssessment",
"TestRequirement",
"CoverageGap",
"TddaiError",
"WorkspaceError",
"IssueError",