Testing for multiple conditions

When using the White Box testing method called multiple condition coverage, do we accept all conditional statements or only those that have multiple conditions? Now, perhaps, there are clues in the title, 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 { } } 

Am I generating a truth table only for "Conditional A", or am I also executing conditional B?

Thanks,

+4
source share
2 answers

Maybe I missed something, but as you wrote the code in your question, conditions A and B are completely independent of each other. Therefore, you will not cover all of the code unless you test both conditional expressions.

+1
source

I found the following about covering several conditions. This seems to indicate that Multiple Condition Coverage, as the name implies, applies only to conventions with multiple statements.

So, for the following conditional:

 if ((a>0)&&(b<=4)&&(c>0)) 

We create the following

 Test Case a > 0 b <= 4 c > 0 MCC1 FFF MCC2 FFT MCC3 FTF MCC4 FTT MCC5 TFF MCC6 TFT MCC7 TTF MCC8 TTT 
+1
source

Source: https://habr.com/ru/post/1310052/


All Articles