162k views
4 votes
in white box testing, is it possible to create a method that contains a division by zero fault and at least two branches, such that (1) every possible test suite that achieves 100% branch coverage does reveal the fault, and (2) it is possible to create a test suite that achieves 100% statement coverage and does not reveal the fault?

User Rwg
by
7.5k points

1 Answer

1 vote

Final answer:

In white box testing, it is possible to create a method that contains a division by zero fault and achieve 100% branch coverage revealing the fault. However, it is also possible to achieve 100% statement coverage without revealing the fault.

Step-by-step explanation:

In white box testing, it is possible to create a method that contains a division by zero fault and at least two branches. To achieve 100% branch coverage and reveal the fault, all possible test cases that cover each branch and execute the division by zero fault need to be included in the test suite.

However, it is also possible to create a test suite that achieves 100% statement coverage without revealing the fault. This can be done by having the test cases avoid executing the branch where the division by zero fault occurs, even though they cover all statements in the code.

User Christian Held
by
7.6k points