mbj / mutant

Automated code reviews via mutation testing - semantic code coverage.
Other
1.93k stars 151 forks source link

Make mutant refinements aware #333

Open nepalez opened 9 years ago

nepalez commented 9 years ago

Seems like mutant doesn't apply ruby 2.1+ refinements and complains about undefined methods instead.

mbj commented 9 years ago

@nepalez Can you get me a small / repo-gist with reproduction? I'm curious which specific scenario you ran into. I personally do not use refinements for various reasons, so mutant was not tested against them.

nepalez commented 9 years ago

@mbj For example, mutant breaks on my latest tiny gem

It doesn't recognize usage of Patches in this method, complaining that patched Object#kind_of_service_class? is not defined, while it is.

mbj commented 9 years ago

As I think refinements are an antifeature, and my OSS policy is to only support my own needs (while still opensourcing so others can benefit), I'm close to consider this a WONTFIX issue, unless someone is:

//cc @dkubb, @snusnu, @solnic, @ahawkins Your opinion?

solnic commented 9 years ago

+1 to ignoring refinements

On Wed, May 27, 2015 at 11:28 PM Markus Schirp notifications@github.com wrote:

As I think refinements are an antifeature, and my OSS policy is to only support my own needs (while still opensourcing so others can benefit), I'm close to consider this a WONTFIX issue, unless someone is:

  • PRing support for refinements and shows enough willingness to support it (each feature is a maintenance burden)
  • Pays me to implement AND support it (as above each feature is a maintenance burden)

//cc @dkubb https://github.com/dkubb, @snusnu https://github.com/snusnu, @solnic https://github.com/solnic, @ahawkins https://github.com/ahawkins Your opinion?

— Reply to this email directly or view it on GitHub https://github.com/mbj/mutant/issues/333#issuecomment-106084857.

dkubb commented 9 years ago

I dislike refinements because it encourages monkey patching. Localizing the effects does not make it a good idea.

ahawkins commented 9 years ago

Ignore IMO.

On Wed, May 27, 2015, at 11:28 PM, Markus Schirp wrote:

As I think refinements are an antifeature, and my OSS policy is to only support my own needs (while still opensourcing so others can benefit), I'm close to consider this a WONTFIX issue, unless someone is:

  • PRing support for refinements and shows enough willingness to support it (each feature is a maintenance burden)
  • Pays me to implement AND support it (as above each feature is a maintenance burden) //cc @dkubb[1], @snusnu[2], @solnic[3], @ahawkins[4] Your opinion?

— Reply to this email directly or view it on GitHub[5].

Links:

  1. https://github.com/dkubb
  2. https://github.com/snusnu
  3. https://github.com/solnic
  4. https://github.com/ahawkins
  5. https://github.com/mbj/mutant/issues/333#issuecomment-106084857
mbj commented 9 years ago

From that feedback I think we should simply should ignore "refinement infection", and skip over these subjects when matching.

Mutant could warn with something like:

Cannot emit subject for Foo#bar because its refinement infected see: $link_to_this_issue

Instead of crashing (thats a bug I want to fix always).

nepalez commented 9 years ago

It would be nice

mbj commented 9 years ago

It would be nice

Feel free to PR support with good mutation covering specs and I'll merge it. And or pay me to implement/maintain it. I literally cannot make anyone happy, I'm sorry you are affected by this policy right now.

mbj commented 8 years ago

I like the idea, but I do not have a need to do it for my projects. So tagging as not-on-authors-free-time to encourage funding or (preferred) outside contribution.

nepalez commented 8 years ago

Well, I think you're right.

Actually this PR and your reaction motivated me to exclude refinements from my code. I've found functional approach (transproc etc.) far more clean.

mbj commented 8 years ago

Actually this PR

Its an issue, did I miss a PR?

I've found functional approach (transproc etc.) far more clean.

Ack. But still I got funding for some mutant features (concurrency especially). So I'll keep this one open as an eye catcher for peoples that MUST have this, so can PR or fund it. Maybe fore legacy reasons, they want to cover the current behavior using refinements before migrating away etc.

nepalez commented 8 years ago

Its an issue, did I miss a PR?

No, you didn't. The devil beguiled me