verification and validation · verification and validation checks. verification verification is a...

21
Verification and Validation checks

Upload: others

Post on 05-Aug-2020

48 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Verificationand

Validation checks

Page 2: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Verification

▪ Verification is a way of preventing errors when data is

copied from paper documents to the computer.

▪ There two ways in which verification can be done:

1. Double Entry

2. Visual check

Page 3: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Verification methods

Two Verification methods:

1. Double Entry

2. Visual check

Page 4: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Double Entry

In the double entry verification method:

▪ data is entered twice

▪ the data is accepted only if both

versions match up.

Double entry verification method is used

when creating or modifying passwords

The user is asked to type the password

twice.

Page 5: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Visual check

In the visual check verification method:

•Errors are spotted by comparing data entered

into the computer with data on the original

document

•This ensures that whatever is on the screen is the

same as that on paper

Page 6: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Validation Checks

▪Validation is a process of checking if data

satisfies certain criteria when input

▪To be accepted the input data must be correct

and reasonable

▪The checking is done by a computer program.

Page 7: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Validation Checks

Computer program to validate quantity sold

Input quantitySold

IF (quantitySold <= 0) THEN

message(“Invalid quantity”)

ELSE

message(“quantity accepted”)

END IF

Page 8: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Validation Checks

▪ Input data can be validated in several ways

▪Different types of check may be used on the same data item

▪ E.g. When entering “Quantity Sold”

▪we may check that the value entered:

▪ Is greater than zero

▪ Is a number (not a letter / character)

▪ Is not more than quantity in stock

▪ Each type of validation check is given a name.

Page 9: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Range check

▪ Range Check ensures that only numbers within a

specified range are accepted

▪ Example : Exam marks for a student cannot be less

than zero AND more than 100

▪ i.e. the acceptable range is 0 to 100

Page 10: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Length check

▪ A Length Check ensures that the data entered contains the

exact number of characters

▪ Examples :

▪ Student Bus Pass number must contain exactly 10 characters

▪ National ID number must contain exactly 14 characters

▪ If less or more characters are entered the program rejects the

input as it is incorrect.

Page 11: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Type check

▪ A Type Check ensures that the data entered is of the

correct data type

▪ Remember data types learnt in programming classes (Integer, Double, String, Date, Boolean )

▪ Examples :

▪ Quantity Sold must be a whole number (integer)▪ Price may be a decimal number (double)▪ Name must contain alphabetical characters only (string)

Page 12: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Character check

▪A Character Check ensures that data entered

contains only characters of the correct type

▪For example check that :

▪ There are no letters in a numeric field

▪ e.g. studentMarks = xyz (invalid marks)

Page 13: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Format Check

▪ Ensures that the data being entered is in the correct format

▪ i.e. the data must follow a pre-defined pattern

▪ e.g. a program requires date to be input as DD/MM/YYYY

▪Will the program accept or reject the following entries?

▪Date = 14/6/19

▪Date = 04/05/2019

▪Date = 24-12-2019

▪Date = 24/JAN/2019 Check your answers

Page 14: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Format Check

▪Date format = DD/MM/YYYY

▪Will the program accept or reject the following entries?

• Date = 14/6/19

• Date = 04/05/2019

• Date = 24-12-2019

• Date = 24/JAN/2019

Reject

Accept

Reject

Reject

Page 15: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Presence Check

▪Checks to ensure that some required data has been

entered and the value has not been left blank

▪E.g. When a login is being performed, password must

be entered.

▪I.e. the program will not proceed if password field is left

blank.

Page 16: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Check Digit

•A digit that is calculated from the data

▪Calculation uses modulo method

•Calculated digit is appended (added) to the data

•Computer recalculates check digit when data is entered

•Original digit and calculated are compared

▪If digits match then data has been entered correctly (accept)

▪Else incorrect data has been entered (reject/enter again)

16

Page 17: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Check Digit

• Check digits are used to identify errors in data entry caused by mistyping

or scanning damaged barcodes.

• Errors that can be detected by check digit method:

• (1) digits have been transposed (inverted)

▪e.g. instead of 1 2 3 4 5 user enters 1 2 4 3 5

• (2) an incorrect digit has been entered

▪e.g. instead of 1 2 3 4 5 user enters 1 2 3 3 5

• (3) a digit is completely missed out

▪e.g. instead of 1 2 3 4 5 user enters 1 3 4 5

Page 18: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Homework 11. Describe, giving an example the purpose of the following checks during data entry.

(a)Validation check

Description: ........................................................................................................................................................................

Example: .............................................................................................................................................................................

(b)Verification check

Description: ........................................................................................................................................................................

Example: .............................................................................................................................................................................

2. An ISBN (book number) has a check digit.

(i) Explain how the check digit is used as a validation check.

............................................................................................................................. ...............................................................

(ii) Describe two types of errors can the check digit identify?

............................................................................................................................. ...............................................................

............................................................................................................................. ...............................................................

Page 19: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Homework 2

Page 20: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Homework 3

Page 21: Verification and Validation · Verification and Validation checks. Verification Verification is a way of preventing errors when data is copied from paper documents to the computer

Homework 4A program has been written to process student marks in a set of tests.

(a) Describe two validation checks that could be made on a student name.

1 ........................................................................................................................... ............

............................................................................................................................. .............

2 ........................................................................................................................... ............

............................................................................................................................. ..............

(b) Describe two validation checks that could be made on a mark.

1 ........................................................................................................................... ............

............................................................................................................................. .............

2 ........................................................................................................................... ............

............................................................................................................................. ..............