mbj / mutant

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

Dubious Mutation: super(*arguments) -> super #15

Closed postmodern closed 11 years ago

postmodern commented 11 years ago
Alive: rspec:Ronin::SQL::Fields#method_missing:/vault/1/code/ronin/ronin-sql/lib/ronin/sql/fields.rb:55:1ff3e (2.24s)
@@ -2,7 +2,7 @@
   if ((arguments.empty?) && (block.nil?))
     Field.new(name)
   else
-    super(name, *arguments, &block)
+    super
   end
 end
mbj commented 11 years ago

Why this is not a valid mutation?

postmodern commented 11 years ago

super without arguments implicitly passes all arguments.

mbj commented 11 years ago

I know. It is a Rubinius::AST::ZSuper node with differend bytecode and behavior. So again why this is not a valid mutation?

postmodern commented 11 years ago

Doesn't change behaviour, mutant doesn't get killed.

mbj commented 11 years ago

So you explicit argument passing is just the same as using the zsuper node. You should refactor your code to use the zsuper to kill it.

A good strategy is to change the code to the mutation, and try to create a spec that forces you to switch back. If you cannot find such a spec, just accept the code ;).

postmodern commented 11 years ago

Ah good point. Let me try.

mbj commented 11 years ago

Heh, using this strategy, can I convince you to omit unneeded explicit returns also? ;)

postmodern commented 11 years ago

Sorry, having a local variable dangling at the end of a method looks weird (to me).

mbj commented 11 years ago

Was a try ;)

On Mon, Jan 21, 2013 at 12:58:03AM -0800, Postmodern wrote:

Sorry, having a local variable dangling at the end of a method looks weird.


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

Markus Schirp

Phone: +49 201 / 360 379 14 Fax: +49 201 / 360 379 16 Web: www.seonic.net Email: mbj@seonic.net Twitter: twitter.com/_m_bj OS-Code: github.com/mbj

Seonic IT-Systems GbR Anton Shatalov & Markus Schirp Altendorferstrasse 44 D-45127 Essen

mbj commented 11 years ago

@postmodern Can we close this issue?

mbj commented 11 years ago

Thx.