Cobertura Licensing Case Study

FOSSBazaar is no longer being updated. The information on this site is preserved for your convenience but may be out of date. Please visit Linux Foundation's Open Compliance Program for current information and activities.

Wazi's picture
This case study, which originally appeared on Wazi, illustrates how OpenLogic addresses licensing issues that arise while certifying open source packages for inclusion in the Certified Library available on OpenLogic Exchange (OLEX). Enterprises considering using Cobertura should note its dual license model and thoroughly evaluate potential liabilities before deploying it.

Project Description

Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It is based on jcoverage. Some of its main features include:
  • Executable from Ant or from the command line.
  • Instruments byte code after compilation.
  • Generates reports in both HTML and XML.
  • Shows the percentage of lines and branches covered for each class, each package, and for the project.
  • Shows the McCage cyclomatic code complexity for each class, the average code complexity for each packet, and the average cyclomatic code complexity for the project.
  • Provides sorting of HTML results by class name, percentage of lines covered, and more.
Use Cobertura to identify which parts of a Java code base are lacking test coverage.

License Issue

This project is dual licensed under the Apache 1.1 and GPL V2 licenses. The Ant tasks are licensed under the Apache 1.1 license. Because the Ant tasks are loaded directly into the runtime of Ant, and the GPL is incompatible with all versions of the Apache license, Ant tasks can’t be licensed under the GPL. The rest of Cobertura is under the GPL because Cobertura is a fork of the GPL version of JCoverage. The terms of the GPL require that forks -- or any other project based on a GPL licensed project -- also use the GPL license. Additionally, because use of Cobertura modifies JCoverage code, there are other license implications.


We added a special note to the Cobertura package details page in OLEX explaining the situation and pointing users directly to all of the relevant information available on the community website.