You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(health): replace file ratio with test density scoring
File ratio counted test FILES, not tests — adding 16 tests to the same
file moved the score zero. New 3-tier system: real line coverage (Istanbul),
test density via grep (tests per source file), file ratio as last resort.
37 tests / 3 files = 12.3 density → 20/20 (was 7/20 with file ratio).
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,20 +6,36 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Version
6
6
7
7
---
8
8
9
-
## [3.4.3] — 2026-03-12
9
+
## [3.4.4] — 2026-03-12
10
10
11
11
### Fixed
12
12
13
-
-**Test scoring accuracy** — Health score now uses real line coverage (Istanbul/c8/nyc) for the Tests dimension when a coverage report exists. Previously, real coverage was displayed in the note but ignored for scoring — the score always used the file ratio proxy. Projects with 80% real coverage now score 16/20 instead of whatever the file ratio happened to be.
14
-
-**File ratio proxy too punishing** — When no coverage report exists, the file ratio proxy now awards a 5-point floor for "has tests at all" plus up to 15 scaled by ratio. A project with 1 test file and 3 source files now scores 10/20 (was 7/20). The note tells users to run `--coverage` for accurate scoring.
13
+
-**Test scoring measures real test quality** — Replaced the file ratio proxy (which counted test FILES, not tests) with a 3-tier scoring system:
14
+
1.**Real line coverage** from Istanbul/c8/nyc when a coverage report exists (gold standard)
15
+
2.**Test density** — counts actual `it()`/`test()`/`def test_`/`#[test]` declarations via grep (~50ms), scores by tests-per-source-file: <1 sparse (5pts), 1-3 basic (10pts), 3-5 solid (15pts), 5+ thorough (20pts)
16
+
3.**File ratio** as last resort when test case patterns can't be detected
17
+
- Adding tests now moves the score. A project with 37 tests across 3 source files (12.3/file) scores **20/20** instead of the old 7/20. Previously, adding 16 tests to the same file changed the score by exactly zero.
15
18
16
19
### Tests
17
20
18
-
-**26/26 vitest** (was 25 — 1 new test for scoring accuracy)
21
+
-**27/27 vitest** (was 26 — 1 new test for density tier scoring)
19
22
-**43/43 node:test** (unchanged)
20
23
21
24
---
22
25
26
+
## [3.4.3] — 2026-03-12
27
+
28
+
### Fixed
29
+
30
+
-**Test scoring accuracy (patch, superseded by v3.4.4)** — Added 5-point floor for file ratio proxy and real coverage preference. This was an incremental patch; v3.4.4 replaces it with proper test density scoring.
31
+
32
+
### Tests
33
+
34
+
-**26/26 vitest**
35
+
-**43/43 node:test**
36
+
37
+
---
38
+
23
39
## [3.4.2] — 2026-03-12
24
40
25
41
### Fixed
@@ -121,6 +137,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Version
0 commit comments