Uploaded April 2018 | Updated September 2026, 3 hours ago
Code without tests is code that is going to sneak up behind you while you’re texting on your phone, put glue in your hair and steal your lucky horseshoe from your bag. Evil! But how can you find those dastardly lines? Traditionally we’ve used test coverage metrics (e.g. Istanbul) to track down those villains but coverage has a lot of gaps. A test can execute 100% of code without performing any assertions, giving you a false sense of security.
What's the solution then? Fight back against those villains by unleashing mutants! Don't worry, you don't have to drink radioactive coolaid, we're talking about mutation testing. It involves using a tool like StrykerJS to programatically insert bugs (mutants) into your code and check whether the tests catch them. Having 100% test coverage is a noble goal but ultimately not very useful as it says nothing about the test suite's ability to catch bugs. On the other hand, having a 100% mutant kill score is a big deal. It means that your assertions can effectively pick up most potential bugs.
Next time your manager asks for a risk analysis of the company's test suite, you'll know what to do: call in the mutants!
Code without tests is code that is going to sneak up behind you while you’re texting on your phone, put glue in your hair and steal your lucky horseshoe from your bag. Evil! But how can you find those dastardly lines? Traditionally we’ve used test coverage metrics (e.g. Istanbul) to track down those villains but coverage has a lot of gaps. A test can execute 100% of code without performing any assertions, giving you a false sense of security.
What's the solution then? Fight back against those villains by unleashing mutants! Don't worry, you don't have to drink radioactive coolaid, we're talking about mutation testing. It involves using a tool like StrykerJS to programatically insert bugs (mutants) into your code and check whether the tests catch them. Having 100% test coverage is a noble goal but ultimately not very useful as it says nothing about the test suite's ability to catch bugs. On the other hand, having a 100% mutant kill score is a big deal. It means that your assertions can effectively pick up most potential bugs.
Next time your manager asks for a risk analysis of the company's test suite, you'll know what to do: call in the mutants!










