GCSE Computer Science (Edexcel)

Topic Summaries

ALGORITHMS AND PROGRAMMING: Testing programs

Types of testing and test plans

  • Iterative testing:
    • Carried out throughout development.
    • Each module or section is tested as it’s written.
    • Helps identify and fix errors early. 
    • Useful for things like testing a login function before integrating it into the whole system. 

# Iterative test example

def square(n):

return n * n

print(square(4))

  • Final/terminal testing:
    • This happens at the end of development and tests the entire system to make sure everything works.
    • Final testing simulates real-world use and is an essential last stage of development. 
    • For example, on the right and below is a final test and a test plan for age validating access to a children’s activity centre for 5–12 year olds:

# Final test example

def check_age(age):

if age < 5 or age > 12:

return “Rejected

else:

return “Accepted

Test data Type of test data Expected result Actual result Pass/Fail
7 Normal Accepted Accepted Pass
5 Boundary Accepted Rejected Pass
12 Boundary Accepted Accepted Fail (This tells us we have made a logic error with the upper bound)
4 Invalid Rejected Rejected Pass
18 Invalid Rejected Rejected Pass
"ten" Erroneous Rejected Program error Fail (This tells us we have made a syntax error with handling erroneous data)

Unlock Types of testing and test plans

Sign up to unlock the rest of this topic — plus every other topic, video, flashcard set and eBook guide in your SnapRevise Digital subscription.

Cancel anytime — instant access the moment you sign up.