Method level coverage metrics

sonarqube

(Carmen Ge) #1

I have to figure out the types of methods that lack coverage. In order to figure that out, I need a list of the methods that have less than X% coverage. I can then apply heuristics to determine if there is a certain type of functionality that is excluded from unit testing or if people randomly didn’t add tests when they had too little time or whatever other reason.

What tools are there available to perform this kind of analysis and planning?


(Alban Auzeill) #2

Hi Carmen,

Currently SonarQube provides coverage at project/file/line/condition level. e.g.:
https://sonarcloud.io/component_measures?id=org.eclipse.collections%3Aeclipse-collections-parent&metric=coverage

Let’s assume that SonarQube also provides coverage at method level, and you discover that 95% of your project methods not covered, contains almost no logic to test. What would be you reaction? You would probably consider this metric useless without a filter on method containing logic. And you will only rely on the coverage on condition, that is more related to “something containing logic”.

So what would be your suggestion about coverage at method level to ensure that we bring value and not noise?

Alban