bufanliu / apparat

Automatically exported from code.google.com/p/apparat
0 stars 0 forks source link

Coverage suggestion and question #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Would it be possible to provide an example on how to generate a coverage report 
using one of the Apparat Ant tasks? FlexMojos requirement that we use Maven is 
an issue as we already do everything (including running our unit tests) using 
Ant.

Does Apparat provide code coverage at the statement and branch level or, as 
FlexCover, only at the method level? I was not able to find any example that 
would show me one way or the other (the one at the FlexMojos site is too 
trivial) and there is some confusion in this area based on comments from the 
FlexUnit team.

Original issue reported on code.google.com by naa...@gmail.com on 5 Aug 2011 at 5:45

GoogleCodeExporter commented 9 years ago
Apparat performs only bytecode instrumentation (at method level) and is not 
generating any coverage reports so that would be up to you.

Original comment by joaebert on 5 Aug 2011 at 5:50

GoogleCodeExporter commented 9 years ago
Thanks for your reply. Just to be sure though, the Apparat/FlexMojos approach 
has the same limitation that affects FlexCover?
In other words, methods get either a 100% or 0% coverage value, regardless of 
the actual execution of internal statements and branches?
I believe this information is determined at the Apparat level and that 
FlexMojos only converts it to the Cobertura format, right? So if Apparat can't 
descriminate between lines and branches being executed there is no hope that 
FlexMojos will...

Original comment by naa...@gmail.com on 9 Aug 2011 at 1:49

GoogleCodeExporter commented 9 years ago
Hey,

your assumption is not true. A method can vary from 0% to 100% in coverage 
since Apparat informs a client which lines are getting instrumented and the 
client can then detect which exact lines have been covered.

Apparat does not collect this information. Again you can use Apparat to modify 
the bytecode which then can report back to a client which instructions got 
executed. While Apparat modifies the bytecode you can also observe this process 
and generate a map of which instructions to expect.

Original comment by joaebert on 9 Aug 2011 at 7:14

GoogleCodeExporter commented 9 years ago
Hi joaebert,

OK so FlexMojos should have the information to generate line-level coverage 
reports. This is great news. I will try to follow up with them (so far was not 
able to post to their forum).

I am really looking forward to get a working code coverage system for our 
project. I really appreciate you making Apparat available.

Thanks,
  Nascif

Original comment by naa...@gmail.com on 10 Aug 2011 at 1:50