-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Mutants are killed by empty test suites? #281
Comments
Neutral mutations. Basically these are from the apply of no mutation operator, with the test signal interpretation inversed. If such a test fails you know the environment mutant creates for executing tests (isolated, parallel execution) interfere with your tests. Neutral mutations are a safeguard feature being build to detect various kinds of integration issues. Rule of thumb: When you see alive neutral mutations, something is wrong with your setup (EDIT: Or mutant). There is already some tickets about the behavior of neutral/noop mutations:
I did not had enough pain / time to solve these yet.
No. Intentionally not supported. I'm happy with the mutation operators, and had no case where I wanted to tune the operators per project or per subject.
Mutant does not support the following form:
This one is fine:
I only use the latter form, for that reason I never implemented support for the I opened an issue to track this feature. #282 Its unlikely I'll have time for this, but I agree its a nice to have. I'm closing this issue under the assumption I answered all questions. Feel free to reopen / discuss in case you do not agree. |
Thank you for answering my questions.
When I run tests against generated mutants, I got the output from mutant:
I think this also indicates the "neutral mutation." Correct me if I am wrong. |
What version of mutant you are running? Normally it should also print the test output for neutral failures. If you are not on latest The debug output you posted does not indicate a problem with unparser / mutant. Does rspec still pass your tests, even when commented out?
Mutant cannot decide which one of the following cases is true. It can only find a broken test where there should NOT be a broken test. When you insert the original code as a mutation the tests should still pass. This is a self-test safeguard feature build into mutant to detect weird edge cases where integration issues could potentially lead to false positively killed mutation tests. I need more context to debug it. Apart from the full report, a executable reproduction would be handy. BTW: I formatted your reply a bit to render better, use code blocks in future to pass output / code, makes it much easier for people to understand. |
I am using mutant 0.6.7 and this version also gives failure outputs. I Thank you for reminding me the failure outputs. After I looked at these I think it will be easier for future users to use mutant if you could On Sun, Jan 11, 2015 at 6:46 AM, Markus Schirp [email protected]
|
This is not so easy. Mutant hooks deeply into rspec APIs, and those changed between rspec 2 and rspec 3 releases. This deep hooking is needed to make killing efficient and test selection fine grained. I have the policy to only support my usecases in my OSS projects, unless there is a good reason to support features / environments I do not use. Upgrading from rspec 2 to rspec 3 is very easy, so this change does not fall into that category. My OSS time is very limited and this policy makes sure I use it efficiently. Sorry. |
Yeah, they where exactly made for that kind of environment debugging.
The database is shared state that gets modified concurrently when you run mutant with paralellization. Even under a single execution thread dirty state can be leaked as your tests and even your ruby interpreter can crash any time when executing mutated code. See #265. With such a crash shared global state leaks into the next test. And the neutrals save you from killing your mutations by environment, not by tests. You need to make sure there is nothing leaking through spec examples. For some projects I needed to develop a custom data base cleaner that wrapped each test into a
There is a way more to document. Every reachable global mutable state needs to be protected.
Thankfully writing a "mutant compatible" test suite also typically forces you to write "real" unit tests, so this kind of state leaks are rare. I can currently not envision how to explain all this in a README section. But I should explain the role of neutral mutations for detecting anormalizes and the strategy to deal with them. Thx for your report. |
Thank you for the reply. It really helped me understand how mutant works On Mon, Jan 12, 2015 at 8:29 AM, Markus Schirp [email protected]
|
Thx for reporting your issues. I use my answers here to build up an inventory of text I can use for writing some real documentation in future. Keep asking please! |
Three questions:
class << self
...
end
The text was updated successfully, but these errors were encountered: