ISTQB White-Box Test Design 5 — Questions and Answers
Question 1: Which of the following is NOT a white-box (structural) testing technique?
- Statement coverage
- Branch coverage
- Equivalence partitioning (Correct answer)
- Path coverage
Correct answer: Equivalence partitioning
Equivalence partitioning is a black-box technique based on input domain analysis, not on code structure examination.
Question 2: A software component has the Boolean expression `if (x > 0 && y != 0)`. To achieve MC/DC, which set of test cases is SUFFICIENT?
- TC1: x=1,y=1 (T,T); TC2: x=-1,y=1 (F,T); TC3: x=1,y=0 (T,F) (Correct answer)
- TC1: x=1,y=1 (T,T); TC2: x=-1,y=0 (F,F)
- TC1: x=1,y=1 (T,T) only
- TC1: x=1,y=1 (T,T); TC2: x=-1,y=1 (F,T); TC3: x=1,y=0 (T,F); TC4: x=-1,y=0 (F,F)
Correct answer: TC1: x=1,y=1 (T,T); TC2: x=-1,y=1 (F,T); TC3: x=1,y=0 (T,F)
MC/DC requires each condition to independently affect the outcome: TC1 shows T,T→T; TC2 changes only x to show F,T→F; TC3 changes only y to show T,F→F — three test cases suffice.
Question 3: When a white-box tester calculates cyclomatic complexity using the formula V(G) = P + 1, what does 'P' represent?
- The number of paths in the graph
- The number of predicate (decision) nodes in the control flow graph (Correct answer)
- The number of program points
- The number of parameters in the function
Correct answer: The number of predicate (decision) nodes in the control flow graph
In the formula V(G) = P + 1, P is the number of predicate (binary decision) nodes in the control flow graph.
Question 4: Which coverage criterion is MOST effective at detecting faults caused by incorrect variable initialization before first use?
- Statement coverage
- Decision coverage
- Data flow coverage (all-defs) (Correct answer)
- Path coverage
Correct answer: Data flow coverage (all-defs)
Data flow coverage specifically tracks definition-use pairs and can identify ur anomalies where variables are used before a valid definition, directly targeting initialization faults.
Question 5: A tester achieves 100% branch coverage on a function. Which of the following statements is TRUE?
- 100% statement coverage is also achieved (Correct answer)
- 100% path coverage is also achieved
- 100% condition coverage is also achieved
- 100% MC/DC coverage is also achieved
Correct answer: 100% statement coverage is also achieved
Branch coverage subsumes statement coverage — if every branch (true and false outcome of every decision) is exercised, every reachable statement must have been executed.
Question 6: In white-box testing, what is the purpose of using a 'call graph'?
- To document phone calls made during testing
- To visualize the invocation relationships between functions/modules for integration testing (Correct answer)
- To track which testers called which developers about defects
- To map API calls to database queries
Correct answer: To visualize the invocation relationships between functions/modules for integration testing
A call graph is a directed graph showing which functions call which other functions, enabling testers to design integration test cases based on structural dependencies.
Question 7: Which statement BEST explains why 100% path coverage is generally impractical for real software?
- Path coverage tools are not commercially available
- The number of paths grows exponentially with the number of loops and branches (Correct answer)
- ISTQB does not recognize path coverage as a valid technique
- Path coverage requires black-box knowledge not available to white-box testers
Correct answer: The number of paths grows exponentially with the number of loops and branches
The number of unique paths through a program with loops and nested branches grows exponentially (potentially infinitely with unbounded loops), making exhaustive path coverage infeasible.
Which of the following is NOT a white-box (structural) testing technique?