Search code examples
testingwhite-box-testing

Multiple Condition Coverage Testing


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,


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.