Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any good mutation testing tools for ruby 1.9 and RSpec2?

I used to use Heckle, but it is incompatible with ruby 1.9 because of issues with ParseTree. I've looked for alternatives, but the only thing that looked promising was Chaser, and that did not have any clear documentation that I could use to see if I could make it work with RSpec. It seems to have Test::Unit dependencies.

So - is anyone out there using any cool tools to really check the quality of your tests?

Alternatively - are there any coverage tools that provide better than c0 coverage? This would kind of help solve the same problem. I'm using cover_me at the moment, but it is c0, like rcov.

like image 957
Matt Van Horn Avatar asked Nov 24 '11 06:11

Matt Van Horn


2 Answers

Have you looked into the Mutant gem?

It works with Rspec.

There is a nice tutorial here

$ gem install mutant-rspec

$ mutant -I lib -r your_library --use rspec "YourClass#method_to_mess_with"
like image 145
J_McCaffrey Avatar answered Nov 16 '22 03:11

J_McCaffrey


Chaser also works with a mutation testing framework exemplor: exemplor-chaser.

Unfortunately, the creator of chaser has the attention span of a goldfish and isn't maintaining it any more. He's kind of interested in mutant, and also in seeing if heckle can be modified to use ruby_parser rather than ParseTree.

like image 27
Andrew Grimm Avatar answered Nov 16 '22 02:11

Andrew Grimm