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: mark = 75, expected = "Pass" | AThe test cases have no expected output, so you cannot tell whether the real result is right or wrong. | |
| 2Tests: age = 8, age = 14, age = 30 | BInput: 40 -> Expected: "Fail" | |
| 3Write down the expected output before you run the test, so you can compare it with the real result | CAll three test values go down the same branch (Pass). Nothing tests the else branch, so a mistake there would never be found. | |
| 4An if-then-else has two branches, so you need at least two tests, one for each branch | DTest data with one test for each branch: a child, a teen and an adult path | |
| 5if mark >= 50 then print "Pass" else print "Fail" Tests: 60, 70, 90 | EOne test case: a chosen input paired with the output you expect before running the algorithm | |
| 6Tests: input = 5, input = 12 (no expected output written) | Fif score >= 50 then: Tests: 80 and 20 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
test data — Chosen inputs, each with the output you expect, picked so every path (branch) through an algorithm gets tested. Compare the real result to the expected output.if mark >= 50 then print "Pass"
else print "Fail"
Test: mark = 30, expected = "Fail"Algorithm has 3 branches (if, else if, else)
One test per branch means 3 testsif mark >= 50 then print "Pass"
Test: mark = 50, expected output "Pass"actual ← 20
expected ← 20
if actual = expected then print "Match"if age >= 18 then fee ← 10 else fee ← 5
Test: age = 12, expected fee = 5