โ† All ISTQB Flashcard Decks

White-Box Test Design Flashcards

6 cards from real ISTQB practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 White-Box Test Design flashcards as text
  1. A developer has written the following pseudocode. What is the MINIMUM number of test cases required to achieve 100% statement coverage? READ A READ B IF A > B THEN PRINT A ELSE PRINT B ENDIF

    Answer: 2

    To achieve 100% statement coverage, every executable statement in the code must be exercised at least once. In this pseudocode, one test case where A > B (e.g., A=10, B=5) will execute the `PRINT A` statement. A second test case where A is not greater than B (e.g., A=5, B=10) is required to execute the `PRINT B` statement. Therefore, a minimum of two test cases are needed to cover all executable statements.

  2. Which of the following BEST defines Decision Coverage?

    Answer: It ensures that every possible outcome (TRUE and FALSE) of each decision point in the code has been exercised at least once.

    Decision coverage, also known as branch coverage, is a white-box testing technique that aims to exercise every possible outcome of a decision point (e.g., an IF statement or a loop condition) at least once. This means testing both the TRUE and FALSE branches for each decision.

  3. Which of the following statements about the relationship between statement coverage and decision coverage is correct?

    Answer: Achieving 100% decision coverage guarantees 100% statement coverage.

    If you achieve 100% decision coverage, you have tested both the TRUE and FALSE outcomes of every decision. By doing so, you will have inherently executed all the statements within those decision branches. However, the reverse is not true; achieving 100% statement coverage does not guarantee 100% decision coverage, as a test might execute all statements without testing all possible decision outcomes.

  4. What is the primary goal of Modified Condition/Decision Coverage (MC/DC), a technique often required for safety-critical systems?

    Answer: To show that each condition within a decision can independently affect the outcome of that decision.

    The goal of MC/DC is to demonstrate that each individual condition within a complex decision can, on its own, affect the decision's outcome. This is achieved by creating test pairs where only one condition's value is changed, and this change causes the decision's outcome to flip, proving the independence of that condition.

  5. A tester is using white-box test design techniques. In which of the following areas are these techniques MOST effective for finding defects?

    Answer: Uncovering logic errors and incorrect assumptions in the code's control flow.

    White-box testing is based on the internal structure and implementation of the code. Its primary strength lies in systematically exercising the code's logic, paths, branches, and conditions to find errors in the control flow, such as unreachable code, logic errors in loops and conditional statements, and incorrect data flow. Black-box techniques are better suited for finding issues related to requirements, usability, and business needs.

  6. Consider a simple function with a single `IF-THEN-ELSE` statement followed by another independent `IF-THEN-ELSE` statement. How many distinct paths exist through this function that need to be tested for 100% path coverage?

    Answer: 4

    Path coverage aims to test every possible unique route through a piece of code. The first `IF-THEN-ELSE` has two paths (TRUE and FALSE). The second independent `IF-THEN-ELSE` also has two paths. To find the total number of distinct paths, you multiply the number of paths from each sequential decision point. Therefore, there are 2 * 2 = 4 distinct paths to cover.