commit 2d0ec51c38558ce998f83d1d6989ac97070e5de6 from: Sergey Bronnikov date: Mon Dec 07 16:51:17 2020 UTC Update HTML template commit - f20ac5dfb78a9af1b0691535ab6e4880c5d7ee4a commit + 2d0ec51c38558ce998f83d1d6989ac97070e5de6 blob - 8ad3f666594e3a4d838684db12cd4c2ecbd3d3d6 blob + a40b88c4df4cdc8c1ab810d4dfe066d126abbe0e --- generate.py +++ generate.py @@ -47,97 +47,205 @@ DEFAULT_HTML_TEMPLATE = """ Mutation testing results + +

Mutation testing results

-
Mutation states
-
-
Killed
- {{ killed }} -When at least one test failed while this mutant was active, the mutant is -killed. -
+

Mutation states

-
-
Survived
- {{ survived }} -When all tests passed while this mutant was active, the mutant survived. You're -missing a test for it. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Killed{{ killed }}
Survived{{ survived }}
No coverage{{ no_coverage }}
Timeout{{ timeout }}
Runtime error{{ runtime_error }}
Compile error{{ compile_error }}
Ignored{{ runtime_error }}
-
No coverage
- {{ no_coverage }} -No tests were executed for this mutant. It probably is located in a part of the -code not hit by any of your tests. This means the mutant survived and you are -missing a test case for it. -
+

Mutation metrics

-
-
Timeout
- {{ timeout }} -The running of tests with this mutant active resulted in a timeout. For -example, the mutant resulted in an infinite loop in your code. Don't spend too -much attention to this mutant. It is counted as "detected". The logic here is -that if this mutant were to be injected in your code, your CI build would -detect it because the tests will never complete. -
+{% set undetected = killed + no_coverage -%} +{% set detected = killed + no_coverage -%} +{% set covered = detected + survived -%} +{% set valid = detected + undetected -%} +{% set invalid = compile_error + runtime_error -%} +{% set total = valid + invalid + ignored -%} +{% set score = detected / valid * 100 -%} +{% set score_covered = detected / covered * 100 -%} -
-
Runtime error
- {{ runtime_error }} -The running of the tests resulted in an error (rather than a failed test). This -can happen when the testrunner fails. For example, when a testrunner throws an -OutOfMemoryError or for dynamic languages where the mutant resulted in -unparsable code. Don't spend too much attention looking at this mutant. It is -not represented in your mutation score. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Detected{{undetected}}The number of mutants detected by your tests
Undetected{{undetected}}The number of mutants that are not detected by your tests.
Covered{{ covered }}The number of mutants that your tests produce code coverage for
Valid{{ valid }}The number of valid mutants. They didn't result in a compile error or runtime error.
Invalid +{{ invalid }}The number of invalid mutants. They couldn't be tested because they produce +either a compile error or a runtime error.
Total mutants{{ total }}All mutants.
Mutation score{{ score }}The total percentage of mutants that were killed.
Mutation score based on covered code +{{ score_covered }}The total percentage of mutants that were killed based on the code coverage results.
-
-
Compile error
- {{ compile_error }} -The mutant resulted in a compiler error. This can happen in compiled languages. -Don't spend too much attention looking at this mutant. It is not represented in -your mutation score. -
+

Mutants

-
-
Ignored
- {{ ignored }} -The mutant was not tested because the config of the user asked for it to be -ignored. This will not count against your mutation score but will show up in -reports. -
-
- -
-
Mutation metrics
-
- {% set files = json_data['files'] %} +{% set mutant_index = namespace(value=0) %} {% for filename, properties in files.items() %}

Filename: {{ filename }}

-

Mutants:

+ {% for mutant in properties['mutants'] %} - +{% set mutant_index.value = mutant_index.value + 1 %} + + +{% if mutant['status'] == "Killed" %} +{% elif mutant['status'] == "Survived" %} +{% endif %} + + + + {% endfor %} +
+ +#{{ loop.index }} +{{mutant['status']}}{{mutant['mutatorName']}}
{% endfor %} -Schema version: {{ json_data['schemaVersion'] }} -

Time of generation: {{ current_time.strftime('%d-%m-%Y %H:%M') }}

+ """