- Is it applicable in Boolean expressions?
Yes. It's applicable to Boolean expressions.
![Truth Table](https://cdn.statically.io/img/i.sstatic.net/o8X32.png)
Getting all possible combinations of your Boolean expression, we can have the truth table above.
- How could MC/DC prove to cover almost 90% code coverage?
MC/DC can't assure over 90% code coverage. However, it can assure the decision, branch, and condition coverages, which are integral parts of a piece of code.
But, how could it prove to cover?
The answer will lie in the properties of the MC/DC criterion:
- Each condition in a Boolean expression should take every possible
outcome.
- Each decision takes every possible outcome.
- Each condition is shown to independently affect the outcome of the decision.
So each condition's Boolean outcome has been considered (TRUE/FALSE) and the combination of these condition's Boolean outcome (decision) will result in every possible value (TRUE/FALSE).
- How could MC/DC reduce cases?
When you identify MC/DC pairs, you will come up with this table:
![MC/DC Pairs](https://cdn.statically.io/img/i.sstatic.net/goL6k.png)
Some of these pairs are similar. Why? Because when you evaluate the Boolean expression, you can short-circuit some of the conditions. This means that your expression can have a decision even if at least one of the conditions are not being evaluated.
![Final MC/DC Test Cases](https://cdn.statically.io/img/i.sstatic.net/0kPbb.png)
This will be the final result. Notice that some of the rows have (-) empty values. This means that it wasn't evaluated, but the decision can be inferred.
Although relevant, but unrelated, I wrote an article here: How MC/DC Can Speedup Unit Test Creation
Hope this helps despite being late. :D