is branch coverage a subset of condition coverage. I think it is b/c when we cover each branch (or edge), it doesn't mean we cover each truth value, is that correct?
But if not all branches are covered, it means it is a subset, b/c subset means the items in it are contained in a larger universe, unless i have subset mixed up. So in other words, condition coverage is a superset of branch coverage, just as statement coverage is subset of branch coverage. Or do i got it mixed up...
The set of of test cases required to achieve complete branch coverage is a superset of the set of of test cases required to achieve complete condition coverage.
I understand weakness of statement coverage, but can someone tell me weakness of branch coverage, this is how i see it:
eg:
if ( x > 0 && x < 100 )
//do this
else
//do that
so if I have test suite T with the two test cases as such: T:{(x=1), (x=101)} then I would have executed the TRUE and FALSE edges, so the 'weakness' is that it fails to consider each combination as in:
a) x>0 is F && x<100 is F //NOT tested
b) x>0 is F && x<100 is T //NOT tested
c) x>0 is T && x<100 is T //tested above
d) x>0 is T && x<100 is F //tested above
assuming that we want the minimal test cases to satisfy branch coverage. So why do we even need to test a and b? I mean if we cover all branches, isn't that a good enough software metric?
Though, what is 'good enough' in testing software is a difficult question to answer. In practice, we test as much as possible, as early as possible, as often as possible.