July 2014
Intermediate to advanced
314 pages
6h 25m
English
Maven has a Cobertura plugin to measure code coverage; this section will explain how to configure the Cobertura Maven plugin in your project.
Cobertura uses asm to instrument the bytecode. The asm framework is a Java bytecode manipulation and analysis framework. Visit http://asm.ow2.org/ for asm details. Cobertura modifies the .class file, imports net.sourceforge.cobertura.coveragedata.*, implements the HasBeenInstrumented interface, and adds code to capture coverage, such as ProjectData.getGlobalProjectData().getOrCreateClassData("com.packt.coverage.Metrics").touch(21);.
After instrumenting the bytecode, Cobertura creates a .ser file and updates the file during test execution. This .ser file contains the ...
Read now
Unlock full access