Java Magazine, Nov/Dec 2016
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2016 49 junit 5 information Each package is listed with its overall line coverage and its mutation score shown side by side You can drill down into each source file to get a report such as the one shown in Figure 1 Line coverage is shown as blocks of color that span the width of the page Green indicates that a line is executed by tests and red indicates that it is not The number of mutations created on each line is shown between the line number and the code If you hover over the number youll get a description of the mutations that were created and their status If all the mutants were killed the code is shown in darker green If one or more of them survived the code will be highlighted in red Theres additional useful information at the bottom of the report a list of all the tests that were used to challenge the mutants in this file and how long each of them took to run Above this is a list of all the mutations If you hover over them youll see the name of the test that killed the mutant Google Truth was developed without using pitest or any other mutation testing tool and on the whole the team that developed it did a very good job A mutation testing score of 88 percent is not easy to achieve But still there are holes The most interesting mutants are the ones that appear on the green lines that indicate they were covered by tests If a mutant was not covered by a test it is not surprising that it survived and does not give any additional information compared to line coverage But if a mutant was covered you have something to investigate Figure 1 A report generated by pitest
You must have JavaScript enabled to view digital editions.