| name | bzfs-improve-code-coverage |
| description | Improve code coverage in this repository with project-approved coverage commands and meaningful test additions. Use when asked to increase coverage, identify uncovered branches/functions, or report before-vs-after coverage percentages. |
bzfs Improve Code Coverage
Outcome
Improve code coverage meaningfully by adding high-value tests for critical uncovered logic paths and reporting
measurable results.
Workflow
-
Measure baseline coverage:
export bzfs_test_mode="${bzfs_test_mode-unit}"
python3 -m coverage run -m bzfs_tests.test_all
python3 -m coverage xml
cat coverage.xml
-
Identify critical gaps:
- Use
coverage.xml to identify key logic branches or functions that lack tests.
-
Add high-value tests:
- Prioritize adding tests for those areas rather than chasing minor unused lines.
- Focus on adding meaningful high-value tests: Do not add low-value tests just to increase a coverage percentage.
-
Re-run measurement with the same commands and compare results.
-
Report results:
- State the before vs. after coverage percentage so the impact is clear.
- Summarize which critical branches/functions are now covered.