Mission
JaCoCo should provide the standard technology for code coverage analysis in Java VM based environments. The focus is providing a lightweight, flexible and well documented library for integration with various build and development tools.
There are several open source coverage technologies for Java available. While implementing the Eclipse plug-in EclEmma the observation was that none of them are really designed for integration. Most of them are specifically fit to a particular tool (Ant tasks, command line, IDE plug-in) and do not offer a documented API that allows embedding in different contexts. Two of the best and widely used available open source tools are EMMA and Cobertura. Both tools are not actively maintained by the original authors any more and do not support the current Java versions. Due to the lack of regression tests maintenance and feature additions is difficult.
Therefore we started the JaCoCo project to provide a new standard technology for code coverage analysis in Java VM based environments. The focus is providing a lightweight, flexible and well documented library for integration with various build and development tools. Ant tasks, a Maven plug-in and the EclEmma Eclipse plug-in are provided as reference usage scenarios. Also many other tool vendors and Open Source projects have integrated JaCoCo into their tools.
Product Definition
Features
- Coverage analysis of instructions (C0), branches (C1), lines, methods, types and cyclomatic complexity.
- Based on Java byte code and therefore works also without source files.
- Simple integration through Java agent based on-the-fly instrumentation. Other integration scenarios like custom class loaders are possible through the API.
- Framework agnostic: Smoothly integrates with Java VM based applications like plain Java programs, OSGi frameworks, web containers or EJB servers.
- Compatible with all released Java class file versions.
- Support for different JVM languages.
- Several report formats (HTML, XML, CSV).
- Remote protocol and JMX control to request execution data dumps from the coverage agent at any point in time.
- Ant tasks to collect and manage execution data and create structured coverage reports.
- Maven plug-in to collect coverage information and create reports in Maven builds.
Non-Functional Characteristics
- Simple usage and integration with existing build scripts and tools.
- Good performance with minimal runtime overhead especially for large scale projects.
- Lightweight implementation with minimal dependencies on external libraries and system resources.
- Comprehensive documentation.
- Fully documented APIs (JavaDoc) and examples for integration with other tools.
- Regression tests with full functional test coverage based on JUnit test cases.