---
url: /reference/upload-formats-and-samples/teamscale-compact-coverage.md
---

# Teamscale Compact Coverage

\[\[toc]]

## Report Format

Teamscale Compact Coverage is a Teamscale-specific coverage format that allows to upload coverage information in a compressed format to reduce the amount of data processed by the Teamscale instance.

### Preliminaries

* Line range string
  * String containing line ranges and individual lines separated by commas.
  * Compact representation of a set of lines of code.
  * Example: `"10-12,13,22-27,40"`

### TeamscaleCompactCoverageReport

The top level JSON object is the `TeamscaleCompactCoverageReport`. It contains the following attributes:

### CompactCoverageFileInfo

Aggregated coverage information about a source code file. It contains the following attributes.

## CoverageProbe

CoverageProbes are generic coverage "indicators" associated with a source line (the start line of the corresponding statement).
Probes can be of types DecisionProbe and StatementProbe as defined by the attribute type.
For example in case of branch coverage, a probe may indicate for an if-condition how many times it was evaluated to true and how often to false.

### DecisionProbe

Probe for a decision, e.g. an if-statement, which carries two execution counters.

#### DecisionProbeConfiguration

A configuration for the individual conditions in a decision.
We are looking at an example for the condition if (val == 1 && val2 == 2 && val3 == 3).

#### McDcCondition

An MC/DC condition necessary to meet the MC/DC criterion consisting of a textual description and the information whether it was fulfilled.

### StatementProbe

Simple probe that carries a single execution count.

## Sample File

The following JSON sample file combines the data described above.

```json
{
  "version": 1,
  "coverage": [
    {
      "filePath": "Simple.java",
      "fullyCoveredLines": "1-3",
      "partiallyCoveredLines": "4,6"
    },
    {
      "filePath": "StringUtils.java",
      "fullyCoveredLines": "1,3",
      "partiallyCoveredLines": "4-6",
      "uncoveredLines": "2",
      "coverageProbes": [
        {
          "type": "decision",
          "line": 2,
          "trueExecutionCount": 0,
          "falseExecutionCount": 1,
          "configurations": [
            {
              "description": "T || F || _",
              "decisionValue": false,
              "executionCount": 1
            }
          ],
          "conditions": [
            {
              "description": "T || T",
              "fulfilled": true
            }
          ]
        },
        {
          "type": "statement",
          "line": 3,
          "executionCount": 1
        }
      ]
    }
  ]
}
```
