Which of the following best describes statement coverage in white-box testing?
Think about coverage related to code lines executed.
Statement coverage means testing so that every line of code runs at least once. This helps find parts of code that never run.
What is the main goal of branch coverage in white-box testing?
Focus on decision points and paths in code.
Branch coverage ensures that every possible branch (true/false) of each decision is tested.
Consider a loop that runs from 1 to 10. Which white-box testing technique focuses on testing the loop with zero, one, and multiple iterations?
Think about testing loops specifically.
Loop testing targets loops by checking cases like zero iterations, one iteration, and many iterations to find loop-related errors.
Which statement correctly distinguishes condition coverage from decision coverage in white-box testing?
Think about testing parts of a decision versus the whole decision.
Condition coverage tests each condition inside a decision separately, while decision coverage tests the final true/false result of the entire decision.
You have a complex function with many nested decisions and loops. Which white-box testing technique is best suited to ensure all possible execution paths are tested?
Consider the technique that covers all sequences of decisions.
Path coverage tests every possible route through the code, including all combinations of decisions and loops, making it ideal for complex code.