If you'd like to set up the Test Gap analysis for your own tests, you'll need to gather test coverage. This page will walk you through a series of questions to determine which tooling you'll need to collect test coverage for your Java tests.


For which kind of tests would you like to collect coverage?

Unit Tests

We're assuming that you run your unit tests on some CI or build server and use a unit test framework (e.g. JUnit). Depending on the build tool you use to execute your tests, you'll need to install a plugin that collects code coverage with JaCoCo and produces an XML coverage report file.


Which build tool do you use to run your unit tests?

Gradle Unit Tests

  1. Install the Gradle JaCoCo plugin and use it to generate an XML coverage report for your tests.
  2. Verify the XML file with the Teamscale JaCoCo verifier. If the verifier does not accept the XML as valid, please fix any errors it reports.
  3. Upload this XML file to Teamscale. See our article on how to do this.

Maven Unit Tests

  1. Install the Maven JaCoCo plugin and use it to generate an XML coverage report for your tests.
  2. Verify the XML file with the Teamscale JaCoCo verifier. If the verifier does not accept the XML as valid, please fix any errors it reports.
  3. Upload this XML file to Teamscale. See our article on how to do this.

Other Unit Tests

For most popular build tools, there exist plugins that automatically gather code coverage for your tests with JaCoCo. Google for "<YOUR BUILDTOOL> JaCoCo" to find them.

  1. If your build tool has a JaCoCo plugin, please install it and use it to generate an XML coverage report for your tests.
  2. If no such plugin exists, you'll have to figure out another way to use JaCoCo to generate test coverage.
  3. Verify the XML file with the Teamscale JaCoCo verifier. If the verifier does not accept the XML as valid, please fix any errors it reports.
  4. Upload this XML file to Teamscale. See our article on how to do this.

Automated UI Tests and Manual Tests

  1. Download the Teamscale JaCoCo agent.
  2. Follow the instructions in the PDF file that was included in the Zip file that you downloaded in order to set it up for your application. The agent will produce one or more XML coverage files.
  3. Verify the XML file with the Teamscale JaCoCo verifier. If the verifier does not accept the XML as valid, please fix any errors it reports.
  4. Upload this XML file to Teamscale. See our article on how to do this.