Computer-science_A-level_Cie
-
computers-and-components6 主题
-
logic-gates-and-logic-circuits2 主题
-
central-processing-unit-cpu-architecture6 主题
-
assembly-language-4 主题
-
bit-manipulation1 主题
-
operating-systems3 主题
-
language-translators2 主题
-
data-security3 主题
-
data-integrity1 主题
-
ethics-and-ownership3 主题
-
database-concepts3 主题
-
database-management-systems-dbms-1 主题
-
data-definition-language-ddl-and-data-manipulation-language-dml1 主题
-
computational-thinking-skills1 主题
-
algorithms14 主题
-
data-types-and-records2 主题
-
arrays2 主题
-
files1 主题
-
introduction-to-abstract-data-types-adt1 主题
-
programming-basics1 主题
-
constructs2 主题
-
structured-programming1 主题
-
program-development-life-cycle2 主题
-
program-design-2 主题
-
program-testing-and-maintenance3 主题
-
user-defined-data-types1 主题
-
file-organisation-and-access-3 主题
-
floating-point-numbers-representation-and-manipulation3 主题
-
protocols2 主题
-
circuit-switching-packet-switching1 主题
-
processors-parallel-processing-and-virtual-machines5 主题
-
boolean-algebra-and-logic-circuits4 主题
-
purposes-of-an-operating-system-os3 主题
-
translation-software3 主题
-
encryption-encryption-protocols-and-digital-certificates3 主题
-
artificial-intelligence-ai4 主题
-
recursion1 主题
-
programming-paradigms4 主题
-
object-oriented-programming7 主题
-
file-processing-and-exception-handling2 主题
-
data-representation5 主题
-
multimedia3 主题
-
compression2 主题
-
networks-and-the-internet11 主题
testing-methods
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 |
Responses