Testing Methods (Cambridge (CIE) A Level Computer Science): Revision Note
Exam code: 9618
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 |
---|
|
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!
Did this page help you?