devcon5io / mutation-analysis-plugin

Plugin for SonarQube to process mutation analysis results.
GNU Lesser General Public License v3.0
30 stars 17 forks source link

Treat no mutation analysis information as zero (0) coverage #13

Closed gmuecke closed 6 years ago

gmuecke commented 6 years ago

Currently, if no mutation information is present (i.e. no pitest report present), no metrics are generated. Because of this, quality gates as well as global measures in multi-module projects can easily be tricked by disabling pitest execution, resulting in passed quality gates as well as better overall metrics.

In order to improve this, no mutation information should be treated as 0 coverage information so that Quality Gates can define conditions even on projects without mutation analysis.

This behavior should be configurable (omit or 0) so it can be set globally as well as on a plugin basis. If no mutation information is available, only Mutation Coverage should be computed (with 0%), all other metrics should be omitted, so it become easily detectable whether Mutation Analysis is missing (only coverage) or not (full metrics provided)

See also this StackOverflow request: https://stackoverflow.com/questions/51259681/quality-gate-on-pitest-mutations-is-not-triggerd-when-project-does-not-run-pites

Treating missing information as 0-coverage is somewhat consistent with the other coverage metrics, see here https://stackoverflow.com/questions/39529432/sonarqube-projects-pass-quality-gate-when-there-is-no-data