How are you guys dealing with code coverage? It s...
# compose
a
How are you guys dealing with code coverage? It seems that jacoco considers the code at bytecode which is more complex than the composable functions. Therefore it underreports coverage.
a
If you test the composables using paparazzi wouldn’t it count all of the code as covered? Do you mean that because the lines of code grows with compose compiler it means lower % in a module than you expect?
a
Exactly. Sonar also uses jacoco data to calculate cyclomatic complexity. So it complains that my tests are not covering all conditionals. My composable has no conditionals at all. But if I decompiler I see that compose compiler has added several. I found the related jacoco issue https://github.com/jacoco/jacoco/issues/1208
https://www.jacoco.org/jacoco/trunk/doc/flow.html
mplementing a coverage tool that supports statement (C0) as well as branch coverage coverage (C1) requires detailed analysis of the internal control flow of Java methods. Due to the architecture of JaCoCo this analysis happens on the bytecode of compiled class files.
p
Maybe try Kover with IntelliJ engine?
a
someone on my team tried , and not many improvements