Skip to content

test: restore the mutation score lost with the PHPStan level raise - #64

Merged
ogorzalka merged 2 commits into
mainfrom
test/restore-mutation-score
Nov 26, 2026
Merged

ogorzalka merged 2 commits into
mainfrom
test/restore-mutation-score

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Branch: test/restore-mutation-score, based on main (7a12cb4).

main is red since #63: mutation score 93.36 % (43 untested of 648) for a recorded floor of 95. Comparing the survivors with 27f847e (95.82 %, 25 untested) shows 18 new ones, all in the code added for PHPStan: Support\Value, the guards of PolloraStatus, DiscoveredComponents and ActiveThemeInfo.

Tests: what the tools do with a recurrence declared as an int-backed enum, a pure enum or a Stringable; a composer.lock without a package list or with incomplete entries; modules without the expected methods; Support\Value itself. A few cases on the wp_option secret guard (spaces around a name, non-text allow-list entries) kill older survivors.

Code, no behaviour change and no public change:

  • ActiveThemeInfo: the is_string filter over File::directories() could never remove anything; replaced by a list<string> annotation.
  • DiscoveredComponents: the type filter was checked twice; it is now mapped where it is validated.
  • DiscoveredComponents::formatRecurrence: the last branch is written as a guard that throws, then Value::text(), so the guard is observable by a test.

.harness.json is untouched.

Mutation score: 93.36 % -> 96.73 % (21 untested of 642).

Proved

  • vendor/bin/pollora-qa check --mutation --coverage passes (PHP 8.4, macOS): 96.73 %, ratchet included.
  • All 18 survivors introduced by chore(phpstan): raise the analysis from level 5 to max (10) #63 are gone. The 21 that remain also survive at 27f847e (four of them under the new wording of the late_after line).
  • composer qa:fast and composer qa pass; PHPStan clean at level 10.

Not proved

  • The Linux score: only measured on macOS. The margin over the floor is 1.7 points.
  • One mutant timed out in the final harness run (21 untested, 1 timeout, 620 tested) and counts as caught; were it to survive, the score would be 96.57 %.
  • Semgrep is not installed here: the SEC-* patterns did not run.
  • The backward compatibility job (roave) runs in CI only.
  • Not tried through an MCP client on a real application.
  • The remaining survivors (among them the one-second boundaries on late_after and on the age of failures, which need a controllable clock) are not addressed.

Pollora maintainer added 2 commits November 26, 2026 14:33
File::directories() only lists strings, and the type filter of discovered_components is already validated before it is mapped. The last branch of formatRecurrence() becomes a guard that throws, then Value::text(), so a test can observe it. No behaviour change.
@ogorzalka
ogorzalka merged commit 6832ee7 into main Nov 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant