test: strengthen tests against PIT mutants (85% → 90% strength)#39
Merged
Conversation
Mutation analysis (./mvnw -pl zstd -P pitest verify) surfaced surviving mutants in the I/O streams, context dictionary/prefix paths, size guards, and native-library lookup. Add behavior-asserting tests that kill them: - ZstdStreamTest: flush reaches the sink, close idempotency, unsigned read() value, EOF stays -1 across both read overloads, refill boundaries - RefPrefixTest: fluent setters return the same context (chaining contract) - NativeLibraryTest: missing-symbol lookup throws - ZstdParameterTest: level() actually applies to the native path - ZstdSegmentTest / ZstdErrorTest: decompress dict path, native error name Killed 327 -> 354 of 406 mutations; test strength 85% -> 90%; no-coverage 21 -> 12. Remaining survivors are mostly equivalent (native-call wrapper lambda returns). Tests only; no production changes. Co-Authored-By: Claude Opus 4.8 <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.
What
Mutation analysis (
./mvnw -pl zstd -P pitest verify) surfaced surviving mutants in the byte-level I/O streams, context dictionary/prefix paths, size guards, and native-library lookup. This adds behavior-asserting tests that kill them.Coverage added
sink.size()), close idempotency, unsignedread()value, EOF stays-1across bothreadoverloads, refill boundariesUnsatisfiedLinkErrorlevel()actually applies to the native path (min vs max → strictly smaller frame)Result
Remaining survivors are mostly equivalent (native-call wrapper lambda returns). Tests only — no production changes. Reviewed by the project review agent (APPROVE); all Given/When/Then conventions satisfied.
🤖 Generated with Claude Code