Java code coverage tools are of two types: first, tools that add statements to the Java source code and require its recompilation. Second, tools that instrument the bytecode, either before or during execution. The goal is to find out which parts of the code are tested by registering the lines of code executed when running a test.
Developer(s) | Marc Hoffmann, Brock Janiczak, Evgeny Mandrikov, Mirko Friedenhagen |
---|---|
Stable release | 0.8.12 / March 31, 2024 |
Type | Code coverage |
License | EPL |
Website | www |
JaCoCo is an open-source toolkit for measuring and reporting Java code coverage. JaCoCo is distributed under the terms of the Eclipse Public License. It was developed as a replacement for EMMA, [1] under the umbrella of the EclEmma plug-in for Eclipse.
JaCoCo offers instructions, line and branch coverage.
In contrast to Atlassian Clover and OpenClover, which require instrumenting the source code, JaCoCo can instrument Java bytecode using two different approaches:
And can be configured to store the collected data in a file, or send it via TCP. Files from multiple runs or code parts can be merged easily. [3] Unlike Cobertura and EMMA it fully supports Java 7, Java 8, [4] Java 9, Java 10, Java 11, Java 12, Java 13, Java 14, Java 15, Java 16, Java 17, Java 18, Java 19 and Java 20.
Developer(s) | Leonid Arbouzov, Alexander Petrov, Vladimir Generalov, Serguei Chukhontsev, Oleg Uliankin, Gregory Steuck, Pavel Ozhdikhin, Konstantin Bobrovsky, Robert Field, Alexander Kuzmin, Leonid Mesnik, Sergey Borodin, Andrey Titov, Dmitry Fazunenko, Alexey Fedorchenko, Leonid Kuskov |
---|---|
Stable release | 3.0 / September 1, 2014 |
Type | Code coverage |
License | GPL v2 (with the Classpath Exception) |
Website | wiki |
JCov is the tool which has been developed and used with Sun JDK (and later Oracle JDK) from the very beginning of Java: from the version 1.1. JCov is capable of measuring and reporting Java code coverage. JCov is distributed under the terms of the GNU General Public License (version 2, with the Classpath Exception). JCov has become open-source as a part of OpenJDK code tools project in 2014.
JCov is capable of reporting the following types of code coverage:
JCov implements two different ways to save the collected data:
JCov works by instrumenting Java bytecode using two different approaches:
JCov has a few more distinctive features which include, but are not limited to:
Developer(s) | Marek Parfianowicz, Grzegorz Lewandowski |
---|---|
Stable release | 4.5.2 / January 31, 2024 |
Type | Code coverage |
License | Apache License 2.0 |
Website | openclover |
OpenClover is a free and open-source successor of Atlassian Clover, created as a fork from the Clover code base published by Atlassian in 2017. It contains all features of the original Clover (the server edition). The OpenClover project is led by developers who maintained Clover in years 2012–2017. [15]
OpenClover uses source code instrumentation technique and handles Java, Groovy and AspectJ languages. Some of its features include: fine control over scope of coverage measurement, test optimisation and sophisticated reports.
OpenClover integrates with Ant, Maven, Gradle, Grails, Eclipse, IntelliJ IDEA, Bamboo, Jenkins, Hudson, Griffon, SonarQube and AspectJ.
Developer(s) | JetBrains |
---|---|
Type | Code coverage |
License | Apache 2.0 |
Website | github |
IntelliJ IDEA Code Coverage Agent is a code coverage tool integrated in IntelliJ IDEA IDE and TeamCity CI server. It supports branch coverage and per-test coverage tracking.
Developer(s) | Verifysoft Technology |
---|---|
Stable release | 8.0. / June 30, 2016 |
Type | Code coverage |
License | Proprietary |
Website | verifysoft |
Testwell CTC++ is a code coverage tool for C, C++, Java and C#. The development of this tool started in 1989 at Testwell in Finland. Since 2013 support and development has been continued by Verifysoft Technology, a company from Offenburg, Germany. Testwell CTC++ analyses for all code coverage levels up to Modified condition/decision coverage and Multicondition Coverage. [16] The tool works with all compilers. [17]
Developer(s) | Atlassian |
---|---|
Stable release | 4.1.2 / October 11, 2016 |
Type | Code coverage |
License | Apache 2.0 |
Website | atlassian |
Clover is a Java code coverage analysis utility bought and further developed by Atlassian. In April 2017 Atlassian announced end-of-life of Clover and at the same time open-sourced it under Apache 2.0 license.
Clover uses a source code instrumentation technique (as opposed to Cobertura and JaCoCo, which use byte code instrumentation), which has its advantages (such as an ability to collect code metrics) and disadvantages (re-compilation of sources is necessary). [18] Some of its features include historical reporting, huge control over the coverage gathering process, command line toolset and API for legacy integration and more.
Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. This is called Test Optimization [19] and can lead to huge drops in the amount of time spent waiting for automated tests to complete.
Clover comes with a number of integrations both developed by Atlassian (Ant, Maven, Grails, Eclipse, IDEA, Bamboo) and by open source community (Gradle, Griffon, Jenkins, Hudson, Sonar).
In April 2017, Atlassian announced that they would no longer release new versions of Clover after version 4.1.2, and its code was made available as open-source software hosted on Bitbucket. [20] [21]
Developer(s) | Steven Christou |
---|---|
Stable release | 2.1.1 / February 26, 2015 |
Repository | github |
Type | Code coverage |
License | GPL 2.0 |
Website | cobertura |
Cobertura is an open-source tool for measuring code coverage. It does so by instrumenting the byte code. It was the predecessor to JaCoCo.
Developer(s) | Vlad Roubtsov |
---|---|
Stable release | 2.1 / May 13, 2005 |
Repository | sourceforge |
Type | Code coverage |
License | Common Public License 1.0 |
Website | emma |
EMMA is an open-source toolkit for measuring and reporting Java code coverage. EMMA is distributed under the terms of Common Public License v1.0.
EMMA is not currently under active development; the last stable release took place in mid-2005. As replacement, JaCoCo was developed. [22] EMMA works by wrapping each line of code and each condition with a flag, which is set when that line is executed. [23]
.class
files or entire .jars
(in place, if desired). Efficient coverage subset filtering is possible, too.Developer(s) | Michael Couck |
---|---|
Stable release | 1.0 / December 8, 2013 |
Type | Code coverage |
License | Apache Software License version 2.0 |
Website | wiki |
Serenity is an open-source tool creating better-automated software acceptance tests in less time. It and measures and reports Java code coverage. It also generates easy-to-understand reports that describe what the application does and how it works, including which tests were run and what requirements were met. It works with Selenium WebDriver, Appium, and BDD tools.
Major code metrics such as cyclometric complexity, stability, abstractness, and distance from main are measured. The report data is persisted to an object database and made available via Jenkins/Hudson. The interface visually replicates the Eclipse IDE interface.
Serenity dynamically enhances the byte code, making a post-compile step unnecessary. Ant and Maven projects are supported. Configuration is done in xml, an Ant example would be:
<!-- Serenity system properties. --><syspropertykey="included.packages"value="your.package.name.here"/><syspropertykey="included.adapters"value="coverage,complexity,dependency"/><!-- Serenity JVM command line. --><jvmargline="-javaagent:serenity/serenity.jar"/>
And a Maven configuration example would be:
<properties><included.packages>-Dincluded.packages=your.package.name.here</included.packages><included.adapters>-Dincluded.adapters=coverage,complexity,dependency</included.adapters></properties><argLine>-javaagent:serenity/serenity.jar-Xms512m-Xmx1024m${included.packages}${included.adapters}</argLine>
For a full example of a configuration please refer to the Jenkins wiki at https://wiki.jenkins-ci.org/display/JENKINS/Serenity+Plugin.
Jenkins slaves as well as Maven multi module projects are supported.
JUnit is a test automation framework for the Java programming language. JUnit is often used for unit testing, and is one of the xUnit frameworks.
IntelliJ IDEA is an integrated development environment (IDE) written in Java for developing computer software written in Java, Kotlin, Groovy, and other JVM-based languages. It is developed by JetBrains and is available as an Apache 2 Licensed community edition, and in a proprietary commercial edition. Both can be used for commercial development.
Maven is a build automation tool used primarily for Java projects. Maven can also be used to build and manage projects written in C#, Ruby, Scala, and other languages. The Maven project is hosted by The Apache Software Foundation, where it was formerly part of the Jakarta Project.
TestNG is a testing framework for the Java programming language created by Cedric_Beust and inspired by JUnit and NUnit. The design goal of TestNG is to cover a wider range of test categories: unit, functional, end-to-end, integration, etc., with more powerful and easy-to-use functionalities.
PMD is an open source static source code analyzer that reports on issues found within application code. PMD includes built-in rule sets and supports the ability to write custom rules. PMD does not report compilation errors, as it only can process well-formed source files. Rather, PMD is designed to detect inefficient code or bad programming habits, which can reduce the performance and maintainability of the program if they accumulate. It can analyze files written in Java, JavaScript, Apex and Visualforce, PLSQL, Apache Velocity, XML, and XSL.
The following tables list notable software packages that are nominal IDEs; standalone tools such as source-code editors and GUI builders are not included. These IDEs are listed in alphabetic order of the supported language.
TypeScript is a free and open-source high-level programming language developed by Microsoft that adds static typing with optional type annotations to JavaScript. It is designed for the development of large applications and transpiles to JavaScript. Because TypeScript is a superset of JavaScript, all JavaScript programs are syntactically valid TypeScript, but they can fail to type-check for safety reasons.
FindBugs is an open-source static code analyser created by Bill Pugh and David Hovemeyer which detects possible bugs in Java programs. Potential errors are classified in four ranks: (i) scariest, (ii) scary, (iii) troubling and (iv) of concern. This is a hint to the developer about their possible impact or severity. FindBugs operates on Java bytecode, rather than source code. The software is distributed as a stand-alone GUI application. There are also plug-ins available for Eclipse, NetBeans, IntelliJ IDEA, Gradle, Hudson, Maven, Bamboo and Jenkins.
Hudson is a discontinued continuous integration (CI) tool written in Java, which runs in a servlet container such as Apache Tomcat or the GlassFish application server. It supports SCM tools including CVS, Subversion, Git, Perforce, Clearcase and RTC, and can execute Apache Ant and Apache Maven based projects, as well as arbitrary shell scripts and Windows batch commands. The primary developer of Hudson was Kohsuke Kawaguchi, who worked for Sun Microsystems at the time. Released under the MIT License, Hudson is free software.
Jira Studio was an integrated, hosted software development suite developed by Atlassian Software Systems. Jira Studio included Subversion for revision control, Jira for issue tracking and bug tracking, Confluence for content management, Jira Agile for agile planning and management, Bamboo for continuous integration, Crucible for code review and FishEye for source code repository browsing.
This is a compendium of software tools that support continuous integration.
sbt is an open-source build tool created explicitly for Scala and Java projects. It aims to streamline the procedure of constructing, compiling, testing, and packaging applications, libraries, and frameworks. sbt is highly adaptable, permitting developers to customize the build process according to their project's specific needs.
SonarQube is an open-source platform developed by SonarSource for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs and code smells on 29 programming languages. SonarQube offers reports on duplicated code, coding standards, unit tests, code coverage, code complexity, comments, bugs, and security recommendations.
PVS-Studio is a proprietary static code analyzer on guard of code quality, security, and code safety supporting C, C++, C++11, C++/CLI, C++/CX, C# and Java.
Google Plugin for Eclipse (GPE) was a set of development tools that enabled Java developers to design, build, optimize, and deploy cloud computing applications. developers in creating complex user interfaces, generating Ajax code using the GWT Web Toolkit, and deploying applications to Google App Engine. GPE installed into the Eclipse integrated development environment (IDE) using the extensible plugin system. GPE was available under the Eclipse Public License 1.0.
Jenkins is an open source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration, and continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat. It supports version control tools, including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, ClearCase, and RTC, and can execute Apache Ant, Apache Maven, and sbt based projects as well as arbitrary shell scripts and Windows batch commands.
Gradle is a build automation tool for multi-language software development. It controls the development process in the tasks of compilation and packaging to testing, deployment, and publishing. Supported languages include Java, C/C++, and JavaScript. Gradle builds on the concepts of Apache Ant and Apache Maven, and introduces a Groovy- and Kotlin-based domain-specific language contrasted with the XML-based project configuration used by Maven. Gradle uses a directed acyclic graph to determine the order in which tasks can be run, through providing dependency management. It runs on the Java Virtual Machine.
UltraESB is a lightweight enterprise service bus (ESB) capable of supporting many transports and message formats natively. It allows messages to be mediated via Java or JSR 223 scripting languages through an API, and is the first ESB to claim support for Zero-Copy proxying of messages with Non-Blocking IO capabilities. In 2013, it was selected as the ESB and API Management platform by a recent Fortune #1 company based on its performance and stability.
Kotlin is a cross-platform, statically typed, general-purpose high-level programming language with type inference. Kotlin is designed to interoperate fully with Java, and the JVM version of Kotlin's standard library depends on the Java Class Library, but type inference allows its syntax to be more concise. Kotlin mainly targets the JVM, but also compiles to JavaScript or native code via LLVM. Language development costs are borne by JetBrains, while the Kotlin Foundation protects the Kotlin trademark.