Skip to content

chore(ci): add Stryker.NET mutation testing for the split math - #36

Merged
santidev21 merged 1 commit into
mainfrom
chore/mutation-testing
Oct 1, 2026
Merged

santidev21 merged 1 commit into
mainfrom
chore/mutation-testing

Conversation

@santidev21

Copy link
Copy Markdown
Owner

Mutation testing (Fase 2.2 — Stryker.NET, SplitIt as the template)

SplitIt's Domain/Application are anemic (DTOs and entities with no logic), so the meaningful, DB-free unit-testable target is the SplitCalculator (expense-splitting math) in Infrastructure/Services. Mutation testing runs there, hermetically (no SQL Server needed).

What's added

  • stryker-config.json — mutates SplitIt.Infrastructure/Services/SplitCalculator.cs, runs only the SplitCalculator* 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 below break and 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). The break threshold of 65 fails CI on a regression.

Follow-ups (not in this PR)

  • Same template for Bikontrol.
  • StrykerJS on the frontend only if the backend mutation setup proves its worth.

- 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%.
@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@santidev21
santidev21 merged commit 0560b40 into main Oct 1, 2026
13 checks passed
@santidev21
santidev21 deleted the chore/mutation-testing branch October 1, 2026 22:09
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