-
Notifications
You must be signed in to change notification settings - Fork 112
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
List mutants with mutation_type? #113
Comments
A mutant In mutmut is a single mutation point and a single possible mutant. One could imagine having multiple mutants for one mutation point (e.g. changing literal 0 to 1 and -1), but I haven't implemented that and no one has reported a case where the lack of this feature would be a problem. It's already slow enough as is so there must be a strong reason to introduce many more mutants to try! Do you have some idea of what types of mutants you think are more valuable to kill? Because I would love to hear your logic, I haven't come up with such a scenario myself. In my experience the most scary sounding mutant that changes assignment from "a = b" to "a = None" mostly just means there is some dead code in practice. So it's hard to know how to prioritize! |
It's probably more of examples that are not as interesting. I ran mutmut on some code we are looking to test better/more, and some of the mutants were permutations of string constants in logging messages. That's a less interesting than mutations that change the boundary conditions of if statements and such. Given the large number of surviving mutants in our codebase, I was trying to get my arms around how to prioritize what mutants to look at/work on first. I'm not 100% sure that the mutation types would be the right way to build that prioritized list, but it seemed like mutations of operators, and/or, and numbers might be higher priority than string (for instance). |
If I understand it well, mutmut has per statement one mutant. And one mutant has 1 change in the statement. That means that a complex statement is mutated only once however multiple or possible. ie the next statement:
will only mutate the Is that the current behaviour indeed? |
No, that's not correct. It will mutate that line in 4 ways I believe. |
Hi,
Is there anyone way to list the mutations by the mutation_type? I looked init and noticed that it looks like Mutants can be made of up multiple mutations. I am trying to figure out the best way to get a listing of mutants with the types of mutations in a given Mutant.
It looks like the cache code that refers to the Mutant class doesn't have any field showing the mutations involved in a given mutant, so I wasn't sure how to reconstruct the mutations involved in creating a specific mutant.
The context is that we'd like to be able to prioritize what mutants we examine first, as we start fleshing our tests to address issues found with mutmut.
Marc
The text was updated successfully, but these errors were encountered: