Code Coverage – Full Stack QE https://fullstackqe.org Just another WordPress site Fri, 26 Jun 2020 18:55:27 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.6 155680629 Mutation testing with Stryker https://fullstackqe.org/mutation-testing-with-stryker/ Fri, 26 Jun 2020 18:55:24 +0000 https://fullstackqe.org/?p=356 Continue reading "Mutation testing with Stryker"

]]>

Test your tests with mutation testing.

What is mutation testing?

Bugs, or mutants, are automatically inserted into your production code. Your tests are run for each mutant. If your tests fail then the mutant is killed. If your tests passed, the mutant survived. The higher the percentage of mutants killed, the more effective your tests are.

It’s that simple.

Are you still confused? Why not take a look at our example page and try it out yourself?

But wait, what about code coverage?

Well… code coverage doesn’t tell you everything about the effectiveness of your tests. Think about it, when was the last time you saw a test without an assertion, purely to increase the code coverage?

Imagine a sandwich covered with paste. Code coverage would tell you the bread is 80% covered with paste. Mutation testing, on the other hand, would tell you it is chocolate paste and not… well… something else.

Meet: Stryker

Sounds complicated? Don’t worry! Stryker has your back. It uses one design mentality to implement mutation testing on three platforms. It’s easy to use and fast to run. Stryker will only mutate your source code, making sure there are no false positives.

Checkout this example which demonstrates why code coverage is not sufficient and why there is a need for tools like Stryker – https://stryker-mutator.io/example

Stryker is an open source tool. Give this a try: https://stryker-mutator.io/

]]>
356