Idea · Aug 12, 2026
Test Coverage Narrator
A VS Code extension that runs test coverage on student code and generates a plain-English explanation of each uncovered code path, why it matters pedagogically, and three concrete suggested test cases for that exact gap.
What it would do
Test Coverage Narrator adds a 'Explain Coverage Gaps' command to any Python or JavaScript project with a test suite. When invoked, it runs the existing tests with coverage instrumentation, collects the list of uncovered lines and branches, and sends each gap to Claude along with the surrounding function code. Claude returns a three-part response: (1) a plain-English explanation of what scenario would trigger that code path, (2) a pedagogical note on why testing it matters (error handling? edge case? state invariant?), and (3) three test stubs in the same language as the project, ready to paste. The VS Code panel shows a prioritized list of coverage gaps ordered by 'teachability' — gaps where the missing test also teaches a general principle get ranked highest. The tool complements existing coverage reporters (Istanbul, coverage.py) by replacing raw line numbers with a learning conversation, directly supporting Pisan's toolchain-first pedagogy where the tool itself teaches the concept.
Key features
- One-click 'Explain Coverage Gaps' command integrated into VS Code test panel
- Works with Python (pytest-cov) and JavaScript (c8/Istanbul) out of the box
- Per-gap panel showing: what scenario triggers this path, why it matters, and 3 ready-to-paste test stubs
- Teachability ranking that surfaces gaps most useful for learning general testing principles first
- Diff-aware mode: only explains gaps introduced since the last commit, focusing students on their own code