fix: test_coverage detector — naming mapping + importer count#498
fix: test_coverage detector — naming mapping + importer count#498Imwm82 wants to merge 1 commit intopeteromallet:mainfrom
Conversation
Bug 1 — map_test_to_source: The first loop compared candidate basenames against the TEST file basename (e.g. "Foo.test.tsx") instead of the SOURCE basename (e.g. "Foo.tsx"), so the comparison always failed and the function skipped to the fallback loop. Fixed: compare candidate basename against source basename. Bug 2 — importer_count: Only counted production-file importers, ignoring test-file importers entirely. Combined both for accurate blast-radius assessment in issue severity.
|
Thanks for looking into the test_coverage detector, @Imwm82. After reviewing the diff carefully, I'm not going to merge this — here's why: Bug 1 (map_test_to_source): The existing code at Bug 2 (importer_count): The existing code intentionally counts only production-file importers for blast-radius assessment. Adding test-file importers would inflate priority scores for well-tested files — the opposite of what we want. A file that's heavily tested should not appear riskier because of that. If you're seeing unexpected test_health scores in your project, I'd be happy to look at a concrete example — there may be a different root cause. Thanks again for the investigation. |
Summary
Fixes two bugs in the test_coverage detector:
Bug 1: map_test_to_source (TypeScript)
The first loop compared candidate basenames against the TEST file basename instead of the SOURCE basename, so the comparison always failed and the function skipped to the fallback loop.
Bug 2: importer_count
Only counted production-file importers, ignoring test-file importers entirely. Combined both for accurate blast-radius assessment.
Impact
For the CoQ Tracking System project: