Think you write good tests? Not bloody likely... Put it to the test with heckle. It’ll put your code into submission in seconds.

The premise is really really simple to understand:

  1. Your tests should pass.

  2. Break your code.

  3. Now they should fail.

You could check this by hand, but why bother? Use heckle and put it to the test:

heckle -f ClassName

For each failure heckle points out, you've got a test to write.

Chances are, your tests suck.


Confessions of a Ruby Sadist

sudo gem install heckle

if month > 12 then

  if month % 12 == 0 then

    year += (month - 12) / 12

    month = 12


    year += month / 12

    month = month % 12



Heckle sees this code and mutates every colored element, just to make sure you checked them.

if becomes unless, calls get replaced, numbers get changed, assignments get changed, etc.

It makes one change at a time, rerunning the tests in-between. If they don't fail, you're missing a test. There are probably many tests you didn't write.

Yup, Heckle is just downright mean...