chore(ci): add Stryker.NET mutation testing for the split math - #36
Merged
Merged
Conversation
- stryker-config.json: mutate SplitIt.Infrastructure/Services/SplitCalculator.cs and run only the SplitCalculator tests (pure, no DB). Thresholds high=80 / low=70 / break=65. - .github/workflows/mutation.yml: runs on PRs touching the calculator, its tests or the config, on a weekly schedule and on demand; fails below break and uploads the report. - SplitCalculatorBoundaryTests: boundary cases (null/empty input, zero total, 0/100 percentages, rounding drift) that raise the mutation score from 69% to 82%.
|
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.



Mutation testing (Fase 2.2 — Stryker.NET, SplitIt as the template)
SplitIt's
Domain/Applicationare anemic (DTOs and entities with no logic), so the meaningful, DB-free unit-testable target is theSplitCalculator(expense-splitting math) inInfrastructure/Services. Mutation testing runs there, hermetically (no SQL Server needed).What's added
stryker-config.json— mutatesSplitIt.Infrastructure/Services/SplitCalculator.cs, runs only theSplitCalculator*tests, thresholds high 80 / low 70 / break 65..github/workflows/mutation.yml— runs on PRs touching the calculator, its tests or the config, on a weekly schedule and on demand; fails belowbreakand uploads the HTML/JSON report.SplitCalculatorBoundaryTests.cs— boundary cases (null/empty input, zero total, 0%/100% percentages, rounding-drift absorption) that kill the easy survivors.Result
Mutation score on
SplitCalculator: 69% → 82% (72 killed / 14 survived; the rest are mostly exception-message string mutants). Thebreakthreshold of 65 fails CI on a regression.Follow-ups (not in this PR)