Features

A non-exhaustive list of OpenClover features.

Measuring code coverage

OpenClover supports the following languages:

  • Java
  • Groovy
  • AspectJ

It can track two kinds of code coverage:

for three kinds of metrics:

Measuring code metrics

OpenClover comes with

It uses code metrics and coverage data to provide:

Tool integrations

Build systems and frameworks:
  • Ant
  • Maven
  • Gradle
  • Grails
  • Griffon
Continuous integration servers:
  • Jenkins
  • Hudson
  • Bamboo
Developer IDEs:
  • Eclipse (also IBM RAD)
  • IntelliJ IDEA
Other tools:
  • Sonar
  • JIRA

Test framework integrations

OpenClover has a dedicated support for:
  • JUnit 3 & 4
  • TestNG
  • Spock
It can support other test frameworks by defining custom test patterns based on:
  • source files
  • classes (names, modifiers and annotations)
  • methods (names, arguments, return types, throws, modifiers, annotations, javadoc tags)
It also handles test iterations (parameterized tests) for:
  • JUnit 4
  • Spock

Reporting

OpenClover can generate reports in the following formats:
  • HTML (current and historical)
  • XML
  • PDF
  • JSON
  • TEXT

HTML 'current report' features

This report displays data relating to the most recent coverage data collected:
  • global code coverage
  • per-test code coverage
    • classes covered by test
    • tests covering given class / method / source line
    • unique per-test coverage
The coverage data is shown together with the source code, so you can easily browse: Report shows coverage data and code metrics on all levels:
  • for project, package (also with sub-package aggregation), file, class and method
  • you can customize columns shown
  • you can introduce custom metrics
The report dashboard shows also charts:

HTML 'historical report' features

This report displays data relating to sets of coverage data collected over time:
  • Coverage overview - coverage from the last history point
  • Added classes - classes which have been added
  • Changed classes - classes for which metrics changed above specified thresholds
  • Charts - set of customizable charts

Test optimization

OpenClover can determine which tests needs to be re-run for modified application classes. It can drastically reduce time required to run tests. This feature is available for:
  • Ant
  • Maven
  • Grails
  • Eclipse
  • IDEA
It can also change order of test execution:
  • failing first - to fail a build as fast as possible, for faster feedback
  • random - to reveal bugs hidden by specific test order

Data management and filtering

OpenClover is very flexible in managing coverage data. It can:
  • merge coverage data from different projects
  • collect historical data for given project
  • provide cross-report linking
It also outruns other coverage tools its flexibility to define scope of code coverage measurement. Filters can be based on:
  • path/file patterns
  • classes
  • methods (allows matching by entire method signature)
  • code blocks by type (e.g. static initializers)
  • single statements (by regular expression)
  • method's cyclomatic code complexity
  • arbitrary sections (by putting inline code comments)

Further reading