[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EM75PMTMXYZ49S0HANVJC1":3,"skill-same:01M6EM75PMTMXYZ49S0HANVJC1":98},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":46,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6EM75PMTMXYZ49S0HANVJC1","coverage-analyzer",null,"Advanced coverage analysis with actionable insights. Use to identify coverage gaps, suggest specific tests, track coverage trends, and highlight critical uncovered code. Essential for reaching 80%+ coverage target.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Fcoverage-analyzer\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[24,25,26,27,28,29,30,31,32,33,34,35],"coverage","coverage analyzer","coverage analysis","coverage gaps","code","analysis","use","essential","tests","critical","trends","actionable","2026-11-10 10:12:30",false,"---\nname: coverage-analyzer\ndescription: Advanced coverage analysis with actionable insights. Use to identify coverage gaps, suggest specific tests, track coverage trends, and highlight critical uncovered code. Essential for reaching 80%+ coverage target.\n---\n\n# Coverage Analyzer\n\n## ⚠️ MANDATORY: Read Project Documentation First\n\n**BEFORE starting coverage analysis, you MUST read and understand the following project documentation:**\n\n### Core Project Documentation\n\n1. **README.md** - Project overview, features, and getting started\n2. **AI_DOCS\u002Fproject-context.md** - Tech stack, architecture, development workflow\n3. **AI_DOCS\u002Fcode-conventions.md** - Code style, formatting, best practices\n4. **AI_DOCS\u002Ftdd-workflow.md** - TDD process, testing standards, coverage requirements\n\n### Session Context (if available)\n\n5. **.ai-context\u002FACTIVE_TASKS.md** - Current tasks and priorities\n6. **.ai-context\u002FCONVENTIONS.md** - Project-specific conventions\n7. **.ai-context\u002FRECENT_DECISIONS.md** - Recent architectural decisions\n8. **.ai-context\u002FLAST_SESSION_SUMMARY.md** - Previous session summary\n\n### Additional AI Documentation\n\n9. **AI_DOCS\u002Fai-tools.md** - Session management workflow\n10. **AI_DOCS\u002Fai-skills.md** - Other specialized skills\u002Fagents available\n\n### Why This Matters\n\n- **Coverage Requirements**: Understand project-specific coverage thresholds (80%+ minimum)\n- **Testing Patterns**: Follow established testing conventions when suggesting tests\n- **Code Context**: Understand module structure and dependencies\n- **Recent Changes**: Be aware of recent test additions or coverage improvements\n\n**After reading these files, proceed with your coverage analysis task below.**\n\n---\n\n## Overview\n\nProvide advanced test coverage analysis with actionable insights for improving coverage to meet the 80%+ requirement.\n\n## When to Use\n\n- After running `make coverage` to understand gaps\n- Before completing a feature (ensure adequate coverage)\n- When coverage is below 80% target\n- To identify critical uncovered code paths\n- For tracking coverage trends over time\n\n## What This Skill Provides\n\n✅ **Detailed Coverage Analysis**\n- Current coverage percentage\n- Uncovered lines by file\n- Missing branches\n\n✅ **Actionable Recommendations**\n- Specific tests to write\n- Code locations needing tests\n- Priority of coverage gaps\n\n✅ **Coverage Gaps Identification**\n- Critical uncovered paths (error handling)\n- Edge cases not tested\n- Integration points missing tests\n\n✅ **Test Suggestions**\n- Concrete test code recommendations\n- Parametrized test suggestions\n- Fixture recommendations\n\n✅ **Trend Tracking**\n- Coverage history over time\n- Improvement\u002Fregression detection\n- Progress toward 80%+ goal\n\n## Usage Examples\n\n### Analyze Current Coverage\n\n```bash\n# Generate detailed coverage analysis\nanalyze test coverage\n```\n\n**Output:** Comprehensive report with gaps and recommendations\n\n### Find Critical Gaps\n\n```bash\n# Focus on critical uncovered code\nshow critical coverage gaps\n```\n\n**Output:** High-priority uncovered code (error handling, security, edge cases)\n\n### Get Test Suggestions\n\n```bash\n# Get specific test recommendations\nsuggest tests for uncovered code in src\u002Fpython_modern_template\u002Fvalidators.py\n```\n\n**Output:** Concrete test cases to add\n\n### Track Coverage Trends\n\n```bash\n# See coverage over time\nshow coverage trend for last month\n```\n\n**Output:** Graph showing coverage changes\n\n## Step-by-Step Analysis Process\n\n### Step 1: Run Coverage\n\n```bash\n# Generate coverage report\nmake coverage\n```\n\nThis creates:\n- Terminal output with overall percentage\n- HTML report in `htmlcov\u002F`\n- `.coverage` data file\n\n### Step 2: Parse Coverage Data\n\nRead coverage data from multiple sources:\n\n```bash\n# Read terminal output for overall stats\n# Read htmlcov\u002Findex.html for detailed breakdown\n# Parse .coverage file for line-by-line data\n```\n\n### Step 3: Identify Uncovered Lines\n\nFor each source file:\n- List uncovered line numbers\n- Group by type (functions, error handling, edge cases)\n- Prioritize by criticality\n\n### Step 4: Analyze Context\n\nFor each uncovered section:\n- Read surrounding code\n- Understand what the code does\n- Identify why it's not covered\n- Determine appropriate test type\n\n### Step 5: Generate Recommendations\n\nCreate specific test suggestions:\n- Test function name\n- Test scenario\n- Example test code\n- Parameters to test\n\n### Step 6: Calculate Priority\n\n**CRITICAL** - Must cover immediately:\n- Error handling paths\n- Security-related code\n- Data validation\n- Authorization checks\n\n**HIGH** - Should cover soon:\n- Edge cases\n- Boundary conditions\n- Integration points\n- Public API functions\n\n**MEDIUM** - Good to cover:\n- Internal helper functions\n- Logging statements\n- Configuration parsing\n\n**LOW** - Optional:\n- Debug code\n- Development-only paths\n- Deprecated functions\n\n## Analysis Report Format\n\n```markdown\n# Test Coverage Analysis\n\n## Executive Summary\n\n**Current Coverage:** 75.3%\n**Target:** 80%+\n**Gap:** 4.7% (23 uncovered lines)\n**Status:** ⚠️ Below target\n\n**Breakdown:**\n- src\u002Fpython_modern_template\u002F: 73.2% (18 uncovered lines)\n- tests\u002F: 100% (fully covered)\n\n---\n\n## Critical Gaps (MUST FIX)\n\n### 1. Error Handling in validators.py ⚠️ CRITICAL\n\n**File:** src\u002Fpython_modern_template\u002Fvalidators.py\n**Lines:** 45-52 (8 lines)\n**Function:** `validate_email()`\n\n**Uncovered Code:**\n```python\n45: except ValueError as e:\n46:     logger.error(f\"Email validation failed: {e}\")\n47:     raise ValidationError(\n48:         \"Invalid email format\"\n49:     ) from e\n50: except Exception:\n51:     logger.critical(\"Unexpected validation error\")\n52:     return False\n```\n\n**Why Critical:** Error handling paths are not tested, could hide bugs\n\n**Recommended Test:**\n```python\ndef test_validate_email_value_error_handling() -> None:\n    \"\"\"Test email validation handles ValueError correctly.\"\"\"\n    # Arrange\n    invalid_email = \"not-an-email\"\n\n    # Act & Assert\n    with pytest.raises(ValidationError) as exc_info:\n        validate_email(invalid_email)\n\n    assert \"Invalid email format\" in str(exc_info.value)\n    assert exc_info.value.__cause__ is not None\n\ndef test_validate_email_unexpected_error_handling() -> None:\n    \"\"\"Test email validation handles unexpected errors.\"\"\"\n    # Arrange\n    # Mock to raise unexpected exception\n    with patch('validators.EMAIL_REGEX.match', side_effect=RuntimeError(\"Unexpected\")):\n        # Act\n        result = validate_email(\"test@example.com\")\n\n        # Assert\n        assert result is False\n```\n\n**Impact:** Covers 8 lines, adds 3.5% coverage\n\n---\n\n### 2. Edge Case in parser.py ⚠️ CRITICAL\n\n**File:** src\u002Fpython_modern_template\u002Fparser.py\n**Lines:** 67-70 (4 lines)\n**Function:** `parse_config()`\n\n**Uncovered Code:**\n```python\n67: if not config_data:\n68:     logger.warning(\"Empty configuration provided\")\n69:     return DEFAULT_CONFIG\n70:     # Unreachable line removed\n```\n\n**Why Critical:** Edge case handling not tested\n\n**Recommended Test:**\n```python\ndef test_parse_config_empty_data() -> None:\n    \"\"\"Test parser handles empty configuration.\"\"\"\n    # Arrange\n    empty_config = {}\n\n    # Act\n    result = parse_config(empty_config)\n\n    # Assert\n    assert result == DEFAULT_CONFIG\n\ndef test_parse_config_none_data() -> None:\n    \"\"\"Test parser handles None configuration.\"\"\"\n    # Arrange\n    # Act\n    result = parse_config(None)\n\n    # Assert\n    assert result == DEFAULT_CONFIG\n```\n\n**Impact:** Covers 4 lines, adds 1.7% coverage\n\n---\n\n## High Priority Gaps\n\n### 3. Integration Point in api_client.py\n\n**File:** src\u002Fpython_modern_template\u002Fapi_client.py\n**Lines:** 112-118 (7 lines)\n**Function:** `retry_with_backoff()`\n\n**Uncovered Code:**\n```python\n112: @retry(max_attempts=3, backoff=2.0)\n113: def retry_with_backoff(self, operation: Callable) -> Any:\n114:     \"\"\"Retry operation with exponential backoff.\"\"\"\n115:     try:\n116:         return operation()\n117:     except ConnectionError:\n118:         logger.warning(\"Connection failed, retrying...\")\n```\n\n**Why High:** Integration logic with retry mechanism\n\n**Recommended Test:**\n```python\n@pytest.mark.parametrize(\"attempt,should_succeed\", [\n    (1, True),  # Succeeds first try\n    (2, True),  # Succeeds second try\n    (3, True),  # Succeeds third try\n    (4, False), # Fails after max attempts\n])\ndef test_retry_with_backoff(attempt: int, should_succeed: bool) -> None:\n    \"\"\"Test retry mechanism with various scenarios.\"\"\"\n    # Arrange\n    client = APIClient()\n    call_count = 0\n\n    def flaky_operation():\n        nonlocal call_count\n        call_count += 1\n        if call_count \u003C attempt:\n            raise ConnectionError(\"Connection failed\")\n        return \"success\"\n\n    # Act & Assert\n    if should_succeed:\n        result = client.retry_with_backoff(flaky_operation)\n        assert result == \"success\"\n        assert call_count == attempt\n    else:\n        with pytest.raises(ConnectionError):\n            client.retry_with_backoff(flaky_operation)\n```\n\n**Impact:** Covers 7 lines, adds 3.0% coverage\n\n---\n\n## Coverage By Module\n\n| Module | Coverage | Uncovered Lines | Priority |\n|--------|----------|----------------|----------|\n| validators.py | 65% | 12 | CRITICAL |\n| parser.py | 80% | 4 | HIGH |\n| api_client.py | 75% | 7 | HIGH |\n| utils.py | 95% | 1 | LOW |\n\n**Total:** 75.3% (23 uncovered lines)\n\n---\n\n## Quick Win Recommendations\n\nThese tests would quickly boost coverage:\n\n1. **Add error handling tests** (validators.py)\n   - +3.5% coverage\n   - 10 minutes to write\n\n2. **Add edge case tests** (parser.py)\n   - +1.7% coverage\n   - 5 minutes to write\n\n3. **Add integration tests** (api_client.py)\n   - +3.0% coverage\n   - 15 minutes to write\n\n**Total Impact:** +8.2% coverage (reaching 83.5%)\n**Total Time:** ~30 minutes\n\n---\n\n## Coverage Trend\n\n```\nWeek 1: 70% ███████░░░\nWeek 2: 72% ███████▓░░\nWeek 3: 75% ████████░░\nWeek 4: 75% ████████░░  ← Current (stalled)\n\nTarget: 80% ████████▓░\n```\n\n**Trend:** +5% over 3 weeks, then stalled\n**Recommendation:** Focus on quick wins above to break through 80%\n\n---\n\n## Detailed File Analysis\n\n### src\u002Fpython_modern_template\u002Fvalidators.py (65% coverage)\n\n**Covered:**\n- Basic email validation (happy path)\n- URL validation (happy path)\n- Phone number validation\n\n**Not Covered:**\n- Error handling (lines 45-52)\n- Edge cases (empty strings, None)\n- Invalid format handling\n\n**Missing Test Types:**\n- Parametrized tests for invalid inputs\n- Exception handling tests\n- Edge case tests\n\n### src\u002Fpython_modern_template\u002Fparser.py (80% coverage)\n\n**Covered:**\n- Standard config parsing\n- Type conversion\n- Default value handling\n\n**Not Covered:**\n- Empty config handling (lines 67-70)\n\n**Missing Test Types:**\n- Edge case tests (empty, None)\n\n### src\u002Fpython_modern_template\u002Fapi_client.py (75% coverage)\n\n**Covered:**\n- Basic API calls\n- Authentication\n- Response parsing\n\n**Not Covered:**\n- Retry logic (lines 112-118)\n- Connection error handling\n- Backoff mechanism\n\n**Missing Test Types:**\n- Integration tests with retries\n- Failure scenario tests\n\n---\n\n## Next Steps\n\n### Immediate Actions (30 minutes)\n\n1. **Add error handling tests to validators.py**\n   ```bash\n   # Edit tests\u002Ftest_validators.py\n   # Add test_validate_email_value_error_handling()\n   # Add test_validate_email_unexpected_error_handling()\n   ```\n\n2. **Add edge case tests to parser.py**\n   ```bash\n   # Edit tests\u002Ftest_parser.py\n   # Add test_parse_config_empty_data()\n   # Add test_parse_config_none_data()\n   ```\n\n3. **Add integration tests to api_client.py**\n   ```bash\n   # Edit tests\u002Ftest_api_client.py\n   # Add test_retry_with_backoff()\n   ```\n\n4. **Run coverage again**\n   ```bash\n   make coverage\n   ```\n\n**Expected Result:** 83.5% coverage (exceeds 80% target!)\n\n### Verify Implementation\n\n```bash\n# Run tests to ensure they fail (TDD)\nmake test\n\n# Verify uncovered code is exercised\n# Fix any test issues\n# Re-run coverage\nmake coverage\n\n# Should see 80%+ coverage\n```\n\n---\n\n## Additional Recommendations\n\n### Use Parametrized Tests\n\nFor multiple similar test cases:\n\n```python\n@pytest.mark.parametrize(\"email,valid\", [\n    (\"test@example.com\", True),\n    (\"invalid-email\", False),\n    (\"\", False),\n    (None, False),\n    (\"test@\", False),\n    (\"@example.com\", False),\n])\ndef test_validate_email_parametrized(email: str | None, valid: bool) -> None:\n    \"\"\"Test email validation with various inputs.\"\"\"\n    if valid:\n        assert validate_email(email) is True\n    else:\n        assert validate_email(email) is False\n```\n\n### Use Fixtures for Common Setup\n\n```python\n@pytest.fixture\ndef sample_config():\n    \"\"\"Provide sample configuration for tests.\"\"\"\n    return {\n        \"api_url\": \"https:\u002F\u002Fapi.example.com\",\n        \"timeout\": 30,\n        \"retries\": 3,\n    }\n\ndef test_parse_config_with_defaults(sample_config):\n    \"\"\"Test config parsing with defaults.\"\"\"\n    result = parse_config(sample_config)\n    assert result[\"timeout\"] == 30\n```\n\n### Focus on Critical Paths\n\nPriority order:\n1. Error handling (catch exceptions)\n2. Edge cases (empty, None, invalid)\n3. Security checks (validation, authorization)\n4. Integration points (API calls, database)\n5. Business logic\n6. Utility functions\n\n---\n\n## Coverage Best Practices\n\n1. **Write tests FIRST (TDD)** - Coverage comes naturally\n2. **Test behavior, not implementation** - Focus on what, not how\n3. **Use real code over mocks** - Only mock external dependencies\n4. **Aim for 100% of new code** - Don't lower the bar\n5. **Track trends** - Ensure coverage doesn't regress\n6. **Review uncovered code regularly** - Don't let gaps accumulate\n\n---\n\n## Integration with Quality Tools\n\n### With make check\n\n```bash\n# Coverage is part of quality gates\nmake check\n\n# Must pass 80%+ coverage requirement\n```\n\n### With TDD Reviewer\n\n```bash\n# TDD reviewer checks coverage compliance\n[tdd-reviewer]\n\n# Includes coverage verification\n```\n\n### With Coverage Command\n\n```bash\n# Generate HTML report\nmake coverage\n\n# View in browser\nopen htmlcov\u002Findex.html\n```\n\n---\n\n## Remember\n\n> \"Coverage percentage is a measure, not a goal.\"\n> \"Aim for meaningful tests, not just high numbers.\"\n\n**Good coverage means:**\n- ✅ Critical paths tested\n- ✅ Error handling verified\n- ✅ Edge cases covered\n- ✅ Integration points tested\n\n**Bad coverage means:**\n- ❌ Tests just to hit lines\n- ❌ Meaningless assertions\n- ❌ Over-mocking everything\n- ❌ Ignoring critical gaps\n\nFocus on **quality coverage**, not just quantity!\n```\n\n## Advanced Features\n\n### Historical Tracking\n\nStore coverage data over time:\n\n```bash\n# Save current coverage\necho \"$(date +%Y-%m-%d),$(coverage report | grep TOTAL | awk '{print $4}')\" >> .coverage_history\n\n# View trend\ncat .coverage_history\n```\n\n### Per-Module Breakdown\n\nAnalyze each module separately:\n\n```bash\n# Get coverage for specific module\ncoverage report --include=\"src\u002Fpython_modern_template\u002Fvalidators.py\"\n```\n\n### Branch Coverage\n\nNot just line coverage, but branch coverage:\n\n```bash\n# Enable branch coverage in pyproject.toml\n[tool.pytest.ini_options]\nbranch = true\n\n# Shows uncovered branches (if\u002Felse not both tested)\n```\n\n### Diff Coverage\n\nFocus on changed lines only:\n\n```bash\n# Install diff-cover\npip install diff-cover\n\n# Check coverage of git diff\ndiff-cover htmlcov\u002Fcoverage.xml --compare-branch=main\n```\n\n## Remember\n\nCoverage analysis is a **tool for improvement**, not a report card. Use it to:\n- Find gaps in testing\n- Prioritize test writing\n- Track progress\n- Ensure quality\n\nBut always remember: **100% coverage ≠ bug-free code**. Write meaningful tests!\n","# Coverage Analyzer\n\n## ⚠️ MANDATORY: Read Project Documentation First\n\n**BEFORE starting coverage analysis, you MUST read and understand the following project documentation:**\n\n### Core Project Documentation\n\n1. **README.md** - Project overview, features, and getting started\n2. **AI_DOCS\u002Fproject-context.md** - Tech stack, architecture, development workflow\n3. **AI_DOCS\u002Fcode-conventions.md** - Code style, formatting, best practices\n4. **AI_DOCS\u002Ftdd-workflow.md** - TDD process, testing standards, coverage requirements\n\n### Session Context (if available)\n\n5. **.ai-context\u002FACTIVE_TASKS.md** - Current tasks and priorities\n6. **.ai-context\u002FCONVENTIONS.md** - Project-specific conventions\n7. **.ai-context\u002FRECENT_DECISIONS.md** - Recent architectural decisions\n8. **.ai-context\u002FLAST_SESSION_SUMMARY.md** - Previous session summary\n\n### Additional AI Documentation\n\n9. **AI_DOCS\u002Fai-tools.md** - Session management workflow\n10. **AI_DOCS\u002Fai-skills.md** - Other specialized skills\u002Fagents available\n\n### Why This Matters\n\n- **Coverage Requirements**: Understand project-specific coverage thresholds (80%+ minimum)\n- **Testing Patterns**: Follow established testing conventions when suggesting tests\n- **Code Context**: Understand module structure and dependencies\n- **Recent Changes**: Be aware of recent test additions or coverage improvements\n\n**After reading these files, proceed with your coverage analysis task below.**\n\n---\n\n## Overview\n\nProvide advanced test coverage analysis with actionable insights for improving coverage to meet the 80%+ requirement.\n\n## When to Use\n\n- After running `make coverage` to understand gaps\n- Before completing a feature (ensure adequate coverage)\n- When coverage is below 80% target\n- To identify critical uncovered code paths\n- For tracking coverage trends over time\n\n## What This Skill Provides\n\n✅ **Detailed Coverage Analysis**\n- Current coverage percentage\n- Uncovered lines by file\n- Missing branches\n\n✅ **Actionable Recommendations**\n- Specific tests to write\n- Code locations needing tests\n- Priority of coverage gaps\n\n✅ **Coverage Gaps Identification**\n- Critical uncovered paths (error handling)\n- Edge cases not tested\n- Integration points missing tests\n\n✅ **Test Suggestions**\n- Concrete test code recommendations\n- Parametrized test suggestions\n- Fixture recommendations\n\n✅ **Trend Tracking**\n- Coverage history over time\n- Improvement\u002Fregression detection\n- Progress toward 80%+ goal\n\n## Usage Examples\n\n### Analyze Current Coverage\n\n```bash\n# Generate detailed coverage analysis\nanalyze test coverage\n```\n\n**Output:** Comprehensive report with gaps and recommendations\n\n### Find Critical Gaps\n\n```bash\n# Focus on critical uncovered code\nshow critical coverage gaps\n```\n\n**Output:** High-priority uncovered code (error handling, security, edge cases)\n\n### Get Test Suggestions\n\n```bash\n# Get specific test recommendations\nsuggest tests for uncovered code in src\u002Fpython_modern_template\u002Fvalidators.py\n```\n\n**Output:** Concrete test cases to add\n\n### Track Coverage Trends\n\n```bash\n# See coverage over time\nshow coverage trend for last month\n```\n\n**Output:** Graph showing coverage changes\n\n## Step-by-Step Analysis Process\n\n### Step 1: Run Coverage\n\n```bash\n# Generate coverage report\nmake coverage\n```\n\nThis creates:\n- Terminal output with overall percentage\n- HTML report in `htmlcov\u002F`\n- `.coverage` data file\n\n### Step 2: Parse Coverage Data\n\nRead coverage data from multiple sources:\n\n```bash\n# Read terminal output for overall stats\n# Read htmlcov\u002Findex.html for detailed breakdown\n# Parse .coverage file for line-by-line data\n```\n\n### Step 3: Identify Uncovered Lines\n\nFor each source file:\n- List uncovered line numbers\n- Group by type (functions, error handling, edge cases)\n- Prioritize by criticality\n\n### Step 4: Analyze Context\n\nFor each uncovered section:\n- Read surrounding code\n- Understand what the code does\n- Identify why it's not covered\n- Determine appropriate test type\n\n### Step 5: Generate Recommendations\n\nCreate specific test suggestions:\n- Test function name\n- Test scenario\n- Example test code\n- Parameters to test\n\n### Step 6: Calculate Priority\n\n**CRITICAL** - Must cover immediately:\n- Error handling paths\n- Security-related code\n- Data validation\n- Authorization checks\n\n**HIGH** - Should cover soon:\n- Edge cases\n- Boundary conditions\n- Integration points\n- Public API functions\n\n**MEDIUM** - Good to cover:\n- Internal helper functions\n- Logging statements\n- Configuration parsing\n\n**LOW** - Optional:\n- Debug code\n- Development-only paths\n- Deprecated functions\n\n## Analysis Report Format\n\n```markdown\n# Test Coverage Analysis\n\n## Executive Summary\n\n**Current Coverage:** 75.3%\n**Target:** 80%+\n**Gap:** 4.7% (23 uncovered lines)\n**Status:** ⚠️ Below target\n\n**Breakdown:**\n- src\u002Fpython_modern_template\u002F: 73.2% (18 uncovered lines)\n- tests\u002F: 100% (fully covered)\n\n---\n\n## Critical Gaps (MUST FIX)\n\n### 1. Error Handling in validators.py ⚠️ CRITICAL\n\n**File:** src\u002Fpython_modern_template\u002Fvalidators.py\n**Lines:** 45-52 (8 lines)\n**Function:** `validate_email()`\n\n**Uncovered Code:**\n```python\n45: except ValueError as e:\n46:     logger.error(f\"Email validation failed: {e}\")\n47:     raise ValidationError(\n48:         \"Invalid email format\"\n49:     ) from e\n50: except Exception:\n51:     logger.critical(\"Unexpected validation error\")\n52:     return False\n```\n\n**Why Critical:** Error handling paths are not tested, could hide bugs\n\n**Recommended Test:**\n```python\ndef test_validate_email_value_error_handling() -> None:\n    \"\"\"Test email validation handles ValueError correctly.\"\"\"\n    # Arrange\n    invalid_email = \"not-an-email\"\n\n    # Act & Assert\n    with pytest.raises(ValidationError) as exc_info:\n        validate_email(invalid_email)\n\n    assert \"Invalid email format\" in str(exc_info.value)\n    assert exc_info.value.__cause__ is not None\n\ndef test_validate_email_unexpected_error_handling() -> None:\n    \"\"\"Test email validation handles unexpected errors.\"\"\"\n    # Arrange\n    # Mock to raise unexpected exception\n    with patch('validators.EMAIL_REGEX.match', side_effect=RuntimeError(\"Unexpected\")):\n        # Act\n        result = validate_email(\"test@example.com\")\n\n        # Assert\n        assert result is False\n```\n\n**Impact:** Covers 8 lines, adds 3.5% coverage\n\n---\n\n### 2. Edge Case in parser.py ⚠️ CRITICAL\n\n**File:** src\u002Fpython_modern_template\u002Fparser.py\n**Lines:** 67-70 (4 lines)\n**Function:** `parse_config()`\n\n**Uncovered Code:**\n```python\n67: if not config_data:\n68:     logger.warning(\"Empty configuration provided\")\n69:     return DEFAULT_CONFIG\n70:     # Unreachable line removed\n```\n\n**Why Critical:** Edge case handling not tested\n\n**Recommended Test:**\n```python\ndef test_parse_config_empty_data() -> None:\n    \"\"\"Test parser handles empty configuration.\"\"\"\n    # Arrange\n    empty_config = {}\n\n    # Act\n    result = parse_config(empty_config)\n\n    # Assert\n    assert result == DEFAULT_CONFIG\n\ndef test_parse_config_none_data() -> None:\n    \"\"\"Test parser handles None configuration.\"\"\"\n    # Arrange\n    # Act\n    result = parse_config(None)\n\n    # Assert\n    assert result == DEFAULT_CONFIG\n```\n\n**Impact:** Covers 4 lines, adds 1.7% coverage\n\n---\n\n## High Priority Gaps\n\n### 3. Integration Point in api_client.py\n\n**File:** src\u002Fpython_modern_template\u002Fapi_client.py\n**Lines:** 112-118 (7 lines)\n**Function:** `retry_with_backoff()`\n\n**Uncovered Code:**\n```python\n112: @retry(max_attempts=3, backoff=2.0)\n113: def retry_with_backoff(self, operation: Callable) -> Any:\n114:     \"\"\"Retry operation with exponential backoff.\"\"\"\n115:     try:\n116:         return operation()\n117:     except ConnectionError:\n118:         logger.warning(\"Connection failed, retrying...\")\n```\n\n**Why High:** Integration logic with retry mechanism\n\n**Recommended Test:**\n```python\n@pytest.mark.parametrize(\"attempt,should_succeed\", [\n    (1, True),  # Succeeds first try\n    (2, True),  # Succeeds second try\n    (3, True),  # Succeeds third try\n    (4, False), # Fails after max attempts\n])\ndef test_retry_with_backoff(attempt: int, should_succeed: bool) -> None:\n    \"\"\"Test retry mechanism with various scenarios.\"\"\"\n    # Arrange\n    client = APIClient()\n    call_count = 0\n\n    def flaky_operation():\n        nonlocal call_count\n        call_count += 1\n        if call_count \u003C attempt:\n            raise ConnectionError(\"Connection failed\")\n        return \"success\"\n\n    # Act & Assert\n    if should_succeed:\n        result = client.retry_with_backoff(flaky_operation)\n        assert result == \"success\"\n        assert call_count == attempt\n    else:\n        with pytest.raises(ConnectionError):\n            client.retry_with_backoff(flaky_operation)\n```\n\n**Impact:** Covers 7 lines, adds 3.0% coverage\n\n---\n\n## Coverage By Module\n\n| Module | Coverage | Uncovered Lines | Priority |\n|--------|----------|----------------|----------|\n| validators.py | 65% | 12 | CRITICAL |\n| parser.py | 80% | 4 | HIGH |\n| api_client.py | 75% | 7 | HIGH |\n| utils.py | 95% | 1 | LOW |\n\n**Total:** 75.3% (23 uncovered lines)\n\n---\n\n## Quick Win Recommendations\n\nThese tests would quickly boost coverage:\n\n1. **Add error handling tests** (validators.py)\n   - +3.5% coverage\n   - 10 minutes to write\n\n2. **Add edge case tests** (parser.py)\n   - +1.7% coverage\n   - 5 minutes to write\n\n3. **Add integration tests** (api_client.py)\n   - +3.0% coverage\n   - 15 minutes to write\n\n**Total Impact:** +8.2% coverage (reaching 83.5%)\n**Total Time:** ~30 minutes\n\n---\n\n## Coverage Trend\n\n```\nWeek 1: 70% ███████░░░\nWeek 2: 72% ███████▓░░\nWeek 3: 75% ████████░░\nWeek 4: 75% ████████░░  ← Current (stalled)\n\nTarget: 80% ████████▓░\n```\n\n**Trend:** +5% over 3 weeks, then stalled\n**Recommendation:** Focus on quick wins above to break through 80%\n\n---\n\n## Detailed File Analysis\n\n### src\u002Fpython_modern_template\u002Fvalidators.py (65% coverage)\n\n**Covered:**\n- Basic email validation (happy path)\n- URL validation (happy path)\n- Phone number validation\n\n**Not Covered:**\n- Error handling (lines 45-52)\n- Edge cases (empty strings, None)\n- Invalid format handling\n\n**Missing Test Types:**\n- Parametrized tests for invalid inputs\n- Exception handling tests\n- Edge case tests\n\n### src\u002Fpython_modern_template\u002Fparser.py (80% coverage)\n\n**Covered:**\n- Standard config parsing\n- Type conversion\n- Default value handling\n\n**Not Covered:**\n- Empty config handling (lines 67-70)\n\n**Missing Test Types:**\n- Edge case tests (empty, None)\n\n### src\u002Fpython_modern_template\u002Fapi_client.py (75% coverage)\n\n**Covered:**\n- Basic API calls\n- Authentication\n- Response parsing\n\n**Not Covered:**\n- Retry logic (lines 112-118)\n- Connection error handling\n- Backoff mechanism\n\n**Missing Test Types:**\n- Integration tests with retries\n- Failure scenario tests\n\n---\n\n## Next Steps\n\n### Immediate Actions (30 minutes)\n\n1. **Add error handling tests to validators.py**\n   ```bash\n   # Edit tests\u002Ftest_validators.py\n   # Add test_validate_email_value_error_handling()\n   # Add test_validate_email_unexpected_error_handling()\n   ```\n\n2. **Add edge case tests to parser.py**\n   ```bash\n   # Edit tests\u002Ftest_parser.py\n   # Add test_parse_config_empty_data()\n   # Add test_parse_config_none_data()\n   ```\n\n3. **Add integration tests to api_client.py**\n   ```bash\n   # Edit tests\u002Ftest_api_client.py\n   # Add test_retry_with_backoff()\n   ```\n\n4. **Run coverage again**\n   ```bash\n   make coverage\n   ```\n\n**Expected Result:** 83.5% coverage (exceeds 80% target!)\n\n### Verify Implementation\n\n```bash\n# Run tests to ensure they fail (TDD)\nmake test\n\n# Verify uncovered code is exercised\n# Fix any test issues\n# Re-run coverage\nmake coverage\n\n# Should see 80%+ coverage\n```\n\n---\n\n## Additional Recommendations\n\n### Use Parametrized Tests\n\nFor multiple similar test cases:\n\n```python\n@pytest.mark.parametrize(\"email,valid\", [\n    (\"test@example.com\", True),\n    (\"invalid-email\", False),\n    (\"\", False),\n    (None, False),\n    (\"test@\", False),\n    (\"@example.com\", False),\n])\ndef test_validate_email_parametrized(email: str | None, valid: bool) -> None:\n    \"\"\"Test email validation with various inputs.\"\"\"\n    if valid:\n        assert validate_email(email) is True\n    else:\n        assert validate_email(email) is False\n```\n\n### Use Fixtures for Common Setup\n\n```python\n@pytest.fixture\ndef sample_config():\n    \"\"\"Provide sample configuration for tests.\"\"\"\n    return {\n        \"api_url\": \"https:\u002F\u002Fapi.example.com\",\n        \"timeout\": 30,\n        \"retries\": 3,\n    }\n\ndef test_parse_config_with_defaults(sample_config):\n    \"\"\"Test config parsing with defaults.\"\"\"\n    result = parse_config(sample_config)\n    assert result[\"timeout\"] == 30\n```\n\n### Focus on Critical Paths\n\nPriority order:\n1. Error handling (catch exceptions)\n2. Edge cases (empty, None, invalid)\n3. Security checks (validation, authorization)\n4. Integration points (API calls, database)\n5. Business logic\n6. Utility functions\n\n---\n\n## Coverage Best Practices\n\n1. **Write tests FIRST (TDD)** - Coverage comes naturally\n2. **Test behavior, not implementation** - Focus on what, not how\n3. **Use real code over mocks** - Only mock external dependencies\n4. **Aim for 100% of new code** - Don't lower the bar\n5. **Track trends** - Ensure coverage doesn't regress\n6. **Review uncovered code regularly** - Don't let gaps accumulate\n\n---\n\n## Integration with Quality Tools\n\n### With make check\n\n```bash\n# Coverage is part of quality gates\nmake check\n\n# Must pass 80%+ coverage requirement\n```\n\n### With TDD Reviewer\n\n```bash\n# TDD reviewer checks coverage compliance\n[tdd-reviewer]\n\n# Includes coverage verification\n```\n\n### With Coverage Command\n\n```bash\n# Generate HTML report\nmake coverage\n\n# View in browser\nopen htmlcov\u002Findex.html\n```\n\n---\n\n## Remember\n\n> \"Coverage percentage is a measure, not a goal.\"\n> \"Aim for meaningful tests, not just high numbers.\"\n\n**Good coverage means:**\n- ✅ Critical paths tested\n- ✅ Error handling verified\n- ✅ Edge cases covered\n- ✅ Integration points tested\n\n**Bad coverage means:**\n- ❌ Tests just to hit lines\n- ❌ Meaningless assertions\n- ❌ Over-mocking everything\n- ❌ Ignoring critical gaps\n\nFocus on **quality coverage**, not just quantity!\n```\n\n## Advanced Features\n\n### Historical Tracking\n\nStore coverage data over time:\n\n```bash\n# Save current coverage\necho \"$(date +%Y-%m-%d),$(coverage report | grep TOTAL | awk '{print $4}')\" >> .coverage_history\n\n# View trend\ncat .coverage_history\n```\n\n### Per-Module Breakdown\n\nAnalyze each module separately:\n\n```bash\n# Get coverage for specific module\ncoverage report --include=\"src\u002Fpython_modern_template\u002Fvalidators.py\"\n```\n\n### Branch Coverage\n\nNot just line coverage, but branch coverage:\n\n```bash\n# Enable branch coverage in pyproject.toml\n[tool.pytest.ini_options]\nbranch = true\n\n# Shows uncovered branches (if\u002Felse not both tested)\n```\n\n### Diff Coverage\n\nFocus on changed lines only:\n\n```bash\n# Install diff-cover\npip install diff-cover\n\n# Check coverage of git diff\ndiff-cover htmlcov\u002Fcoverage.xml --compare-branch=main\n```\n\n## Remember\n\nCoverage analysis is a **tool for improvement**, not a report card. Use it to:\n- Find gaps in testing\n- Prioritize test writing\n- Track progress\n- Ensure quality\n\nBut always remember: **100% coverage ≠ bug-free code**. Write meaningful tests!\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Fcoverage-analyzer",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill coverage-analyzer",{"tool":56,"command":57},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill coverage-analyzer",{"tool":59,"command":60},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill coverage-analyzer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Fcoverage-analyzer\u002FSKILL.md",true,[64,70,74,78,82,86,90,94],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"output.json","REFERENCE","参考文档",6605,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Fcoverage-analyzer\u002Foutput.json",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fbest-practices.md",1210,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fbest-practices.md",{"path":75,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fexceptions.md",4246,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fexceptions.md",{"path":79,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fgraceful-degradation.md",4779,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fgraceful-degradation.md",{"path":83,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Flanguage-specific.md",2299,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Flanguage-specific.md",{"path":87,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fpropagation.md",3458,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fpropagation.md",{"path":91,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fresult-types.md",2064,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Fcodex\u002Forc\u002Fcontent\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fresult-types.md",{"path":95,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":96,"sourceHtmlUrl":97},"skill-report.json",8283,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Fcoverage-analyzer\u002Fskill-report.json",[99,113,123,132,138,145],{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":109,"publishedAt":36},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[104],{"categoryNo":105,"categoryName":106,"taxonomyType":107,"taxonomyTypeDesc":108},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[110,111,112],"model","model hierarchy","model hierarchy skill",{"skillNo":114,"name":115,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":119,"publishedAt":36},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[118],{"categoryNo":105,"categoryName":106,"taxonomyType":107,"taxonomyTypeDesc":108},[120,121,122],"MCP","zoom","zoom mcp",{"skillNo":124,"name":125,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":36},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[129,130,131,121],"sdk","zoom apps sdk","apps",{"skillNo":133,"name":134,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":36},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[134],{"skillNo":139,"name":140,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":144,"publishedAt":36},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[143],{"categoryNo":105,"categoryName":106,"taxonomyType":107,"taxonomyTypeDesc":108},[140],{"skillNo":146,"name":147,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":36},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[147]]