Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1tests = [15, 18, 17] # age check: >= 18 | Aif mark >= 50: print('Pass') else: print('Fail') # tests: 80, 90 | |
| 2tests = [25, 18, 17, -5, 'abc'] | BStronger test set: normal (25), boundary (18 and 17) and invalid (-5, 'abc') data are all included | |
| 3An untested branch leaves the program partly validated: every if and else path needs at least one test that runs it | CWeak test set: no invalid data (like -5 or 'abc') and only one value on the boundary side, so it is not enough yet | |
| 4Passing tests do not prove there are no bugs: a loop that is never run with an empty list could still hide an error | DFive normal values were all passed, but there is no boundary or invalid data. Passing tests never prove the program has no bugs. | |
| 5# Tests: 5, 10, 20, 30, 40 # All passed, so the program is fully tested! | Etotal = 0 for n in nums: total = total + n # tested with [1, 2, 3] only | |
| 6while count < 3: count = count + 1 # Test plan: skip the loop, run once | FThe test plan never runs the loop several times, so the loop is untested and the code is only partly validated. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
test coverage — Test cases are enough when they use normal, boundary and invalid data and run every branch and loop. Missing any leaves the program only partly validated, and passing tests never prove no bugs.normal = [40, 75]
boundary = [0, 100]
invalid = [-5, 101]if mark >= 50: print("Pass")
else: print("Fail")assert grade(50) == "Pass"
assert grade(49) == "Fail"passed = 9
total = 10
print(passed < total)for score in scores:
count = count + 1
print(count)