Testing Methods (Cambridge (CIE) A Level Computer Science): Revision Note

Exam code: 9618

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

Testing methods

What are the different methods of testing?

  • Testing takes place during the testing stage of the program development life cycle, once the program has been written and compiled

    • Syntax errors are usually detected during compilation

    • Testing focuses on checking for logic errors, unexpected behaviour, and operational integrity

    • A detailed test plan, outlining test cases and expected results, should be created during the analysis stage

Sample test plan

  • Scenario: A program accepts a user's age between 0 and 120 inclusive

Test No.

Description

Input

Expected output

Type of test data

Actual outcome

1

Valid age within accepted range

25

"Age accepted"

Normal

2

Input is not a number

"twenty"

"Invalid input: enter a number"

Abnormal

3

Age above the maximum allowed

130

"Age out of range"

Extreme

4

Age exactly at the upper boundary

120

"Age accepted"

Boundary

5

Age exactly at the lower boundary

0

"Age accepted"

Boundary

6

Age just below lower boundary

-1

"Age out of range"

Extreme

7

Blank input

(blank)

"Please enter your age"

Abnormal

Common methods of testing

Testing method

Description

Dry run

Manually trace through the code (e.g. on paper) to predict output and track variables

Walkthrough

Step-by-step review of the code with others to identify issues early

White-box testing

Tests the internal logic and code structure; the tester knows how the program works

Black-box testing

Tests the inputs and expected outputs without knowing the internal workings

Integration testing

Checks that different modules or components work correctly together

Alpha testing

Performed in-house by the developers during early testing

Beta testing

Carried out by external users in real-world environments

Acceptance testing

Final check to ensure the program meets the original client requirements

Stub testing

Uses temporary modules (stubs) to simulate missing components during early testing

Choosing suitable test data

What is suitable test data?

  • Suitable test data is specially chosen to test the functionality of a program or design

  • Developers or test-users would pick a selection of test data from the following categories

    • Normal

    • Abnormal

    • Extreme

    • Boundary

  • The results would be compared to the expected results to check if the algorithm/program works as intended

  • The results would be stored in the test plan

  • Each category is explained within the context of a simple pseudocode program below

Pseudocode

DECLARE name : STRING
DECLARE age : INTEGER

OUTPUT "What is your name? "
INPUT name

OUTPUT "How old are you? "
INPUT age

IF age >= 12 AND age <= 18 THEN
    OUTPUT "Welcome, " + name + "! Your age is accepted."
ELSE
    OUTPUT "Sorry, " + name + ". Your age is not accepted."
ENDIF

Normal data

  • Normal test data is 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

Abnormal data

  • Abnormal test data is 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

Extreme data

  • Extreme test data is the maximum and minimum values of normal data that are accepted by the system

  • An example would be a user entering their age as 18 or 12 into the age field of the program

Boundary data

  • Boundary test data is similar to extreme data except that the values on either side of the maximum and minimum values are tested

  • The largest and smallest unacceptable values

  • An example would be a user entering their age as 11 or 19 into the age field of the program

Selecting suitable test data

Type of Test

Input

Expected Output

Normal

14

Accepted

Normal

16

Accepted

Extreme

12

Accepted

Extreme

18

Accepted

Abnormal

H

Rejected

Abnormal

@

Rejected

Boundary

11

Rejected

Boundary

19

Rejected

You've read 0 of your 5 free revision notes this week

Unlock more, it's free!

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

the (exam) results speak for themselves:

Did this page help you?

Robert Hampton

Author: Robert Hampton

Expertise: Computer Science Content Creator

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science & English Subject Lead

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.