If you’re looking for shortcuts for getting around MC/DC, you might think that it’s possible to replace:
if ((a || b) && c) {
...
with:
x = (a || b) && c;
if (x) {
...
Then just test two vectors: x = TRUE
and x = FALSE
.
This does not meet the requirements of MC/DC as discussed in DO-178B. In fact it subverts the intent of MC/DC, and is explicitly covered in CAST-10[1] in its treatment of "relaxed" versus "literal" definition of a decision for MC/DC. The net result is that, if you do rewrite your code as above, then you will have to worry about MC/DC for the expression assigned to x as well as the presence of true and false values of x in the if-expression. [1] “What is a ‘decision’ in the application of Modified Condition/Decision Coverage (MC/DC) and Decision Coverage”