(a) Draw a control flow graph for the Printprime () method.
This diagram I use Word completion, very tired, and then think of me and omnigraffle but too late, the figure is as follows:
(b) Consider test case t1= (n=3) and t2= (n=5). Even though these test cases travel the same main path in the Printprimes () method, they do not necessarily find the same error. Design a simple error that makes T2 easier to spot than T1.
A: If the N value is large, t2= (n=5) will be prone to data out-of-bounds errors.
(c) for Printprimes (), find a test case that allows the test path of the response to access the connection while the statement starts at the edge of the for statement without passing through the while loop body.
A: Find the test case n = 1, do not meet the conditions of Numprimes < N, so that the response test path Access connection While statement starts to the side of the for statement, instead of passing through the while loop body.
(d) The legend for Printprimes () lists the test requirements for each node overlay, Edge overlay, and master path overlay.
Answer: 1) node Overlay: TR = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
2-side overlay: TR = {(2,3), (2,12), (3,4), (4,5), (5,6), (6,7), (6,8), (7,5), (8,9), (5,9), (9,10), (9,11), [10,11], (11,2), (12, 13), (13,14), (14,15), (15,13), (13,16)}
3) Main Path overlay:
TR = {(1,2,3,4,5,6,7),
(1,2,3,4,5,6,8,9,10,11),
(1,2,3,4,5,6,8,9,11),
(1,2,3,4,5,9,10,11),
(1,2,3,4,5,9,11),
(1,2,12,13,14,15),
(1,2,12,16),
(2,3,4,5,6,8,9,10,11,2),
(2,3,4,5,6,8,9,11,2),
(2,3,4,5,9,10,11,2),
(2,3,4,5,9,11,2),
(3,4,5,6,8,9,10,11,2,12,13,14,15),
(3,4,5,6,8,9,11,2,12,13,14,15),
(3,4,5,6,8,9,10,11,2,12,13,16),
(3,4,5,6,8,9,11,2,12,13,16),
(3,4,5,9,10,11,2,12,13,14,15),
(3,4,5,9,11,2,12,13,14,15),
(3,4,5,9,10,11,2,12,13,16),
(3,4,5,9,11,2,12,13,16),
(5,6,7,5),
(6,7,5,9,10,11,2,12,13,14,15),
(6,7,5,9,11,2,12,13,14,15),
(6,7,5,9,10,11,2,12,13,16),
(6,7,5,9,11,2,12,13,16),
(13,14,15,13),
(14,15,13,16),
}
Software Test Job essay three: Printprime () after-school questions (a) (b) (c) (d)