Repository navigation
Conversation
With dozens of survivors, the useful conclusions come from groups: twelve `&&` -> `||` survivors in one file mean the tests check only what is accepted. The new strain/patterns.py groups survivors that make the same kind of change in the same file, keeping groups of two or more. - Kinds: a comparison moved by one at its limit, an inverted comparison, == and != swapped, && to ||, || to &&, and arithmetic. Each comes with the test that would kill the whole group. - Each survivor is in one primary pattern at most. - Hotspots, the functions with the most survivors and their not_reached/not_detected split, are listed after the patterns. The console shows a Patterns section before the action items, and summary.md and index.html list them too. report.json gains a `patterns` array with each group's kind, file, advice and mutant IDs; hotspots have `"primary": false`. Fixes #44. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #44.
What changes
strain/patterns.pygroups survivors that make the same kind of change in the same file into patterns, keeping groups of two or more. Each pattern names the test that would kill the whole group.boundary<↔<=,>↔>=negated-comparison<↔>=,>↔<=equality==↔!=and-to-or&&→`or-to-andarithmeticaor,asrnot_reached/not_detectedsplit. They cut across patterns, so they're listed after them and aren't primary.summary.mdandindex.html, in a Patterns list;report.json, in a top-levelpatternsarray with each group'skind,primary,file,survivors,summary,adviceandmutants(IDs). Hotspots have"primary": false, afunctionand the split.report.jsonaddition.From the acceptance fixture below:
Left for later
+1↔+2boundaries: strain doesn't mutate constants yet.patternsis a key the mutation-testing-elements schema doesn't define. Readers I know of ignore unknown keys, but a strict validator withadditionalProperties: falsewould reject the file. Tell me if you'd rather have it in a separatepatterns.json.Tests
(c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_', whose test only checks that'm','M'and'_'are accepted. I worked out by hand that this leaves 4 boundary survivors and 2&&→||survivors, and kills the rest. The test checks:summary.mdshow exactly those two patterns, with those counts, then the 6-survivor hotspot;report.json's primary patterns are[("boundary", 4), ("and-to-or", 2)], with no mutant in two of them;index.htmlhas the section.tests/test_patterns.py:primary: falsefor hotspots.python -W error -m pytest: 260 passed, 9 skipped.ruff format --check,ruff checkand lizard are clean.🤖 Generated with Claude Code