Consider the method mcq():
int mcq(boolean a, boolean b, boolean c, boolean d)
{
int ans = 1;
if (a) { ans = 2; }
else if (b) { ans = 3; }
else if (c) { if (d) { ans = 4; } }
return ans;
}
Let M1 = number of tests to exhaustively test mcq(), M2 = minimum number of tests to achieve full statement coverage, and M3 = minimum number of tests to achieve full branch coverage. Then the value of (M1, M2, M3) is:
int mcq(boolean a, boolean b, boolean c, boolean d)
{
int ans = 1;
if (a) { ans = 2; }
else if (b) { ans = 3; }
else if (c) { if (d) { ans = 4; } }
return ans;
}Let M1 = number of tests to exhaustively test mcq(), M2 = minimum number of tests to achieve full statement coverage, and M3 = minimum number of tests to achieve full branch coverage. Then the value of (M1, M2, M3) is:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: A. (A) (16, 3, 5)
More Software Engineering questions
- What is the normal order of activities in which traditional software testing is organised? 1. Integration Testing 2. System Testing 3. Unit…
- Which of the following testing techniques ensures that the software product runs correctly after the changes during maintenance?
- Which of the following statement(s) is/are TRUE with regard to software testing? I. Regression testing technique ensures that the software…
- For a program of k variables, boundary value analysis yields ______ test cases.
- The cyclomatic complexity of a flow graph V(G), in terms of predicate nodes, is: [where P is the number of predicate nodes in the flow grap…
- In software testing, how are error, fault and failure related to each other?