-
Notifications
You must be signed in to change notification settings - Fork 135
Expand mutation operators with built‑in name swaps and regex fuzzing #380
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
Conversation
Magic-Man-us
commented
Apr 20, 2025
- Extend operator_name to flip more built‑ins (len↔sum, min↔max, all↔any, str↔repr, etc.)
- Add operator_regex to mutate regex literals (quantifier swaps, {1,}↔+, \d↔[0-9], char‐class reversal)
- Register operator_regex alongside other call mutations
- Update tests to cover new regex and name‐swap behaviors
|
Hi, thanks your contribution, many new mutations that could uncover missing tests :) There are some mutations, where to me it seems they don't bring much value to mutation testing. If you want, some of them could be reworked, or you can simply drop them for now and we can revisit them later. In particular, some of the mutations seem like "equivalent mutants", I think we should remove or adapt them. When we would include these mutations, the unit tests won't have a chance to detect them as the mutation behaves identical to the original code. So these are like false positives and we should try to keep their number low. The following mutations seem like they could produce many equivalent mutants:
The Regarding |
tests/test_mutation.py
Outdated
| m for m in mutants | ||
| if "(None)" not in m | ||
| and "XX" not in m | ||
| ] |
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.
This filtering seems redundant to me. If want in filtered then want in mutants is also true.
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.
You are right, I will remove this
|
You are spot on with a lot of this. I apologize for not getting back earlier its been a busy week . In the meantime I was thinking of some problems I saw in the past and of course, I did not experience 😅 ... I will update sometime this weekend. |
9fa1d44 to
286514e
Compare
|
Hi, you can ping me when your changes are review-ready :) |
286514e to
ceacaae
Compare
3cfbd0f to
66e4162
Compare
|
Thanks for the feedback @Otto-AA ! I've addressed your concerns about equivalent mutants. This introduces improvements to the mutation testing focusing on eliminating equivalent mutations as you had mentioned prior, additionally, adding meaningful function call mutations, and enhancing regex mutation handling. it includes comprehensive updates to tests for better coverage and accuracy. Below is a summary of the most important changes grouped by theme. Mutation Framework Enhancements
Code Quality Improvements
Test Coverage Enhancements
These changes should enhance the reliability and effectiveness of the mutation testing framework while ensuring even more test coverage. |
|
Hi @Magic-Man-us , I do not want to spend my free time on reviewing an AI. And btw, the previous PR looked much more useful than this. If you do not have any more time to work on this, then just say so, but please don't let me review an AI output instead. |