I am trying to get Cobertura working with my Ant build, and specifically just want it to give me a coverage report on my unit tests. I'm using the following directory structure:
src/main/java --> main source root
src/test/java --> test source root
bin/main --> where main source compiles to
bin/test --> where test source compiles to
gen/cobertura --> cobertura root
gen/cobertura/instrumented --> where "instrumented" class will be copied to
My understanding of Cobertura (and please correct me if I'm wrong!!) is that it adds bytecode to compiled classes (aka "instrumentation") and then runs reports based on that injected/woven bytecode.
So my question is, if Cobertura changes the bytecode of the classes its instrumenting, should I run JUnit on my test sources before <cobertura:instrument>
, or after, and why?