Hi @uthmanna,
The MCDC information is exported in the JSON output as “mcdc_records” in each file with summary marked as “mcdc” for the file and the executable. You can see this on line 259 of CoverageExporterJson.cpp, in the renderFile() function:
File["mcdc_records"] = renderFileMCDC(FileCoverage, FileReport);
You can also see these markers documented at the top of CoverageExporterJson.cpp
// -- Files: array => List of objects describing coverage for files
// -- File: dict => Coverage for a single file
// -- Branches: array => List of Branches in the file
// -- Branch: dict => Describes a branch of the file with counters
// -- MCDC Records: array => List of MCDC records in the file
// -- MCDC Values: array => List of T/F covered condition values
// -- Segments: array => List of Segments contained in the file
// -- Segment: dict => Describes a segment of the file with a counter
...
// -- Summary: dict => Object summarizing the coverage for this file
...
// -- MCDCCoverage: dict => Object summarizing MC/DC coverage
Each “mcdc_record” represents a decision region with line information and an array of T/F corresponding to each condition and indicating whether or not the condition has been covered. To help you parse the information, here is an example. Suppose you have a decision region that looks like this in TEXT:
20| 5| if ((a && b) || c)
------------------
|---> MC/DC Decision Region (20:7) to (20:20)
|
| Number of Conditions: 3
| Condition C1 --> (20:8)
| Condition C2 --> (20:13)
| Condition C3 --> (20:19)
|
| Executed MC/DC Test Vectors:
|
| C1, C2, C3 Result
| 1 { F, -, F = F }
| 2 { F, -, T = T }
| 3 { T, F, T = T }
| 4 { T, T, - = T }
|
| C1-Pair: covered: (1,4)
| C2-Pair: not covered
| C3-Pair: covered: (1,2)
| MC/DC Coverage for Decision: 66.67%
|
------------------
The corresponding json “mcdc_record” may look like this:
[
20, <-- Line Start
7, <-- Col Start
20, <-- Line End
20, <-- Col End
0, <-- File ID
5, <-- MCDCDecisionRegion Type (always 5)
[
true, <-- C1-Pair Covered?
false, <-- C2-Pair Covered?
true <-- C3-Pair Covered?
]
],
Thanks!
-Alan