Content deleted Content added
Replace dead link for Rajan et al paper |
Jnestorius (talk | contribs) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 1:
{{Short description|Code coverage criterion}}
'''Modified condition/decision coverage''' ('''MC/DC''') is a [[code coverage]] criterion used in [[software testing]].
Line 14 ⟶ 15:
Additionally, NASA requires 100% MC/DC coverage for any safety critical software component in Section 3.7.4 of NPR 7150.2D.<ref>{{cite web |title = NASA Software Engineering Requirements |url=https://nodis3.gsfc.nasa.gov/displayDir.cfm?t=NPR&c=7150&s=2D |publisher=NASA}}</ref>
European Space Agency requires MC/DC coverage for Criticality Category A per ECSS-E-ST-40C Rev. 1 <ref>{{cite web |title = European Cooperation for Space Standardization - Space Engineering Software |url=https://ecss.nl/standard/ecss-e-st-40c-rev-1-software-30-april-2025|publisher=ECSS}}</ref>
==Definitions==
Line 21 ⟶ 24:
;Decision coverage: Every point of entry and exit in the program has been invoked at least once, and every decision in the program has taken all possible outcomes at least once.
;Condition/decision coverage: Every point of entry and exit in the program has been invoked at least once, every condition in a decision in the program has taken all possible outcomes at least once, and every decision in the program has taken all possible outcomes at least once.
;Modified condition/decision coverage: Every point of entry and exit in the program has been invoked at least once, every condition in a decision in the program has taken all possible outcomes at least once, and each condition has been shown to affect that decision outcome independently. A condition is shown to affect a decision's outcome independently by varying just that condition while holding fixed all other possible conditions. The condition/decision criterion does not guarantee the coverage of all conditions in the module because in many [[test case (software)|test case]]s, some conditions of a decision are masked by the other conditions. Using the modified condition/decision criterion, each condition must be shown to be able to act on the decision outcome by itself, everything else being held fixed. The MC/DC criterion is thus much stronger than the condition/decision coverage.
==Criticism==
Line 62 ⟶ 65:
}
}
</syntaxhighlight>if the definition of a decision is treated as if it is
However, what is wrong in the previous statement is the definition of decision. A decision includes 'any' boolean expression, even for assignments to variables. In this case, the three assignments should be treated as a decision for MC/DC purposes and therefore the changed code needs exactly the same tests and number of tests to achieve MC/DC than the first one. Some code coverage tools do not use this strict interpretation of a decision and may produce false positives (reporting 100% code coverage when indeed this is not the case). {{Citation needed|date=November 2022}}
==RC/DC==
In 2002 [[Sergiy Vilkomir]] proposed '''reinforced condition/decision coverage''' ('''RC/DC''') as a stronger version of the MC/DC coverage criterion that is suitable for [[safety-critical system]]s.<ref>{{cite
[[Jonathan Bowen]] and his co-author analyzed several variants of MC/DC and RC/DC and concluded that at least some MC/DC variants have superior coverage over RC/DC.<ref>{{cite journal |last1=Kapoor |first1=Kalpesh |last2=Bowen |first2=Jonathan P |authorlink2=Jonathan Bowen |title=A formal analysis of MCDC and RCDC test criteria |journal=Software Testing, Verification and Reliability |date=2005 |volume=15 |issue=1 |pages=21–40 |doi=10.1002/stvr.306 |publisher=[[Wiley Online Library]]|s2cid=35276126 }}</ref>
|