Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mutation Testing with Mutant

Mutation Testing with Mutant

Tests are a good tool to verify your code but how do you verify your tests? Mutation testing is a technique to evaluate the quality of your tests by programmatically mutating (i.e. making a series of small modifications to) your code and ensuring that the tests no longer pass. This talk will attempt to demonstrate the value of mutation testing and show you how to use Mutant to improve the quality of your tests and your code.

1f74b13f1e5c6c69cb5d7fbaabb1e2cb?s=128

Erik Berlin

April 22, 2014
Tweet

Transcript

  1. flickr.com/photos/tomtolkien Mutation Testing with Mutant

  2. A carpenter is only as good as their tools. flickr.com/photos/matthigh

  3. What’s in your toolbox? flickr.com/photos/dk_spook

  4. Editor flickr.com/photos/audringje

  5. flickr.com/photos/laughingsquid Vim 1.0

  6. Debugger flickr.com/photos/86639298@N02

  7. Profiler flickr.com/photos/anndouglas

  8. Testing

  9. Testing flickr.com/photos/onepointfour

  10. Code has bugs Tests are code ∴ Tests have bugs

    flickr.com/photos/birdseyeview
  11. Code Coverage

  12. twitter.com/bloerwald/status/448415935926255618

  13. Mutation flickr.com/photos/tambako

  14. Original def foo(arg = true) arg || fail end assert_nothing_raised

    { foo }
  15. Mutant def foo(arg = true) arg end assert_nothing_raised { foo

    }
  16. twitter.com/kytrinyx/status/453567958317428736

  17. Demo