Friday, 29 May 2015

Test Data, Validation & Verification



Test Data
Test data is the data that is used in tests of a software system.
In order to test a software application we need to enter some data for testing most of the features. Any such specifically identified data which is used in tests is known as test data.
There are following three types of test data:
1.    Normal Data
2.    Abnormal Data
3.    Extreme Data

1.    Normal Data
This is the data a computer system should work on.Testing needs to be done to prove that the solution works correctly. In order to do this a set of test data should be used together with the result(s) that are expected from that data. The type of test data used to do this is called NORMAL DATA, this should be used to work through the solution to find the actual result(s) and see if these are the same as the expected result(s).
For example, here is a set of normal test data for an algorithm to record the percentage marks from 10 end-of-term examinations for a student and find their average mark:
Normal test data: 50, 50, 50, 50, 50, 50 50, 50, 50, 50
Expected result: 50

2.    Abnormal Data
This is data that should cause the system to tell the user that there is a problem with data entered into the system.Testing also needs to be done to prove that the solution does not give incorrect results. In order to do this, test data should be used that will be rejected as the values are not suitable. This type of test data is called ERRONEOUS or ABNORMAL TESTDATA; it should be rejected by the solution.
For example erroneous/abnormal data for an algorithm to record the percentage marks from 10 end-of-term examinations for a student and find their average mark could be:
Erroneous/abnormal data:–12, eleven
Expected results: these values should be rejected

3.    Extreme Data
When testing algorithms with numerical values, sometimes only a given range of values should be allowed. For example, percentage marks should only be in the range 0 to 100. The algorithm should be tested with EXTREME DATA, which, in this case, are the largest and smallest marks that should be accepted. Extreme data are the largest and smallest values that normal data can take.
Extreme data: 0, 100
Expected results: these values should be accepted

Validation and Verification
Validation and verification are two ways to check that the data entered into a computer is correct. Data entered incorrectly is of little use.
Data verification
Verification is performed to ensure that the data entered exactly matches the original source.Verification means checking the input data with theoriginal data to make sure that there have been notranscription errors (transcription means copyingthe data). The standard way to do this is to input thedata twice to the computer system. The computerthen checks the two data values (which should be thesame) and, if they are different, the computer knowsthat one of the inputs is wrong. e.g. Enterrring password twice during sig-up.
Verification methods include:
Ø  double entry
Ø  screen/visual check (proof reading)
Ø  parity check
Ø  checksum.

Validation is an automatic computer check to ensure that the data entered is sensible and reasonable. It does not check the accuracy of data.
For example, a secondary school student is likely to be aged between 11 and 16. The computer can be programmed only to accept numbers between 11 and 16. This is a range check.
However, this does not guarantee that the number typed in is correct. For example, a student's age might be 14, but if 11 is entered it will be valid but incorrect.
Types of validation
There are a number of validation types that can be used to check the data that is being entered.
Validation type
How it works
Example usage
Range check
Checks that a value falls within the specified range
Number of hours worked must be less than 50 and more than 0
Length check
Checks the data isn't too short or too long. values must be a specific length.
A password which needs to be six letters long
Type Check
Checks that the data entered is of a given data type,
Number of brothers or sisters would be an integer (whole number).
Character Check
Checks that when a string of characters is entered it does notcontain any invalid characters or symbols,
A name would not contain characters such as %, and a telephone number would only contain digits or (, ), and+.
Format Check
Checks the data is in the right format. Valuesmust conform to a specific pattern, for example, two letters followed by six digits followed by a single letter
A National Insurance number is in the form LL 99 99 99 L where L is any letter and 9 is any number
Presence check
Checks that data has been entered into a field
In most databases a key field cannot be left blank
Check digit
The last one in a code are used to check the other digits are correct
Bar code readers in supermarkets use check digits



Q1) Activity of data validation and verification:
1) What is an automatic computer check to make sure data entered is sensible and reasonable known as?  
a)     Double entry      b) Verification           c) Validation
2) What validation type would make sure a post code was entered in the correct format?
a)    Length check                        b) Format Check      c) Presence check
3) What validation type would you use to check that numbers fell within a certain range?
a)    Range check                        b) Presence Check              c) Check digit
4) What validation type checks that a field is not left blank?
a)    Format check            b) Length check       c) Presence check
5) What validation type uses the last one or two digits to check the other digits are correct?
a)    Length check                        b) Format check       c) Check digit
6) What validation type checks a minimum number of characters have been entered?
a)    Length check      b) Format check       c) Range check
7) Data is to be entered into a computer in the format YYMMDD. Which of the following is not a valid date?
a)    310921                 b) 211113                   c) 21st June 2004
8) Which of the following statements is false?
a) Validation can check that the data is sensible
b) Validation can check that the data falls between certain allowable boundaries
c) Validation can check that the data is correct

9) Which of the following is NOT a method of verification?
a) Double entry - typing the data in twice and getting the computer to check the second version against the first
b) Using presence, range and length checks to make sure that no mistakes happen
c) Printing out what you have typed in and comparing it against the source data
Marking Scheme
1. An automatic computer check to make sure data entered is sensible and reasonable is known as validation.
2. A format check would make sure a post code was entered in the correct format.
3. A range check would check that numbers fell within a certain range.
4. A presence check prevents a field from being left blank.
5. Check digit uses the last one or two digits to check the other digits are correct.
6.  A length check would check that a minimum number of characters had been entered.
7. 21st June 2004 is not a valid date.
8. Validation cannot check that the data is correct.
9.  Using presence, range and length checks to make sure that no mistakes happen is NOT a method of verification.

0 comments:

Post a Comment