raw Coverage.xml file format
raw Coverage.xml file format
Hello.
I'm evaluating NCover and examining the raw coverage report file in order to create custom internal reporting tools. And I have few questions regarding 'seqpnt' element attributes.
What meaning the following attributes has: o - ? ex -? fl -?
How the following records should be interpreted:
a) <seqpnt vc="2678" o="34" l="16707566" el="16707566" c="0" ec="0" ex="true" fl="66049" doc="1185" /> b) <seqpnt vc="0" o="29" l="0" el="0" c="0" ec="0" ex="false" fl="131072" doc="0" /> c) <seqpnt vc="0" o="1B" l="320" el="320" c="13" ec="14" ex="true" fl="65793" doc="1185" />
They were found in the same one 'method' element.
Please advise.
Thank you.
RE: raw Coverage.xml file format
o = offset, internal use only ex = excluded true/false fl = flags, internal use only
a) is a compiler generated sequence point that is not part of the visible source code b) is a branch point c) is a sequence point, probably on a single brace, signalling the end of a block
NB: a), b), and c) were posted out of order; were there any more sequence points in the method?
Stephen Ward
RE: raw Coverage.xml file format
Thank you for the reply.
ex - excluded true/false - excluded from what? Should I care about this attribute when calculating coverage report for a method?
Yes, there are more sequence points in the method:
<seqpnt vc="2678" o="C" l="319" el="319" c="13" ec="36" ex="false" fl="65536" doc="1185" /> <seqpnt vc="2678" o="17" l="16707566" el="16707566" c="0" ec="0" ex="true" fl="66049" doc="1185" /> <seqpnt vc="2678" o="19" l="0" el="0" c="0" ec="0" ex="false" fl="131072" doc="0" /> <seqpnt vc="0" o="1B" l="320" el="320" c="13" ec="14" ex="true" fl="65793" doc="1185" /> <seqpnt vc="0" o="1C" l="321" el="321" c="17" ec="77" ex="false" fl="65536" doc="1185" /> <seqpnt vc="0" o="28" l="322" el="322" c="13" ec="14" ex="true" fl="65793" doc="1185" /> <seqpnt vc="0" o="29" l="0" el="0" c="0" ec="0" ex="false" fl="131072" doc="0" /> <seqpnt vc="2678" o="29" l="323" el="323" c="13" ec="36" ex="false" fl="65536" doc="1185" /> <seqpnt vc="2678" o="34" l="16707566" el="16707566" c="0" ec="0" ex="true" fl="66049" doc="1185" /> <seqpnt vc="2678" o="36" l="0" el="0" c="0" ec="0" ex="false" fl="131072" doc="0" /> <seqpnt vc="2678" o="38" l="324" el="324" c="13" ec="14" ex="true" fl="65793" doc="1185" />
Here is my understanding about what is this (I will refer to the sequence points above using 'o' attribute): o=C - ok, normal line of code visited 2678 times o=17 - some code called which is not under NCover monitoring (maybe system call?) o=19 - uhh, hmm. At first look it looks like branch point visited 2678 times, but it is not. Am I right? o=1B,1C,28 - ok, some not executed code o=29 - branch point with the code where it occured, right? o=34 - uncovered code call o=36 - again, unknown sequence point for me o=38 - some executed code
So, as I understand, I should ignore branch points, not visible code and unknown for me sequence points when calculating coverage value. Is this correct? And what about methods of classes in loaded assemblies which were never executed. Will they appear in a report? I understand that never loaded assemblies will be missed from the coverage report at all and I should care about them myself.
Thank you.
RE: raw Coverage.xml file format
excluded = excluded from coverage calculation or not.
To calculate sequence point coverage, you should ignore branch points and any sequence points which are excluded.
Methods that are loaded but never executed count toward the coverage total; they should appear in the coverage file as sequencepoints w/ a zero visitcount.
Never loaded assemblies are not included in coverage.
I've reinterpreted the sequencepoints you posted
o=C you are correct o=17 compiler generated code, under NCover monitoring, probably a sequence of NOP statements to provide a breakpoint for debugging. was this a debug build? o=19 this is a branch point o=1B, 1C, 28 not executed code, probably b/c the branch point @o=19 jumped to o=29 o=29 a sequence point, not a branch point o=34 more compiler generated code, see o=17 for probable explanation o=36 this is a branch point o=38
this is a sequence point, note the excluded flag
OOC, why are you trying to calculate all this? What are you trying to accomplish?
RE: raw Coverage.xml file format
Thank you very much. It's all clear for me now.
I'm trying to write a tool to convert NCover raw report to PHP coverage tool one. And use our another tool to create final coverage report for complex product (PHP frontend + .Net backend).
RE: raw Coverage.xml file format
neat.