Recently, I started working on software testing, and I had some questions.
Pairwise testing is the combination of all the values that this parameter can have, and is it also applicable to Boolean Expression?
For example,
boolean expression is (A || B) && C (It is assumed that each parameter has only 0 and 1.)
Here, Is it applicable to Boolean Exp ??
The second question is about MC/DC.
I had learned how to make test case through MC/DC
But, I wondered how MC/DC could prove to cover almost 90% code coverage ?
In (A || B) && C, there are 4 combination test case in my guess.
But, All combination is 8. how could MC/DC reduce cases ?
Yes. It's applicable to Boolean expressions.
Getting all possible combinations of your Boolean expression, we can have the truth table above.
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:
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).
When you identify MC/DC pairs, you will come up with this table:
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.
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.