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 主题
integrity-methods
Validation & verification
What is validation?
-
Validation is an automated process where a computer checks if a user input is sensible and meets the program’s requirements
-
There are seven categories of validation which can be carried out on fields and data types, these are
-
Range check
-
Format check
-
Length check
-
Presence check
-
Existence check
-
Limit check
-
Check digit
-
-
There can be occasions where more than one type of validation will be used on a field
-
An example of this could be a password field which could have a length, presence and type check on it

What is verification?
-
Verification is the act of checking data is accurate when being transferred or entered into a system
-
Verification methods include:
-
Parity check (transfer)
-
Checksum (transfer)
-
Double entry checking (entry)
-
Visual checks (entry)
-
Validation methods
|
Validation type |
Definition |
Example |
|---|---|---|
|
Range check |
Ensures a number falls within a set range |
Validating that a percentage is between 0 and 100 |
|
Limit check |
Checks that a value does not exceed a maximum limit |
Ensuring no more than 5 items can be bought in a special offer |
|
Length check |
Checks the length of a string |
Confirming a PIN is exactly 4 digits long |
|
Type check |
Checks that the input is of the correct data type |
Ensuring age is entered as a whole number |
|
Presence check |
Checks that data has been entered and the field is not blank |
Making sure a registration form is not submitted with blank fields |
|
Existence check |
Checks that a referenced value exists in a database or list |
Confirming a student ID entered exists in the school records |
|
Format check |
Ensures data is in the correct format (e.g. patterns) |
Making sure an email address contains ‘@’ and a domain like ‘.com’ |
What is a check digit?
-
A check digit is the last digit included in a code or sequence, used to detect errors in numeric data entry
-
Examples of errors that a check digit can help to identify are:
-
Incorrect digits entered
-
Omitted or extra digits
-
Phonetic errors
-
-
Added to the end of a numerical sequence they ensure validity of the data
-
Calculated using standardised algorithms to ensure widespread compatibility
-
Examples of where check digits can be used include:
-
ISBN book numbers
-
Barcodes
-
ISBN book numbers
-
Each book has a unique ISBN number that identifies the book
-
A standard ISBN number may be ten digits, for example, 965-448-765-9
-
The check digit value is the final digit (9 in this example).
-
This number is chosen specifically so that when the algorithm is completed the result is a whole number (an integer) with no remainder parts
-
A check digit algorithm is performed on the ISBN number and if the result is a whole number, then the ISBN is valid
Barcodes
-
Barcodes consist of black and white lines which can be scanned using barcode scanners
-
Barcode scanners shine a laser on the black and white lines which reflect light into the scanner
-
The scanner reads the distance between these lines as numbers and can identify the item
-
Barcodes also use a set of digits to uniquely identify each item
-
The final digit on a barcode is usually the check digit, this can be used to validate and authenticate an item
Verification methods
What is a parity check?
-
A parity check determines whether bits in a transmission have been corrupted
-
Every byte transmitted has one of its bits allocated as a parity bit
-
The sender and receiver must agree before transmission whether they are using odd or even parity
-
If odd parity is used then there must be an odd number of 1’s in the byte, including the parity bit
-
If even parity is used then there must be an even number of 1’s in the byte, including the parity bit
-
The value of the parity bit is determined by counting the number of 1’s in the byte, including the parity bit
-
If the number of 1’s does not match the agreed parity then an error has occurred
-
Parity checks only check that an error has occurred, they do not reveal where the error(s) occurred
Even parity
-
Below is an arbitrary binary string
|
EVEN |
Byte |
||||||
|---|---|---|---|---|---|---|---|
|
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
-
If an even parity bit is used then all bits in the byte, including the parity bit, must add up to an even number
-
There are four 1’s in the byte
-
This means the parity bit must be 0 otherwise the whole byte, including the parity bit, would add up to five which is an odd number
-
Odd parity
-
Below is an arbitrary binary string
|
ODD |
Byte |
||||||
|---|---|---|---|---|---|---|---|
|
1 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
-
If an odd parity bit is used then all bits in the byte, including the parity bit, must add up to an odd number
-
There are four 1’s in the byte. This means the parity bit must be a 1 otherwise the whole byte, including the parity bit, would add up to four which is an even number
-
-
The table below shows a number of examples of the agreed parity between a sender and receiver and the parity bit used for each byte
|
Example # |
Agreed parity |
Parity bit |
Main bit string |
Total number of 1’s |
||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
#1 |
ODD |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
5 |
|
#2 |
EVEN |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
2 |
|
#3 |
EVEN |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
1 |
6 |
|
#4 |
ODD |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
1 |
5 |
|
#5 |
ODD |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
5 |
|
#6 |
EVEN |
0 |
1 |
0 |
0 |
<span data-t |
||||
Responses