Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .clinerules/tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ What "installed" means, in this order:

1. `.config/dotnet-tools.json`, committed, pinning `dotnet-stryker` — a local tool, so `dotnet tool restore`
is the whole setup and no clone has to install anything globally.
2. `stryker-config.json` at the root: `test-projects`, `test-runner`, `target-framework`, `configuration`,
2. `stryker-config.json` at the root: `test-runner`, `target-framework`, `configuration`,
`mutation-level`, `coverage-analysis`, `thresholds`, `reporters`, `break-on-initial-test-failure` and
`mutate`. The workflow and a local run read this one file.
`mutate`. The workflow and a local run read this one file. Stryker 5.1.0 runs in solution context: the
test project is discovered from the solution, so the config carries no `test-projects`.
3. A workflow that restores the same manifest, so the pin is stated once.
4. A README section (`Building and testing` → mutation testing) saying how to run it and how to read the
report, and a longer record under `docs/` when there is something worth recording.
Expand All @@ -22,9 +23,9 @@ Setting it up on a repository that has none of this:

```powershell
dotnet new tool-manifest # writes .config/dotnet-tools.json
dotnet tool install dotnet-stryker --version 5.0.0 # the version stryker-config.json is written for
dotnet tool install dotnet-stryker --version 5.1.0 # the version stryker-config.json is written for
dotnet tool restore
dotnet stryker --config-file stryker-config.json --project <Layer>.csproj --mutate "**/<File>.cs"
dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "src/<Layer>/**/*.cs"
```

`StrykerOutput/` (the default output directory) and `artifacts/` are ignored; reports are never committed.
Expand Down
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-stryker": {
"version": "5.0.0",
"version": "5.1.0",
"commands": [
"dotnet-stryker"
],
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ jobs:
10.0.x

# The version is the repository's own, not this workflow's: .config/dotnet-tools.json pins
# dotnet-stryker to the version stryker-config.json is written for (5.0.0 is the first that speaks
# Microsoft.Testing.Platform, through `--test-runner mtp`), so a local run and this one cannot drift.
# dotnet-stryker to the version stryker-config.json is written for (5.1.0 still speaks
# Microsoft.Testing.Platform through `--test-runner mtp`), so a local run and this one cannot drift.
# 5.1.0 runs in solution context: the solution names the tests and --mutate scopes the layer.
- name: Restore the tools
run: dotnet tool restore

Expand All @@ -141,7 +142,8 @@ jobs:
mkdir -p "artifacts/mutation/$LAYER"
args=(
--config-file stryker-config.json
--project "$LAYER.csproj"
--solution SharpCorePDF.slnx
--mutate "src/$LAYER/**/*.cs"
--output "artifacts/mutation/$LAYER"
)
# A scheduled run passes neither input, and stryker-config.json then decides both.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,10 @@ encrypted documents the merge engine writes were checked the same way with qpdf,
dotnet tool restore # Stryker is a local tool: .config\dotnet-tools.json states the version

# One layer of the four under src/ -- the SharpCorePDF project itself is a meta package with no code:
dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Domain.csproj --output artifacts/mutation/Domain
dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "src/SharpCorePDF.Domain/**/*.cs" --output artifacts/mutation/Domain

# One file, when one change is the question:
dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Infrastructure.csproj --mutate "**/ImagePixels.cs"
dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "**/ImagePixels.cs"

# The reading, out of the report it leaves behind:
python .\docs\tools\mutation-summary.py .\artifacts\mutation\Domain\reports\mutation-report.json --detail
Expand Down
23 changes: 19 additions & 4 deletions docs/mutation-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ dotnet tool restore

# One layer. The five projects under src/ are four layers and a meta package: SharpCorePDF itself has no
# code to mutate.
dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Domain.csproj --output artifacts/mutation/Domain
dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "src/SharpCorePDF.Domain/**/*.cs" --output artifacts/mutation/Domain

# One file, when the question is about one file
dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Domain.csproj --mutate "**/PageRange.cs"
dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "**/PageRange.cs"

