301.13 Testing
Practise exam questionsTesting — Note 1 of 6
Purpose of software testing.
Testing checks that a program works correctly under different conditions. Without testing, bugs can go unnoticed and cause incorrect results or crashes.
# This looks correct but fails for negative numbers
def is_even(n):
return n % 2 == 0
print(is_even(4)) # True ✓
print(is_even(-3)) # False ✓
# Always test edge cases!Specification notes for programming are in Paper 2.