Question

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,

Was it helpful?

Solution

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.

OTHER TIPS

I found the following on Multiple condition coverage. This would seem to indicate that Multiple Condition Coverage, as the name suggests, only applies to conditionals 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        F        F         F
MCC2        F        F         T
MCC3        F        T         F
MCC4        F        T         T
MCC5        T        F         F
MCC6        T        F         T
MCC7        T        T         F
MCC8        T        T         T
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top