Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Open Source Tools available.

First search.

Interesting.

First Experiment a success.

An excellent method for generating coverage reports is part of the maven 2 build. If you instrument the code for coverage and then run surefire reports the Junit tests are run and then an actual report of coverage can be automatically generated.

First results were negative. Adding the right information to the top level pom generated the correct tests, but  sadly alsogenerated the reports with zero length. Conclusion: Either I failed to add the correct information or this is an unwanted bug. However, going down to the modules the report generation succeeded.

Example.

Add at the end of a pom.xml before the last closing tag. 

<reporting>
<plugins>
 <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <configuration>     
        <formats>
                <format>xml</format>
                <format>html</format>
        </formats>
        </configuration>
 </plugin>
 </plugins>
</reporting>
  <pluginRepositories>
        <pluginRepository>
                <id>Codehaus Snapshots</id>
                <url>http://snapshots.repository.codehaus.org/</url>
        </pluginRepository>
</pluginRepositories>



At the same directory level as the pom.xml run mvn cobertura:cobertura.

Under the directory target/site is the beginning of the report.

Brut force but functional 

Some relatively straight foward Perl code can perform the following workflow:

  • inject into the pom.xml (s) the relevant fragments.
  • Run maven on each Pom
  • Harvest all relevant information
  • Make a generic high level report/website.

 Screenshot


  • No labels