Code Coverage broken by Executable Lines

34 views
Skip to first unread message

Wilhelm S. Teinitz

unread,
Jan 18, 2018, 3:14:42 AM1/18/18
to SonarQube
Hi,

the feature "executable lines" (at least in its current implementation)  breaks the logic of code coverage.

When using code coverage metrics we want to measure code coverage on business logic, not on a domain model, UI or a data access layer (where other testing strategies like integration tests or automated UI tests are applied).
.NET uses projects/assemblies inside of a solution to define such layers, that's why every code coverage tools allows to define which assemblies should be considered for measuring coverage (by using a .runsettings file).

While SonarQube simply would import the coverage report and display it (a sensible approach), the new feature "Executable lines" reinterprets the coverage report by calculating its own metrics using all executable lines in all layers which not only breaks existing functionality but also contradicts the architectural needs and concepts of unit testing.
If we want to exclude code we now have to use additional code exclusions in the SonarQube settings - which not only is unnecessary double trouble, but also not really working as it uses a file mask relative to a component while the correct approach would be to allow the exclude a whole component.

We urgently need a fix for this - for example an option (server- and project-level) to simply import the code coverage results (to get the same behaviour as before) or at least an option to exclude whole components in a convenient manner,

Best regards,
 Gregor

michal....@sonarsource.com

unread,
Jan 22, 2018, 8:07:27 AM1/22/18
to SonarQube
Reply all
Reply to author
Forward
0 new messages