-
Notifications
You must be signed in to change notification settings - Fork 27
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: handling unproductive mutants #917
Comments
Yes this is coupled to how to improve NOMUT. Suppressing mutants. |
For now what exist is to mark those lines with NOMUT |
The idea I've started implementing, but put on hold, was that the user specified mutantID. I realized that this quickly became problematic in terms of scale. A user cant be expected to write that commando for every single mutant, if there are 359 as in your example. I know I wouldn't. Are we maybe thinking of an addition to the config-file? Something like:
And then we add the ability to run admin-mode and suppress those now added to the config? |
Did you consider suppressing a whole line?
I agree. Another problem is that they constantly change. The checksum is more stable.
Yes, in that direction. But probably have to allow the user to be more precis?
Shouldn't need to run in admin-mode. Being in the config file should be enough. |
Yes, I started with that. But I remembered (maybe wrongly) that the user who requested this said that maybe not ALL mutants on a row needed to be suppressed. I therefore went with the mutantID-solution first. But as I said, it was put on hold early in the phase.
Oh definitely. @christoffer-nylen Extremely good edits on the issue! :) |
User feedback: I am thinking that I can start with implementing this, so that it is atleast possible to do something. We can then evaluate and improve it with more options in the config-file, for example marking certain function-calls. |
I discussed this with a user. How to use this to mark a mutant as unproductive in a pull request. |
#946 changes how mutants are calculated which is one outcome of the discussions on this issue. |
#953 intend to solve parts of this problem by allowing the user to mark mutants manually by id via an admin command. There is obvious issues with this approach, one of them being that MutationId is very unstable and changes when the analyze phase is run again. This was however a request from a user, so atleast providing the ability to do this increases short term usability. From here, we can work towards a more complete solution or alternative (both can still be available in the tool). |
Background
The user wants to generate mutants that enforce effective testing. Some mutants are killable but unproductive. They draw attention from the productive mutants.
Example 1 - Logging
Assume:
Foo
with 19494 LoC.Foo
contains 359 invocations of a functionaddLoggMessage(param, param)
that is used for debugging purposes.addLoggMessage
usage (e.g., invokation order and contents of argument) is highly coupled to theFoo
implementation.addLoggMessage()
usage is not critical -> The user does not intend to write tests to verify its correctness.Problem:
addLoggMessage(param, param)
statements draw attention from critical problems.Evaluation criteria
The below suggestions will be evaluated to the following criteria:
Suggested solutions
The suggested solutions are based on the below comments.
Approach 0: Do nothing
Use
//NOMUT
annotations to suppress eachaddLoggMessage()
invokation.Pros:
Cons:
//NOMUT
to 359 places.Meta Approach 1: Line suppression
Example:
dextool mutate admin --suppress 52
Pros:
Approach 1.1: Line suppression + No automation
Cons:
Approach 1.1: Line suppression + User script
readme.md
with information how to write a script that detects lines containing some unproductive mutant (for exampleaddLoggMessage
).Pros:
grep
command etc.Cons:
readme.md
that might be perceived as complicated?Meta Approach 2: Filter
Pros:
Cons:
Approach 2.1: Function call filter
Adding something like this to the config-file:
Pros:
Cons:
Approach 2.2: Super expressive filter
TODO: Update background example to motivate the need for a more expressive filter.
Cons:
The text was updated successfully, but these errors were encountered: