-
Notifications
You must be signed in to change notification settings - Fork 162
feat: set mutator #955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: set mutator #955
Conversation
bc93823 to
43b5a02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Set mutation in the Jazzer mutation framework, mirroring the existing implementations for List and Map.
Key Changes
- Implemented
SetMutatorFactorywith mutation operations (delete, insert, mutate chunks) and crossover operations - Extended
ChunkMutationsandChunkCrossOversutility classes to support Set operations - Added comprehensive test coverage in
SetMutatorTestwith parameterized tests for all operations - Updated
@WithSizeannotation to support Set types alongside List and Map
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| SetMutatorFactory.java | New factory implementing Set mutation with chunk-based operations similar to List/Map mutators |
| CollectionMutators.java | Registered SetMutatorFactory in the list of available mutator factories |
| ChunkMutations.java | Added mutateRandomChunk method for Set with duplicate handling logic |
| ChunkCrossOvers.java | Added insertChunk, overwriteChunk, and crossOverChunk operations for Set |
| WithSize.java | Extended annotation to apply to Set types |
| TestSupport.java | Added utility methods: asSet, isEmpty, getCallerMethodName, and ParameterizedTestUtils.prependArgs |
| SetMutatorTest.java | Comprehensive parameterized tests covering all Set mutation and crossover operations |
| StressTest.java | Added stress test cases for Set types and setSizeInClosedRange helper |
| ArgumentsMutatorFuzzTest.java | Added fuzz tests for Set types and fixed typo in method name |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/code_intelligence/jazzer/mutation/mutator/collection/SetMutatorFactory.java
Outdated
Show resolved
Hide resolved
src/test/java/com/code_intelligence/jazzer/mutation/mutator/StressTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/code_intelligence/jazzer/mutation/mutator/collection/SetMutatorTest.java
Show resolved
Hide resolved
src/test/java/com/code_intelligence/jazzer/mutation/mutator/collection/SetMutatorTest.java
Show resolved
Hide resolved
selffuzz/src/test/java/com/code_intelligence/selffuzz/mutation/ArgumentsMutatorFuzzTest.java
Show resolved
Hide resolved
selffuzz/src/test/java/com/code_intelligence/selffuzz/mutation/ArgumentsMutatorFuzzTest.java
Show resolved
Hide resolved
43b5a02 to
5f9e596
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Very thorough test cases. 🚀
src/main/java/com/code_intelligence/jazzer/mutation/mutator/collection/SetMutatorFactory.java
Outdated
Show resolved
Hide resolved
5f9e596 to
ccb46bc
Compare
Adds a Set mutator to the mutation framework.