cosmic-ray icon indicating copy to clipboard operation
cosmic-ray copied to clipboard

Reconsider the relational-operator skip set

Open abingham opened this issue 9 years ago • 1 comments

In the relational-operator replacement operator code, we have a set of replacements which we explicitly prevent. We do this because it seems that the replacements in question do little other than create equivalent mutants.

However, I may be wrong in my reasoning. It may be that we need these replacements. Reconsider these when you have time to really sort it out.


  • Bitbucket: https://bitbucket.org/austin_bingham/cosmic-ray/issue/22
  • Originally reported by: austin_bingham
  • Originally created at: 2015-03-28T12:43:44.956

abingham avatar Apr 18 '15 08:04 abingham

I think we can detect many bothersome equivalent mutants at runtime – and in particular the set of mutants skipped in the current implementation. We can't do this statically, but we can do it dynamically during the init test run.

We could detect the default and common case that equality tests boil down to equality of identity (that is a == b is equivalent to a is b) as follows: We could replace the operator by a call to our own function. This function could check type(a).__eq__ is object.__eq__ as the test is running, and if it is, discard this particular mutation as being equivalent. We've need to take care to preserve the semantics of the operators, but this is doable.

rob-smallshire avatar Nov 27 '17 14:11 rob-smallshire