Files
werkcrappit/docs/features/02-status-policy.feature
miandmhoennig 0f21718e32
werkator build succeeded after 00:32
Step 2 of 8: metric core and status policy strict-v1 (#3)
Step 2 of 8 from section 8.3 of the specification.

- Tool-free core `de.hoennig.werkcrappit.pit.core`: `MethodEvaluator`, `StrictV1` (table of 5.2), `MutationCrap` as an exact fraction with `exceeds(limit)`.
- Non-numeric states with machine-readable reasons; invalid input rejected with a concrete reason.
- Features 01 and 02 copied from the specification into `docs/features/`, parsed by the Gherkin parser in a test; `docs/acceptance-test-map.md` maps MC-001 to MC-007.
- The PIT run still writes the step-1 report without a score (report contract: step 5).

CI on werkator.javagil.de: green (49 s).

PR-doc: `docs/prs/2026-10-01-PR#3-metric-core.md`

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: mhoennig <michael@hoennig.de>
Reviewed-on: #3
2026-10-01 14:14:33 +02:00

46 lines
1.7 KiB
Gherkin

# language: de
Funktionalität: Mutationsergebnisse nachvollziehbar gewichten
Als Nutzer möchte ich erkennen, welche Ergebnisse in den Score eingehen,
damit Ausführungsprobleme nicht als Teststärke erscheinen.
@MC-005
Szenario: Nicht abgedeckte Mutanten bleiben im Nenner
Angenommen eine Methode hat die JaCoCo-Komplexität 10
Und sie hat 4 KILLED-, 1 SURVIVED- und 5 NO_COVERAGE-Ergebnisse
Wenn sie mit der Policy "strict-v1" ausgewertet wird
Dann beträgt der Nenner 10
Und ihr Mutation Score beträgt 0.4
Und ihr Mutation-CRAP beträgt 31.6
@MC-006
Szenariogrundriss: Explizit ausgeschlossene Status erhöhen nicht die Teststärke
Angenommen eine Methode hat 1 KILLED- und 1 SURVIVED-Ergebnis
Und zusätzlich 8 Ergebnisse mit Status <status>
Wenn sie mit der Policy "strict-v1" ausgewertet wird
Dann beträgt ihr Mutation Score 0.5
Und ihr Nenner beträgt 2
Und die 8 ausgeschlossenen Ergebnisse sind separat ausgewiesen
Beispiele:
| status |
| EQUIVALENT |
| NON_VIABLE |
@MC-007
Szenariogrundriss: Uneindeutige Endergebnisse verhindern einen regulären Score
Angenommen eine Methode hat 9 KILLED-Ergebnisse
Und am Ende der Analyse ein Ergebnis mit Status <status>
Wenn sie mit der Policy "strict-v1" ausgewertet wird
Dann ist ihr Zustand "INCONCLUSIVE"
Und ihr Mutation Score und ihr Mutation-CRAP sind null
Und der auslösende Status und alle Rohzähler sind sichtbar
Beispiele:
| status |
| TIMED_OUT |
| MEMORY_ERROR |
| RUN_ERROR |
| NOT_STARTED |
| STARTED |
| UNBEKANNTER_NEUER_STATUS |