문제

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,

도움이 되었습니까?

해결책

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.

다른 팁

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top