Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Testing

Why test?

All topicsPractise exam questions
Knowledge organiser

Testing

301.13a

Purpose of software testing.

What you need to know

Testing checks that a program works correctly under different conditions. Without testing, bugs can go unnoticed and cause incorrect results or crashes.

Key points

  • Testing finds errors before users do
  • Test with a range of inputs, not just obvious ones
  • Even code that 'looks right' can have logic errors
  • Testing should be systematic, not random

Code examples

Untested bug example
python
# 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!