Concept and mechanism
Executing a line does not mean checking all its logical outcomes. If an optional condition adds a fee without an else branch, a test entering that branch may execute every statement without observing the false decision. To assess coverage, define the object, criterion, and denominator: executable statements, decision outcomes, or combinations. In an abstract example without short-circuiting, decision A AND B is true for TT and false for FF. Those two vectors cover decision outcomes but do not demonstrate each condition’s independent effect. Adding TF and FT allows comparison of TT with FT for A and TT with TF for B. These pairs explain MC/DC intent.
Guided application
For three independent Boolean conditions, the complete space contains eight combinations; that does not mean all are feasible in an actual program. Repeated or related conditions may prevent certain independent changes. Short-circuiting also changes which expressions are actually evaluated, so distinguish an abstract truth table from a tool report. Gcov provides condition coverage using specific instrumentation and describes a masking variant of MC/DC; do not automatically equate any branch report with that metric. Coverage helps locate gaps but depends on existing code and does not independently find behavior omitted from the program. Combine it with requirements-based tests and review unreachable-code justifications before excluding code from measurement.
TT, TF, and FT demonstrate both conditions’ independent effects in the abstract A AND B model.
Common pitfalls
Line treated as decision; branches treated as MC/DC; percentage treated as correctness.
Related topics: Technical risk and operational evidence · Static and dynamic analysis · Performance and workload profile
Explain the criterion before interpreting the percentage.
Reference: GCC gcov invocation and coverage metrics · CTAL-TTA v4.0 (2021)