# Only the lines a branch changes against main
dotnet stryker --config-file stryker-config.json --project SharpCorePDF.Domain.csproj --since:main
dotnet stryker --config-file stryker-config.json --solution SharpCorePDF.slnx --mutate "src/SharpCorePDF.Domain/**/*.cs" --since:main

# The reading, out of the report the run leaves behind
python ./docs/tools/mutation-summary.py ./artifacts/mutation/Domain/reports/mutation-report.json --detail
Expand Down Expand Up @@ -128,7 +128,8 @@ baseline would come from.
```

The path is the command that was run: that first sweep predates `.config/dotnet-tools.json`, and installed the
tool with `--tool-path .tools`. The manifest and `.tools/` hold the same 5.0.0, so `dotnet stryker` after
tool with `--tool-path .tools`. The manifest and `.tools/` held the same 5.0.0 at the time; the manifest now
pins 5.1.0, and the solution-context re-run is recorded at the end of this file. `dotnet stryker` after
`dotnet tool restore` is the same tool from one pin — which is what the commands above and `mutation.yml` use,
and what a clone has without any install step.

Expand Down Expand Up @@ -781,3 +782,17 @@ What survived, read one by one:
and it is the next thing to add if this service's suite is extended.



## 5.1.0 — the solution-context reading (2026-11-14)

`dotnet tool update dotnet-stryker --version 5.1.0` moves the harness to a version that runs in solution
context: it finds `SharpCorePDF.slnx`, discovers the test project itself, and refuses a `test-projects`
entry in `stryker-config.json`. The key is gone; the workflow and the commands above name the solution and
scope the layer with `--mutate`. The configuration is otherwise unchanged.

The scoped reading of `Services/PdfDiagnoserService.cs` with 5.1.0 is **38.46%** (5 killed, 8 survived,
11 compile errors, 13 mutants), against 42.86% on 5.0.0. The survivor set is the same one the 1.7.0 record
names — the redundant null guard, the exception message string, the four `ConfigureAwait` arguments and
the two warning-merge statements — and the single kill that moved is a mutant 5.1.0's Safe Mode rejects
at compile time rather than executes. No test changed, and no new survivor appeared.

7 changes: 4 additions & 3 deletions docs/parity.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,13 @@ delivered by this document.
python docs/tools/validate-pdfa.py --verapdf <verapdf.bat> --profile 2b archive-2b.pdf
python docs/tools/validate-pdfa.py --verapdf <verapdf.bat> archive-1b.pdf archive-3b.pdf
```
All ten files report `PASS` — five profiles of each of the two documents — and `compliance.yml` repeats the
All twelve files report `PASS` — six profiles of each of the two documents — and `compliance.yml` repeats the
run on every push and once a week with the validator pinned and `--require-version` passed, so the claim
cannot age into a sentence in a document.
Two more implementations read the same files through `validate-pdfa-cross.py`: Apache PDFBox preflight,
which shares no code with veraPDF and votes on `1b` while parsing `2b`/`3b` without a verdict, and
Ghostscript, which rewrites the document as archival output from what it understood. The agreement has
which shares no code with veraPDF and votes on `1b` while parsing the other profiles without a verdict,
and Ghostscript, which rewrites the document as archival output from what it understood. Neither has a
PDF/A-4 mode, so veraPDF is the only reading of that profile. The agreement has
teeth: a `2b` file judged as `1b` is rejected by veraPDF and by PDFBox independently.
The earlier 1.30.3 run found one defect the unit tests had not: a CID font subset without
a `/CIDSet` stream fails ISO 19005-1 clause 6.3.5-3, and the authoring writer did not emit one. It does
Expand Down
5 changes: 1 addition & 4 deletions stryker-config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"stryker-config": {
"test-projects": [
"tests/SharpCorePDF.Tests/SharpCorePDF.Tests.csproj"
],
"test-runner": "mtp",
"target-framework": "net11.0",
"configuration": "Release",
Expand All @@ -22,7 +19,7 @@
"report-file-name": "mutation-report",
"break-on-initial-test-failure": true,
"mutate": [
"**/*"
"src/**/*.cs"
]
}
}
Loading