Selecting & Using Suitable Test Data (OCR GCSE Computer Science)

Revision Note

Flashcards
James Woodhouse

Expertise

Computer Science

Normal, Boundary & Erroneous Tests

Categories of tests

  • The are three main categories of tests a programmer or test-user would carry out whilst performing both iterative or final testing on a program
    • Normal tests
    • Boundary tests
    • Erroneous tests
  • There is an additional test that users would always carry out to test the robustness of their program, this is known as an invalid test
  • To explain the types of tests, some example code will be used

Example code

# Ask for user's name
name = input("What is your name? ")

# Ask for user's age
age =
int(input("How old are you? "))

# Check if age is between 12 and 18
if age >= 12 and age <= 18:
    print("Welcome, " + name + "! Your age is accepted.")
else:
    print("Sorry, " + name + ". Your age is not accepted.")

Normal tests

  • A normal test is when a user enters data that should be accepted in the program
  • An example would be a user entering their age as 16 into the age field of the program

Boundary tests

  • A boundary test is when a user enters data that is on the edge of what is acceptable 
  • An example would be a user entering their age as 12 or 18 into the age field of the program

Erroneous tests

  • An erroneous test is when a user enters data that is the wrong data type
  • An example would be a user entering their age as "F" into the age field of the program

Invalid tests

  • An invalid test is when a user enters data that is the right data type but it is outside of what is accepted
  • An example would be a user entering their age as 67 into the age field of the program

Selecting suitable test data

Type of Test

Input

Expected Output

Normal 14 Accepted
Normal 16 Accepted
Boundary 12 Accepted
Boundary 19 Rejected
Erroneous H Rejected
Erroneous @ Rejected
Invalid 36 Rejected
Invalid 2 Rejected

Worked example

SME Electronics is an online shop which sells electronic items.
The following flowchart shows an algorithm used to calculate the price of an item when they have a sale.

screenshot-2024-02-28-at-15-08-49

  1. Complete the following test plan for the algorithm [4]
Price Input Test Type Expected Price Output
50 Normal  
100    
150    
200 Boundary  
FFF    

Answer

  • Marked in pairs
  • 1 mark per two correct cells
Price Input Test Type Expected Price Output
50 Normal 50
100 Boundary 100
150 Normal 130
200 Boundary 180
FFF Erroneous Error

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

James Woodhouse

Author: James Woodhouse

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.