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 | |
|---|---|---|
| 1Test 1: input 15, expected 'Pass' | ATests: input 80 -> 'Pass', input 20 -> 'Fail' | |
| 2Test 2: input 50, expected 'Pass', actual 'Fail' -> FAIL | BThe real output did not match the expected result, so you record a fail and then look for the bug | |
| 3Test every branch: choose one input that runs the if part and one that runs the else part | CNo expected result was written. Without it you cannot compare the real output and decide pass or fail. | |
| 4Boundary values: test the numbers right on the edge of a condition, such as just below, on and just above 50 | DOnly one branch is tested. You also need an input such as 10 for the else branch, plus boundary values like 49 and 50. | |
| 5Test table: input 80, expected output: (blank) | ETests: input 49, input 50, input 51 | |
| 6Only test: input 90 for if score >= 50 / else | FA test case: one chosen input paired with the output you expect, written in your test table before you run the program |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
test case — A chosen input paired with the output you expect. Run the program with it, compare the real output to the expected result in your test table, then record pass or fail.expected = "Pass"
result = grade(50)
print(result == expected)# Pass mark is 50, so test the boundary
result = grade(50)
print(result)if result == expected:
print("PASS")tests = [49, 50, 51]
for t in tests:
print(t, grade(t))result = grade(49)
if result != "Fail":
print("FAIL: test did not match")