Knowledge organisersTesting
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!