---
url: /reference/upload-formats-and-samples/testwise-coverage/version_1.md
---

# Testwise Coverage (Version 1)

::: warning
Version 1 has some limitations that are resolved in version 2.

These include:

* Updating coverage information for a subset of tests is complicated
* No support information about the coverable lines as determined by the test coverage tool used to record it (needed mostly for C/C++ code)
* No way of including information about execution units which contain sets of tests that should or must be executed together
  :::

\[\[toc]]

## Report Format

Testwise Coverage is a combined JSON-based report format that holds various test
related data (see sample below). Its basis is a list of all tests that are available for execution as one unit (e.g.
UI Tests). A test is identified by a unique string (`uniformPath`). The
full list allows Teamscale to determine added and deleted tests. Each
of the test entries can additionally contain execution information
(`duration`, `result`, `message`), coverage information (`paths`) and additional
test metadata (`content`). The following overview provides more details on each of the
available fields:

## Sample File for Testwise Coverage

The following JSON sample file combines the necessary data described above.

```json
{
  "tests": [
    {
      "uniformPath": "com/example/project/JUnit4Test/notExecutedTest()"
    },
    {
      "uniformPath": "com/example/project/JUnit4Test/systemTest()",
      "duration": 0.025,
      "result": "PASSED",
      "content": "43d743a8ef4389bc5",
      "paths": [
        {
          "path": "com/example/project",
          "files": [
            {
              "fileName": "Calculator.java",
              "coveredLines": "20-24,26,27,29"
            },
            {
              "fileName": "JUnit4Test.java",
              "coveredLines": "26-28"
            }
          ]
        }
      ]
    },
    {
      "uniformPath": "com/example/project/JUnit5Test/failedTest()",
      "duration": 0.045,
      "result": "ERROR",
      "message": "Some error"
    },
    {
      "uniformPath": "com/example/project/JUnit5Test/skippedTest()",
      "result": "SKIPPED"
    }
  ]
}
```
