Top Banner
Intro to Mutation Testing slideshare.net/ boyarsky Twitter @jeanneboyarsky Blog: http://www.selikoff.n Jeanne Boyarsky NY Java SIG 12/5/16
20

2016 java-sig-mutation-testing

Apr 14, 2017

Download

Technology

Jeanne Boyarsky
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 2016 java-sig-mutation-testing

Intro to Mutation Testing

slideshare.net/boyarskyTwitter @jeanneboyarskyBlog: http://www.selikoff.net

Jeanne BoyarskyNY Java SIG

12/5/16

Page 2: 2016 java-sig-mutation-testing

@jeanneboyarsky

Pause for a Commercial

Page 3: 2016 java-sig-mutation-testing

Why write tests?

@jeanneboyarsky

It used to work!

Page 4: 2016 java-sig-mutation-testing

How know if tests are good?

@jeanneboyarsky

Page 5: 2016 java-sig-mutation-testing

If test coverage low

@jeanneboyarsky

Write more tests!

Not ready for mutation testing of class

Page 6: 2016 java-sig-mutation-testing

If test coverage high

@jeanneboyarsky

All done!Perfect code!

Page 7: 2016 java-sig-mutation-testing

Or is it?Why is it saying

nobody is registered?

Page 8: 2016 java-sig-mutation-testing

Code Review!

Page 9: 2016 java-sig-mutation-testing

That’s a mutant!

Page 10: 2016 java-sig-mutation-testing

Too many mutants!They’re

everywhere!

Page 11: 2016 java-sig-mutation-testing

PitClipse to the rescue!

Page 12: 2016 java-sig-mutation-testing

Easy to run

Page 13: 2016 java-sig-mutation-testing

The console flies by

Page 14: 2016 java-sig-mutation-testing

We caught 5 mutants

Page 15: 2016 java-sig-mutation-testing

More detail

Page 16: 2016 java-sig-mutation-testing

The mutants live….

Page 17: 2016 java-sig-mutation-testing

Level up

Page 18: 2016 java-sig-mutation-testing

Now 32 survived

Page 19: 2016 java-sig-mutation-testing

Demo

Page 20: 2016 java-sig-mutation-testing

Tips

• JUnit tests must pass• Watch console to see if still running• Reports on whole project• Fixing one may take care of more

@jeanneboyarsky