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 | |
|---|---|---|
| 1assert is_adult(18) == True | AAn edge case the AI may have missed, so you add it yourself: an empty list should give a total of 0 | |
| 2assert calc_total([]) == 0 | BThe expected output was trusted without being checked against the requirement, so the test may be wrong | |
| 3Ask the AI for normal, boundary and invalid tests, not just one kind | CAn AI-drafted boundary test: you must check by hand that 18 should really count as an adult | |
| 4Check an AI expected output by hand: 15% of 200 is 30, so this assert is wrong | DOnly a normal case is tested, so boundary and invalid cases such as -1, 0 and 120 are missing | |
| 5assert get_grade(50) == 'F' # copied from AI, never checked | EWrite assert tests for check_age() with normal, boundary and invalid values | |
| 6assert is_valid_age(25) == True # only test written | Fassert discount(200) == 20 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
assert — AI can draft assert tests for a module, but you must check each expected output by hand to be sure it is correct. Also add any normal, boundary or invalid cases it missed.assert add(2, 3) == 5assert add(2, 3) == 5# marks run from 0 to 100
assert validMark(0) == Trueassert validMark("abc") == Falseassert total([2, 4, 6]) == 12