Skip to content
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

first stab at statementRemoverMutator #3913 #3916

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

magwas
Copy link

@magwas magwas commented Dec 24, 2022

This is a preview. Works for me because the code I am using it with is really small and primitive.
I would like to get some feedback on which statements to remove, and which ones not to remove.
And ofc on the general direction.
I intend to work on the project with which I use stryker, and update the mutator in an as-needed basis, and also incorporate feedback here.

@nicojs
Copy link
Member

nicojs commented Dec 25, 2022

I would love this mutator. Stryker.NET also has it, but they call it the block statement mutator if I'm not mistaken.

It has an additional feature, which I would love. Statements are not removed when there are other mutants generated anywhere in the statement. I view that as a requirement for this mutator because it would otherwise generate many mutants of low quality.

@richardwerkman @rouke-broersma could one of you elaborate on how that works in Stryker.NET? Do you generate mutants and later decide which ones to keep, filtering out these low-quality mutants? Or did you make the "block statement" mutator "smart"?

@rouke-broersma
Copy link
Member

No we have both. We call them removal mutators. Statement and block: https://stryker-mutator.io/docs/stryker-net/mutations/#removal-mutators-statement-block

@magwas
Copy link
Author

magwas commented Dec 25, 2022

It has an additional feature, which I would love. Statements are not removed when there are other mutants generated anywhere in the statement. I view that as a requirement for this mutator because it would otherwise generate many mutants of low quality.

As I understand there is no info in the mutator itself to decide on it. Ofc. it is an option to modify the calling code.

I consider that feature as an optimization. First I concentrate to get the functionality together.

@nicojs
Copy link
Member

nicojs commented Dec 25, 2022

No we have both. We call them removal mutators. Statement and block

@rouke-broersma do you have a way to make sure these mutants are generated when there are no other mutants generated in the (block)statement?

@rouke-broersma
Copy link
Member

Not sure on the specifics of the implementation, @richardwerkman ?

@richardwerkman
Copy link
Member

The specifics of the implementation are: we don't have an implementation... I wanted to add that but so far without success. For now, we place these mutations all the time. Despite it generating some unwanted mutants.

I had some ideas like filtering the mutants after generating them. Or keeping track of context and passing a value to mutators that helps identify if a mutant has been placed in this scope already.

@richardwerkman
Copy link
Member

I've created an issue at stryker-net for this: stryker-mutator/stryker-net#2367

@magwas
Copy link
Author

magwas commented Dec 31, 2022

I added my experiment for functioncall remover mutator here as well #3920

@magwas
Copy link
Author

magwas commented Feb 23, 2023

I have updated the snapshots, fixed eslint problems (not mine), and a couple of tests (one was not mine). Now npm run all runs okay.
There are some errors in npm run e2e. I have no idea what causes them or how to fix them.

This is the point when I consider this pull request ready.

If anything else is needed for acceptance, I need guidance.

@magwas
Copy link
Author

magwas commented Mar 4, 2023

Any news with this PR?
If anything should be fixed to make it acceptable, please let me know.

@magwas
Copy link
Author

magwas commented Mar 11, 2023

Anything I can do to get this pull request accepted?

@magwas
Copy link
Author

magwas commented Mar 25, 2023

Anything I can do to get this pull request accepted?

@nicojs
Copy link
Member

nicojs commented Oct 3, 2023

I've opened issue #4463. We should tackle it during hacktober. I think that should be implemented before we can merge this PR.

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.

None yet

4 participants