A life comited to learning

Mutation Testing with PITest and JUnit

What? More testing? This time are the tests for your tests. Mutation Testing analyses your code, and based on some heuristics change it to try to “kill” your tests. If if can kill all your tests, then your tests are probably fine, otherwise maybe your coverage it’s not as good as you may think. PIT is a framework worth looking, since it integrates with maven and seems to be maintained. http://pitest.org/

Just use the maven plugin to try with your maven projects and see the results.

There are other tools for mutation Testing with Java and JUnit, but did not try:

http://jester.sourceforge.net/
http://jmute.sourceforge.net/
http://jumble.sourceforge.net/

jpereira

http://jpereira.eu

View more posts from this author
2 thoughts on “Mutation Testing with PITest and JUnit
  1. Carlos Rodrigues

    The results of mutation testing are really interesting. Sometimes we think our tests are bullet proof but it isn’t true. I’m using pit and I’m really amazed with the results.

     

Leave a Reply

Your email address will not be published. Required fields are marked *