Is it possible to create a method that contains division by zero fault such that (1) it is possible to create a test suite that achieves 100 % branch coverage without fault, and (2) every test suite that achieves 100 % statement coverage reveals the fault?
I think it's not possible because branch coverage is stronger than statement coverage so if they are both 100 % coverage, what is not caught in branch coverage should not be caught in statement coverage.
If I am wrong, please provide an example method that meets both requirements above.
Note: Example code should not use logical operators such as || or && .
I want simple predicates such as "if (x>3) or while(x>=0) etc.
Aucun commentaire:
Enregistrer un commentaire