kotlinx-kover icon indicating copy to clipboard operation
kotlinx-kover copied to clipboard

Add report task that shows bytecode coverage

Open Ezard opened this issue 2 years ago • 2 comments

Sometimes, it is very difficult to determine why a line is either partially covered or not covered at all

This is usually due to the fact that Kover reports on bytecode-level coverage, but then displays the coverage on top of the source code

With the ability to view which lines of bytecode are covered / not covered, it should be substantially easier to determine which paths through the code are actually untested

e.g. I'm currently trying to determine how the following coverage occurs:

when (response) { // fully covered
  is Success -> { // fully covered
    foo()         // fully covered
  }               // partially covered
  is Failure -> { // partially covered
    bar()         // fully covered
  }               // fully covered
}

It could be a bug with Kover, or it could be a weird path through the code that's been mapped strangely to the source code, or it could be something else - the ability to see bytecode coverage would allow this sort of thing to be diagnosed

Ezard avatar Oct 24 '23 00:10 Ezard

Relates https://github.com/Kotlin/kotlinx-kover/issues/272

shanshin avatar Oct 27 '23 12:10 shanshin