Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Cobertura is a reporting tool for code-coverage of unit tests.

The license for Cobertura is complicated: Ant tasks are covered under Apache 1.1 (easy enough), but instrumented bytecode involves the GPL.

Details are here: http://cobertura.sourceforge.net/license.html

In a classic CYA, the conclusion of the license states "it depends on your interpretation of the license".

How have you interpreted the license?

Do you use Cobertura in developing commercial software for the enterprise? i.e. simply using it to report on your JUnit tests. I'm not asking about bundling Cobertura with your product.

share|improve this question

closed as not constructive by MichaelT, gnat, Martijn Pieters, thorsten müller, Mark Booth Mar 7 '13 at 18:08

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
I should mention that I have used it in the past on various teams. It is an excellent tool. Someone asked me about the licensing and I was surprised to read the link. –  Michael Easter Nov 17 '10 at 17:16
1  
Do you have a specific question about the license? In general, the GPL is about distribution; if you don't plan on distributing Cobertura with your application, I don't think you have to worry too much about the license. –  Robert Harvey Nov 18 '10 at 3:59

3 Answers 3

I took the interpretation that it is a tool and did not worry about it further. Of course this only lasted a little while as Cobertura takes issue with how spring proxies and we had to switch to EMMA. If you are worried, you too can use EMMA. It is not actively developed and isn't as full featured but it is quicker and has a very open license.

share|improve this answer
    
and if you're using eclipse and like EMMA EclEMMA is awesome! –  Brad Cupit Dec 8 '10 at 1:50
    
I am actually using EclEMMA. The only thing I miss from when I was using Cobertura was the branch percentage. I remember when I had great line coverage but terrible branch coverage (exceptions mainly) and I just don't see that anymore. –  Bob Roberts Dec 8 '10 at 12:55

I don't think there's an issue here. Cobertura instruments your code, then generates a report using that instrumentation. After that, the instrumented byte code can be thrown away.

I've used Cobertura as part of a maven build, and the bytecode that goes in the war file is not the instrumented bytecode (which you wouldn't want anyway since it specifically adds extra statements to your code, slightly slowing it down).

You're only bound by the GPL when you distribute the code. So as long as you don't ship the instrumented bytecode out somewhere (not sure why you'd ever want to do this anyway) you've got nothing to worry about.

Basically, Cobertura is being used as a tool and doesn't affect your code. Just as you wouldn't have to open source your project if you wrote it using Linux as your OS.

share|improve this answer

I've never used it personally, but I heard it being used at many clients while I was at a previous consulting firm. I would say it's definitely used, however those were all internally for their own systems, not used to build software to sell.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.