refactor(tests): consolidate coverage-named feature files into primary feature files #10705

Open
opened 2026-04-19 06:50:32 +00:00 by HAL9000 · 0 comments
Owner

Summary

229 out of 627 feature files (36.5%) have "coverage" in their name, indicating tests were written primarily to hit coverage targets rather than to document behavior. This is a BDD anti-pattern — Behave feature files should describe business behavior, not coverage gaps.

Problem

The features/ directory contains:

  • 80 files named *_coverage_boost*.feature
  • 38 files named *_coverage_r[23]*.feature (revision iterations)
  • 18 files named *_uncovered_*.feature
  • Others named coverage_boost.feature, coverage_maximum.feature, coverage_boost_extra.feature

Anti-patterns identified:

  1. Coverage-driven naming: Files named *_coverage_boost* suggest they exist to boost coverage numbers, not to document behavior
  2. Revision proliferation: Files like plan_cli_coverage_r2.feature, plan_cli_coverage_r3.feature suggest iterative additions rather than consolidation into the primary plan_cli.feature
  3. Uncovered lines files: Files like plan_generation_uncovered_lines.feature explicitly target uncovered code paths rather than describing features

Example of the problem:

For plan_cli, there are 8+ separate feature files:

  • plan_cli.feature (primary)
  • plan_cli_coverage.feature
  • plan_cli_coverage_boost.feature
  • plan_cli_coverage_boost_r2.feature
  • plan_cli_coverage_r2.feature
  • plan_cli_coverage_r3.feature
  • plan_cli_uncovered_region_coverage.feature
  • plan_cli_streaming_coverage.feature

This fragmentation makes it impossible to understand the complete test suite for a module.

Subtasks

  • Audit all *_coverage_boost*.feature files to identify which primary feature file they belong to
  • For each coverage-boost file, determine if scenarios describe real behavior or just hit code paths
  • Merge behavior-describing scenarios into their primary feature files
  • Remove or rewrite purely coverage-driven scenarios
  • Consolidate _r2, _r3 revision files into their primary counterparts
  • Update step file references accordingly
  • Verify nox -s unit_tests passes after consolidation
  • Verify nox -s coverage_report passes at ≥97% threshold

Definition of Done

  • Number of coverage-named feature files reduced by at least 50%
  • All scenarios from merged files are preserved or intentionally removed
  • nox -s unit_tests passes
  • nox -s coverage_report passes at ≥97% threshold
  • Feature files describe behavior, not coverage targets

Metadata

  • Branch: refactor/consolidate-coverage-feature-files
  • Commit Message: refactor(tests): consolidate coverage-named feature files into primary feature files

Duplicate Check

Searched open and closed issues for: "coverage_boost", "coverage naming", "test anti-pattern", "consolidate feature files". Related: #485 (perf consolidation of small files, now closed). No exact duplicates found.


Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-worker

## Summary 229 out of 627 feature files (36.5%) have "coverage" in their name, indicating tests were written primarily to hit coverage targets rather than to document behavior. This is a BDD anti-pattern — Behave feature files should describe business behavior, not coverage gaps. ## Problem The `features/` directory contains: - **80 files** named `*_coverage_boost*.feature` - **38 files** named `*_coverage_r[23]*.feature` (revision iterations) - **18 files** named `*_uncovered_*.feature` - **Others** named `coverage_boost.feature`, `coverage_maximum.feature`, `coverage_boost_extra.feature` ### Anti-patterns identified: 1. **Coverage-driven naming**: Files named `*_coverage_boost*` suggest they exist to boost coverage numbers, not to document behavior 2. **Revision proliferation**: Files like `plan_cli_coverage_r2.feature`, `plan_cli_coverage_r3.feature` suggest iterative additions rather than consolidation into the primary `plan_cli.feature` 3. **Uncovered lines files**: Files like `plan_generation_uncovered_lines.feature` explicitly target uncovered code paths rather than describing features ### Example of the problem: For `plan_cli`, there are 8+ separate feature files: - `plan_cli.feature` (primary) - `plan_cli_coverage.feature` - `plan_cli_coverage_boost.feature` - `plan_cli_coverage_boost_r2.feature` - `plan_cli_coverage_r2.feature` - `plan_cli_coverage_r3.feature` - `plan_cli_uncovered_region_coverage.feature` - `plan_cli_streaming_coverage.feature` This fragmentation makes it impossible to understand the complete test suite for a module. ## Subtasks - [ ] Audit all `*_coverage_boost*.feature` files to identify which primary feature file they belong to - [ ] For each coverage-boost file, determine if scenarios describe real behavior or just hit code paths - [ ] Merge behavior-describing scenarios into their primary feature files - [ ] Remove or rewrite purely coverage-driven scenarios - [ ] Consolidate `_r2`, `_r3` revision files into their primary counterparts - [ ] Update step file references accordingly - [ ] Verify `nox -s unit_tests` passes after consolidation - [ ] Verify `nox -s coverage_report` passes at ≥97% threshold ## Definition of Done - Number of coverage-named feature files reduced by at least 50% - All scenarios from merged files are preserved or intentionally removed - `nox -s unit_tests` passes - `nox -s coverage_report` passes at ≥97% threshold - Feature files describe behavior, not coverage targets ## Metadata - **Branch:** `refactor/consolidate-coverage-feature-files` - **Commit Message:** `refactor(tests): consolidate coverage-named feature files into primary feature files` ## Duplicate Check Searched open and closed issues for: "coverage_boost", "coverage naming", "test anti-pattern", "consolidate feature files". Related: #485 (perf consolidation of small files, now closed). No exact duplicates found. --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | Agent: implementation-worker
HAL9000 added this to the v3.9.0 milestone 2026-04-19 06:50:32 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#10705
No description provided.