For a program of k variables, boundary value analysis yields ______ test cases.
2016
For a program of k variables, boundary value analysis yields ______ test cases.
- A.
4k – 1
- B.
4k
- C.
4k + 1
- D.
2k – 1
Attempted by 401 students.
Show answer & explanation
Correct answer: C
Key idea: boundary value analysis selects boundary values for each input and also includes a nominal test case.
Explanation:
For each variable, choose four boundary values: minimum, just above minimum, just below maximum, and maximum.
Apply these four boundary values to each variable one at a time while keeping all other variables at their nominal (typical) values. That produces 4 tests per variable, so 4k tests for k variables.
Add one additional test where all variables are set to their nominal values to confirm typical behavior.
Therefore, the total number of test cases is 4k + 1.
Common incorrect counts:
4k – 1: Incorrect because it removes a test without justification; the nominal test must be included.
4k: Incomplete because it omits the single nominal test where all variables are typical.
Expressions like 2^k – 1: Not applicable; they count different combinations and are not the standard boundary value analysis count.