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

@@ -1,7 +1,7 @@
# MarkiTect - Advanced Markdown Engine
# Makefile for common development tasks
.PHONY: help setup install test build clean update status dev lint format check-deps venv-status update-digest add-diary-entry list-issues show-issue list-open-issues test-from-issue tdd-start tdd-add-test tdd-finish tdd-status test-status test-new
.PHONY: help setup install test build clean update status dev lint format check-deps venv-status update-digest add-diary-entry list-issues show-issue list-open-issues test-from-issue tdd-start tdd-add-test tdd-finish tdd-status test-status test-new test-coverage
# Default target
help:
@@ -21,6 +21,7 @@ help:
@echo " test - Run all tests"
@echo " test-status - Show test status summary without re-running"
@echo " test-new - Create new test file template"
@echo " test-coverage NUM=X - Analyze test coverage for issue"
@echo " build - Build the package"
@echo " lint - Run code linting"
@echo " format - Format code"
@@ -398,3 +399,11 @@ test-new: $(VENV)/bin/activate
echo " 2. Run: make test to check if it works"; \
echo " 3. Implement the actual functionality"; \
echo " 4. Run tests again to verify (TDD cycle)"
# Analyze test coverage for a specific issue
test-coverage: $(VENV)/bin/activate
@if [ -z "$(NUM)" ]; then \
echo "❌ Please specify issue number: make test-coverage NUM=5"; \
exit 1; \
fi
@PYTHONPATH=. $(VENV_PYTHON) tddai_cli.py analyze-coverage $(NUM)