Chinese book p49 7th question a-d
A. Draw a control flow chart
B. Design simple errors so that test case t2 = (n=5) is easier to discover than T1 = (n=3).
Set if (Isdivisible (Primes[i], curprime) {
IsPrime = false;
Break
} in Primes[i], change to primes[0]
When n=3, the divisor of the judgment is only 2, no effect.
n = 5 o'clock, the number of divisor is increased by more than 2, resulting in an error.
C. Find a test case without a while loop
N=1;
D. Enumerate node overlays, Edge overrides, Master path overrides
Node overlay: tr={1,2,3,4,5,6,7,8,9,10}
Test path: [1,2,3,4,3,5,7,6,2,8,9,8,10]
Side overlays: tr= {(2,3), (2,8), (3,4), (3,5), (4,3), (4,5), (5,6), (5,7), (6,2),
(7,6), (8,9), (8,10), (9,8)}
Test path:[1,2,3,4,3,5,7,6,2,8,9,8,10],[1,2,3,5,6,2,8,10]
The main path overrides the test path:
[1,2,8,10]
[1,2,3,4,3,4,5,7,6,2,8,10]
[1,2,3,4,5,7,6,2,8,10]
[1,2,3,5,7,2,8,10]
[1,2,3,4,5,6,2,8,10]
[1,2,3,4,5,6,2,3,5,6,2,8,10]
[1,2,3,4,3,5,6,2,3,4,5,6,2,8,10]
[1,2,3,4,5,7,6,2,3,4,5,7,6,2,8,9,8,9,8,10]
Software Test Job 3