Cobertura ( Jave testing coverage tool).

Cobertura是一款免费的Java工具,用于计算被测试覆盖的代码百分比。它能在不同层面展示软件的测试覆盖率,包括每个类、每个包乃至整个项目的覆盖率,并显示各部分的复杂度。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

What is Cobertura?

Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage.

Features

  • Can be executed from ant or from the command line.
  • Instruments Java bytecode after it has been compiled.
  • Can generate reports in HTML or XML.
  • Shows the percentage of lines and branches covered for each class, each package, and for the overall project.
  • Shows the McCabe cyclomatic code complexity of each class, and the average cyclomatic code complexity for each package, and for the overall product.
  • Can sort HTML results by class name, percent of lines covered, percent of branches covered, etc. And can sort in ascending or decending order.

Press

 

Why use a coverage tool?

No matter how good such methodologies are, and how diligently they're followed in an organisation, it isn't possible to ensure that software testing is as comprehensive as it could be. That's where tools can help.

Cobertura is a free, simple and easy-to-use tool that will complement your existing Java development practices. It helps you discover exactly where your software is being tested and, more importantly, where it isn't. Cobertura will help you to view your software from a number of levels, from the entire system right down to an individual line of code.

Why use Cobertura?

Sure, there are other coverage tools around, so what makes Cobertura different?

Coverage analysers work by adding instrumentation. For Java, coverage analysers fall into three categories: those that insert instrumentation into the source code, those that add instrumentation to the Java byte-code, and those that run the code in a modified JVM. Cobertura adds instrumentation directly to the bytecode. We feel this is the best approach, since it does not require a modified VM, but still retains a big speed advantage over having to compile all your source code twice.

Secondly, Cobertura is easy to integrate with Apache Ant. It comes with it's own Ant task definitions for you to use. You can choose to instrument any code you wish, from a single class to an entire system.

Finally, Cobertura is completely free and not time-locked, so you can begin to use it today, without having to worry about what to do at the end of an evaluation period. What's more, we believe Cobertura is so easy to use, you'll be up and running in no time. So why not spend the next 15 minutes getting up and running with Cobertura. In that time, you'll certainly find out which parts of your code are completely tested, and where your code could do with a bit more testing.

 

 

http://cobertura.sourceforge.net/

 

http://www.codehaus.org/

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值