Code Coverage - partial execution

In the Code Coverage facility, the help description of lines with a yellow gutter highlight is "Yellow marks indicate that the corresponding lines were executed partially". What exactly does 'executed partially' mean?

I can see that when you have a compound logical expression, such as in an 'if' statement, short-circuit evaluation may mean part of the expression isn't evaluated, but can someone explain what the 'partial execution' of the lines below means?

I'm confused - how can a line containing only a parenthesis be 'partially executed' ?

5 comments
Comment actions Permalink

It's quite natural, just think in terms of control flow graph: you can get to try completion line either successfully through try block, or after executing catch block. Since catch was not executed, hence partial coverage for that line.

0
Comment actions Permalink

OK, thanks Eugene - it appears to be just misleading terminology in the help... so 'partial execution' of a line means 'partial coverage' of a line - i.e. of all the possible paths passing through that line of code only some were taken, not that the line was only partially executed.

For those of us new to the feature it would be helpful if the help file used more precise terminology in this respect.

Message was edited by:
Dave Lorde

0
Comment actions Permalink

Dave,
I believe the help is right. The line is partially executed when not all of the instructions on that line are executed. It is just the case that in your example the compiler chose to generate LineNumberTable this way. I wanted to demonstrate this on byte code disassembe, but my quick try failed. If you could post a small example, where you see this, together with the indication of what compiler you are using, then I would be able to say whether I am wrong in my assumptions.

Eugene.

0
Comment actions Permalink

The line is partially executed when not all of the instructions on that line
are executed.


I'm probably being very stupid, but are you saying that a line containing a call to writer.close(), or a single parenthesis, generates multiple low-level instructions, only some of which may be executed? Am I supposed to know what byte code (or native code?) may be generated in order to understand the code coverage indications?

It is just the case that in your example the compiler
chose to generate LineNumberTable this way.


That example was just the nearest piece of code to hand - the rest is very similar - 'partial execution' of lines with single parentheses, single calls, etc. If the results of code coverage depend on the way the compiler choses to generate LineNumberTable, it doesn't sound as if it's going to be very consistent or useful...

>If you could post a small example, where you see this, together with the

indication of what compiler you are using


I already posted an example of code that shows the kind of thing that puzzles me -and I was using Sun Java 5.0.

Message was edited by:
Dave Lorde

Message was edited by:
Dave Lorde

0
Comment actions Permalink

Belatedly marked unanswered as the answer seemed to raise more questions than it answered...

Message was edited by:
Dave Lorde

0

Please sign in to leave a comment.