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 3 | Expected: 50 | Actual: 5 | Result: Fail | ACorrection: added int() around input() to convert age to a number | |
| 2Correction: changed < to <= in the loop condition | Retest: Pass | BRetest result: Fail - still returns 5, so try a new fix | |
| 3The corrective action column records exactly what was changed in the code to fix a failed test | CA corrective action and retest result: the fix made, then proof from running the test again that it now works | |
| 4After a fix, the same test is run again and the retest result is recorded as Pass or Fail | DA failed test row: the actual output does not match the expected output, so a correction is needed | |
| 5Test 4 | Result: Fail | Correction: (blank) | Retest: Pass | EThe correction is vague and there is no retest result, so nobody knows if the fix worked | |
| 6Test 2 | Result: Fail | Correction: fixed the code | Retest: (blank) | FThe test failed but no corrective action is recorded, so the retest Pass cannot be traced to any fix |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
corrective action — The fix recorded in a testing table for a failed test, followed by the retest result that shows whether the fix worked (pass or fail).if actual != expected:
row["result"] = "Fail"row = tests[3]
row["fix"] = "Added int() conversion"actual = add(2, 3)
row["retest"] = actual == expectedif row["result"] == "Fail":
row["fix"] = "Fixed loop range"for row in tests:
if row["retest"] == "Fail":
print(row["id"], "still fails")