Leanpub Header

Skip to main content

Mutation Testing

Better Code by Making Bugs

Are you already using TDD, measuring test coverage, and running static code analysison your code? Maybe you're wondering whether there's a “next level” in code quality? If so, you should check out this book and learn about mutation testing. Mutation testing changes your source code and then checks back whether your unit tests can catch the changes, just like they should catch bugs. Can they? Find out how it works, and why it works in this book.
Free With Membership

With Membership

Free!

$7.99

You pay

$7.99

Author earns

$6.39
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
293
Readers
107
Pages
22,161Words
About

About

About the Book

Author

About the Author

Filip van Laenen

Contents

Table of Contents

Work In Progress

  1. Backlog

Foreword

Preface

  1. How To Read This Book
  2. Who Should Read This Book

Acknowledgements

1.Introduction

2.Basics of Mutation Testing

  1. 2.1Source Code and Unit Tests
  2. 2.2Mutations, Mutants and Mutators
  3. 2.3Killed and Surviving Mutants
  4. 2.4Equivalent Mutants
  5. 2.5Higher Order Mutations

3.A Practical Example

4.Does Mutation Testing Work?

5.Relation to Other Testing Techniques

  1. 5.1Unit Testing
  2. 5.2Test Coverage
  3. 5.3Static Code Analysis
  4. 5.4Mutation Testing and the TDD Workflow
  5. 5.5Fuzz Testing

6.History of Mutation Testing

7.Mutation Testing Techniques

  1. 7.1How to Create Mutants
  2. 7.2Selecting and Prioritizing Unit Tests
  3. 7.3Infinite Loops

8.How to Use Mutation Testing

  1. 8.1Daily Use for a Developer
  2. 8.2Daily Use in a Project
  3. 8.3Daily Use for a Tester
  4. 8.4Introducing Mutation Testing into a Project

9.Mutators

  1. 9.1Comparison Boundary Mutators
  2. 9.1.1Greater-than into Greater-than-or-equal-to Mutator
  3. 9.1.2Greater-than-or-equal-to into Greater-than Mutator
  4. 9.1.3Less-than into Less-than-or-equal-to Mutator
  5. 9.1.4Less-than-or-equal-to into Less-than Mutator
  6. 9.2Conditionals Negation Mutators
  7. 9.2.1Equal-to into Not-equal-to Mutator
  8. 9.2.2Not-equal-to into Equal Mutator
  9. 9.2.3Greater-than into Less-than-or-equal-to Mutator
  10. 9.2.4Greater-than-or-equal-to into Less-than Mutator
  11. 9.2.5Less-than into Greater-than-or-equal-to Mutator
  12. 9.2.6Less-than-or-equal-to into Greater-than Mutator
  13. 9.3Equality versus Identity Mutators
  14. 9.3.1Equal-to into Identical-to Mutator
  15. 9.3.2Identical-to into Equal-to Mutator
  16. 9.4Remove and Negate Conditionals Mutators
  17. 9.4.1Conditional into True
  18. 9.4.2Conditional into False
  19. 9.4.3Negation of Conditional
  20. 9.5Arithmetic Mutators
  21. 9.5.1Addition into subtraction
  22. 9.5.2Subtraction into addition
  23. 9.5.3Multiplication into division
  24. 9.5.4Division into multiplication
  25. 9.5.5Remainder into multiplication
  26. 9.5.6And into or
  27. 9.5.7Or into and
  28. 9.5.8Xor into and
  29. 9.5.9Bitwise-shift-left into bitwise-shift-right
  30. 9.5.10Bitwise-shift-right into bitwise-shift-left
  31. 9.5.11Unsigned-bitwise-shift-right into bitwise-shift-left
  32. 9.6Increments Mutators
  33. 9.6.1Increment into decrement
  34. 9.6.2Decrement into increment
  35. 9.7Invert Negatives Mutators
  36. 9.8Inline Constant Mutators
  37. 9.9Return Values Mutators
  38. 9.10Method Call Mutators
  39. 9.10.1Void Method Call Deletion
  40. 9.10.2Non-Void Method Call Deletion
  41. 9.10.3Constructor Call Deletion
  42. 9.10.4Naked Receiver Mutator
  43. 9.11Member Variable Mutators
  44. 9.12Switch Mutators
  45. 9.13Regular Expressions Mutators
  46. 9.14Concurrency Mutators
  47. 9.15Interface Mutators
  48. 9.15.1Interface Method Deletion
  49. 9.15.2Empty Class Method Deletion
  50. 9.15.3Method Visibility Reduction
  51. 9.15.4Attribute Visibility Reduction
  52. 9.15.5Class Visibility Reduction
  53. 9.15.6Empty Interface Deletion
  54. 9.15.7Empty Class Deletion
  55. 9.16Inheritance Mutators
  56. 9.16.1Class Extension Deletion
  57. 9.16.2Interface Implementation Deletion
  58. 9.16.3Interface Extension Deletion

10.Tools

  1. 10.1Recommended Tools
  2. 10.2C
  3. 10.2.1Proteum
  4. 10.3C#
  5. 10.3.1Visual Mutator
  6. 10.3.2NinjaTurtles
  7. 10.3.3CREAM
  8. 10.3.4Nester
  9. 10.4C++
  10. 10.4.1PlexTest
  11. 10.5Fortran-77
  12. 10.5.1Mothra
  13. 10.6Go
  14. 10.6.1Go-mutesting
  15. 10.6.2Mutator
  16. 10.6.3Manbearpig
  17. 10.6.4Golang-mutation-testing
  18. 10.7Haskell
  19. 10.7.1MuCheck
  20. 10.8Java
  21. 10.8.1LittleDarwin
  22. 10.8.2Major
  23. 10.8.3Jumble
  24. 10.8.4µJava
  25. 10.8.5PIT
  26. 10.8.6Javalanche
  27. 10.8.7Simple Jester
  28. 10.8.8Jester
  29. 10.8.9Mutator
  30. 10.9Javascript
  31. 10.9.1Stryker
  32. 10.9.2Mutagen
  33. 10.9.3Grunt-mutation-testing
  34. 10.9.4Mutandis
  35. 10.9.5AjaxMutator
  36. 10.10Perl
  37. 10.10.1Devel::Mutator
  38. 10.11PHP
  39. 10.11.1Humbug
  40. 10.11.2MutaTesting
  41. 10.12Python
  42. 10.12.1Cosmic Ray
  43. 10.12.2Mutmut
  44. 10.12.3MutPy
  45. 10.12.4Elcap
  46. 10.12.5PyMuTester
  47. 10.12.6Pester
  48. 10.13Ruby
  49. 10.13.1Mutiny
  50. 10.13.2Mutant
  51. 10.13.3Heckle
  52. 10.13.4Boo_hiss
  53. 10.14Smalltalk
  54. 10.14.1SMutant
  55. 10.14.2MuTalk

Glossary

References

Photo Credits

Index

  1. A
  2. B
  3. F
  4. M
  5. P
  6. R
  7. S
  8. T
  9. U
  10. V

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub