A suite achieves 100% branch coverage of a login check written as (userValid AND tokenValid), yet a flaw appears when only tokenValid is false. Which coverage measure would have exposed the gap?
Show the answer
Correct answerD. Condition coverage
AWhy not this: Function coverage only confirms each function was called, which says nothing about condition outcomes.
BWhy not this: Branch coverage is already at 100%; the whole decision took both outcomes without isolating tokenValid.
CWhy not this: Statement coverage is weaker than branch coverage, so it would not reveal this gap either.
DWhy this is right: Condition coverage requires every atomic condition to be tested as true and false, so tokenValid failing alone is exercised.
Condition coverage requires each individual condition in a compound expression to be evaluated as both true and false, so it forces a test where only tokenValid fails. Branch coverage was already met because the overall decision took both outcomes without isolating tokenValid.