Repository navigation
test: opt-in mutation testing on numeric hotspots - #58
Merged
Merged
Conversation
Hypothesis property tests prove shape robustness. This adds the other axis: mutmut on the modules where a `+` → `-` or `>` → `>=` flip would silently return wrong numbers. - test-mutation extra in pyproject.toml with mutmut 3.x (4.x changed config keys again, pinned deliberately). - [tool.mutmut] targeting analytics.py (§14a Modul-3 savings math, VAT, Heartbeat-price windows) and prices.py (MarketPrices numeric conversions). I/O glue and auth are intentionally excluded — more noise than signal there. - .github/workflows/mutation.yml opt-in: runs on main pushes that touch the hotspot modules or pyproject.toml, plus workflow_dispatch. Not a required check for PRs. Results land as an artifact and in the job summary. No baseline-gate yet. The first run establishes the survivor population; a follow-up PR can bake it into a .mutmut-baseline file with a score-gate script if we want hard regression protection. Co-Authored-By: Claude Opus 4.7 <[email protected]> Claude-Session: https://claude.ai/code/session_01RgkYaQACLxezeceA1hrXQs
mrebbert
force-pushed
the
test/mutmut-hotspots
branch
from
October 16, 2026 06:17
5689f67 to
44b2bd6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fünfte und letzte Welle der HA-Adoptions. Zweiter Oracle neben der Hypothesis-Property-Suite: mutmut auf den Modulen, bei denen eine stille Zahl-Verschiebung sonst durchrutscht.
Zweck
Property-Tests prüfen Shape (bleibt `raw` intakt, kommt `from_dict` mit random Subsets klar). Mutation-Tests prüfen Logik: Was passiert, wenn mutmut
in den eigentlichen Rechen-Pfaden macht? Jede überlebende Mutation ist eine Lücke in den Assertions.
Scope
Zwei Hotspot-Module:
Rest des SDK ist I/O-Glue und Auth — mehr Rauschen als Signal, Laufzeit würde über 20 min klettern.
Was hinzukommt
Was nicht drin ist
Noch kein harter Baseline-Gate (`.mutmut-baseline` + score-gate-Script, wie HA es hat). Der erste Lauf etabliert die Survivor-Population. Follow-up-PR kann bei Interesse eine Regressions-Schutz-Schranke einziehen.
Keine Secrets
Keine `secrets.*`-Referenz, kein Live-API-Traffic. Alles läuft gegen `aioresponses`-gemockte HTTP.
Test plan
🤖 Generated with Claude Code
https://claude.ai/code/session_01RgkYaQACLxezeceA1hrXQs