Conversation
|
@mbj So I'm almost done testing Here's the current report: As you can see it's doing mutations to the Secondly, is there any possible way to fix or ignore this mutation? |
|
@ahawkins I have a ticked for these. This mutation will be removed. Or at least be more intelligent on them. I personally prefer to refactor the need for |
|
@mbj how do you refactor them? |
|
blah @mbj you still didn't remove those? ;) @ahawkins you can either refactor the code to not use I explained (more or less) why I don't like |
|
@ahawkins There is no general advice for all Specific advice is possible: def self.config
@config ||= Config.new
endYou lazy initialize a mutable object under a global accessible location. If you do this: class Config
INSTANCE = new
end
def self.config
Config::INSTANCE
endThe mutant is dead. Has the same public interface semantics. With less code, and race free. I generally would not use global mutable state at all. But that is another topic. |
Remove unused method
|
@mbj thanks. Next question. Almost to 100% across the project. Cannot get I see mutant is saying cannot find definition for |
|
@ahawkins The warnings about "Cannot find definition of Foo#bar" will are not really warnings. I added these at the time the matcher was not as good as today. I'll only emit these warnings in future when you explicitly asked for You can savely ignore these warnings, they'll go away soon. |
|
@ahawkins Writing code in a way thats easily mutation testable is hard. But it pays back. Does not matter what you see on twitter. People think I prefer local maxima. |
|
@ahawkins I'm busy. Cannot expand the following: Options for testing Threaded code:
|
|
@mbj what do you mean by local maxima in this context? |
|
@solnic |
|
@mbj Only 3 mutations remaining the entire code base. I'm not sure what to do about them. They are "evil" mutants. The mutant output does not include any code changes though: |
|
@ahawkins Catching up on a 4 y old thread. |
Current work in progress with @mbj