When using the White Box method of testing called Multiple Condition Coverage, do we take all conditional statements or just the ones with multiple conditions? Now maybe the clues in the name but I'm not sure.
So if I have the following method
void someMethod()
{
if(a && b && (c || (d && e)) ) //Conditional A
{
}
if(z && q) // Conditional B
{
}
}
Do I generate the truth table for just "Conditional A", or do I also do Conditional B?
Thanks,
A white-box test design technique in which test cases are designed to execute combinations of single condition outcomes (within one statement). Synonyms: branch condition combination testing, condition combination testing.
All the possible combinations of outcomes of conditions in a decision (therefore the complete decision table) are tested at least once. Since there are only two possible outcomes of a condition (TRUE or FALSE), 2 is the basis for the number of test situations that can be created.
MCC Metric Definition The coverage of a program is the number of executed statement blocks and condition combinations divided by their total number in the program.
To achieve 100% condition coverage, your test cases need to demonstrate a true and false outcome for both conditions. For example, a test case where x is equal to 4 demonstrates a true case for both conditions, and a case where x is equal to 7 demonstrates a false case for both conditions.
I might be missing something here but, the way you wrote the code in your question, conditions A and B are completely independent of each other. You therefore won't cover all of the code unless you test both conditionals.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With