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

mutate: add a undesired mutant filter #1135

Merged
merged 2 commits into from
Jul 9, 2020

Conversation

joakim-brannstrom
Copy link
Owner

No description provided.

@joakim-brannstrom joakim-brannstrom force-pushed the mutate-filter-equivalent-mutants branch 6 times, most recently from 4e804fe to 73ef339 Compare July 9, 2020 19:55
@joakim-brannstrom
Copy link
Owner Author

A stepping stone to solve #917

@joakim-brannstrom joakim-brannstrom force-pushed the mutate-filter-equivalent-mutants branch from 73ef339 to 8ff044d Compare July 9, 2020 20:21
@joakim-brannstrom
Copy link
Owner Author

This reduces the total number of generated mutants by 10% for the recommended mutation operators.

@joakim-brannstrom joakim-brannstrom force-pushed the mutate-filter-equivalent-mutants branch 2 times, most recently from efdcb2e to 5401e73 Compare July 9, 2020 21:14
@joakim-brannstrom joakim-brannstrom force-pushed the mutate-filter-equivalent-mutants branch from 5401e73 to 1754a56 Compare July 9, 2020 21:18
@joakim-brannstrom joakim-brannstrom merged commit cf66265 into master Jul 9, 2020
@joakim-brannstrom joakim-brannstrom deleted the mutate-filter-equivalent-mutants branch July 9, 2020 21:34
@pokgak
Copy link

pokgak commented Aug 18, 2020

Is there any docs somewhere on how to use this feature?

@joakim-brannstrom
Copy link
Owner Author

Is there any docs somewhere on how to use this feature?

It is automatically used as it is. The remark about about #917 is that with this pull request then it would be relatively simple to add the feature wherein a user would be able to specify a way that informs dextool mutate that the mutant is undesired.

I haven't prioritized it beyond this pull request but if you need it and we can work out a reasonable syntax it should be a matter of hours at the most to implement. I think it would be hard to come up with a configuration syntax for this so I have been leaning towards something like the external analyzer that you used. Such that dextool mutate calls the user-configured analyzer and asks if the mutant is undesired/desired. Dextool would call the external like this:

external_mutant_filter.py --file foo.cpp --offset-start 42 --offset-end 84 --mutant "true"

that would provide maximum flexibility for the user. Then when we find more use cases, the most common "external analyzers" etc it should be possible to integrate them in dextool mutate as built-ins.

@pokgak
Copy link

pokgak commented Aug 20, 2020

I'm using the default operators for now so the mutants generated is still reasonable and I don't need the filter anymore but I can imagine having the ability to write the filter would be useful.

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.

2 participants