Week 4 Flashcards
Please choose the correct order in terms of the power of the different levels of control flow coverage.
Statement coverage < decision/condition coverage < decision coverage < multiple condition coverage
Statement coverage < decision coverage < decision/condition coverage < multiple condition coverage
Statement coverage < decision coverage < multiple condition coverage < decision/condition coverage
Decision coverage < Statement coverage < decision/condition coverage < multiple condition coverage
Statement coverage < decision coverage < decision/condition coverage < multiple condition coverage
Question 5
Given the code below, how many test cases are needed to achieve 100% multiple condition coverage?
If a < 12 and b = 5 or c > 15
X = 50;
Else
X = 25;
1 point
8
3
2
6
8
Given the code below, which set of test cases will achieve 100% decision condition coverage?
If a < 12 and b = 5 or c > 15
X = 50;
Else
X = 25;
1 point
3
6
8
2
2
Prompt: Given the code below, which set of test cases will achieve 100% decision coverage?
If a < 12 and b = 5 or c > 15
X = 50;
Else
X = 25;
If X = 25
Z = 12;
Else
Z = 15;
1 point
Test Case 1: A = 6, B=5, C=17, X=50
Test Case 1: A = 11, B=5, C=20, X=50
Test Case 1: A=15, B=3, C=8, X=25
Test Case 1: A = 6, B=5, C=17, X=50
Test Case 2: A=15, B=3, C=8, X=25
Test Case 1: A = 6, B=5, C=17, X=50
Test Case 2: A=15, B=3, C=8, X=25
Given the code below, which set of test cases will achieve 100% statement coverage?
If a < 12 and b = 5 or c > 15
X = 50;
Else
X = 25;
If X = 25
Z = 12;
Else
Z = 15;
1 point
Test Case 1: A = 6, B=5, C=17, X=50
Test Case 2: A=15, B=3, C=8, X=25
Test Case 1: A = 6, B=5, C=17, X=50
Test Case 1: A=15, B=3, C=8, X=25
Test Case 1: A = 11, B=5, C=20, X=50
Test Case 1: A = 6, B=5, C=17, X=50
Test Case 2: A=15, B=3, C=8, X=25
True or False? Thoroughly executing all requirements guarantees full code coverage.
1 point
False
True
False
What is the cyclomatic complexity of the given control flow diagram?
1
4
3
7
4
TF_T, F_TT, TT_T, F_FT, TF_F are possible basis paths for the given control flow diagram.
True
False
True
True or False? The number of basis paths is the minimum number of paths needed to build test cases and linear combinations for every other possible path.
True
False
True
What is not a variable set used in definition use coverage?
S-Use(i)
P-Use(i)
Def(i)
C-Use(i)
S-Use(i)
True or False? A definition use path is not always along a definition clear path.
True
False
False
Given the code below, what is the correct set of DU Paths?
1 / 1 point
Def1(a) = USEI(a) || USE3(a)
Def1(b) = USEII(b)
Def1(x) = USE2(x)
Def2(c) = USE4(c) || USE5(c)
Def1(a) = USEI(a) || USE3(a)
Def1(b) = USEII(b)
Def1(x) = USE2(x)
Def2(c) = USE4(c)
Def3(c) = USE4(c)
Def1(a) = USE3(a)
Def1(b) = USEII(b)
Def1(x) = USE2(x)
Def2(c) = USE4(c) || USE5(c)
Def3(c) = USE4(c) || USE5(c)
Def1(a) = USEI(a) || USE3(a)
Def1(b) = USEII(b)
Def1(x) = USE2(x)
Def2(c) = USE4(c) || USE5(c)
Def3(c) = USE4(c) || USE5(c)
Def1(a) = USEI(a) || USE3(a)
Def1(b) = USEII(b)
Def1(x) = USE2(x)
Def2(c) = USE4(c) || USE5(c)
Def3(c) = USE4(c) || USE5(c)
Based on the code and the DU paths determined in Q3, what coverage do the test cases below provide?
A = 3; B=2
A=6, B=5
4/8
5/8
7/8
6/8
Def1(a) = USEI(a) || USE3(a)
Def1(b) = USEII(b)
Def1(x) = USE2(x)
Def2(c) = USE4(c) || USE5(c)
Def3(c) = USE4(c) || USE5(c)
6/8
True or False? Static analysis models the flow of the data in a program by looking at where variables are defined and used.
1 / 1 point
True
False
True
What is not an example of a data flow anomaly?
1 / 1 point
Variable defined then redefined without being referenced
Defining a variable but never using it
Referencing an undefined variable
Variable is defined then referenced
Variable is defined then referenced