Friday, 12 December 2008

DATA VALIDATION DESIGN AND CODING

It is critical that the programmer / analyst incorporate programmed validation checks on data at initial input. This module focuses on two general categories of programmed input validation checks.

Ø Character Testing

Ø Field Checking

Character Testing

The most basic form of data validation control is testing individual character positions with in a filed. The two forms of character tests are

Ø Class test

Ø Sign test

Class Test:

Class test determine whether data values within a field fail into the numeric, alphabetic or alphanumeric class.

DATA CLASS

VALID CHARACTERS

Numeric

Digits 0 – 9 & An operational Sign

Alphabetic

Letter A – Z & Space letter a – z

Alphanumeric

Digits 0 – 9 (Letter A-Z spaces, letter a – z, special characters.

Sign Test:

A sign test is performed only on fields defined in DATA DIVISION as numeric (PIC 9). Numeric data can be considered in two categories.

  • Algebraic values – Data quantities that actually represent numeric values
  • Absolute Values – Numeric Codes

Field Checking:

In addition to the basic character testing of input data fields, most data elements should be subjected to further more rigorous checks. There are called field checks. They are

v Presence Checks

v Absence Checks

v Range Checks

v Limit Checks

v Reasonableness Checks

v Consistency Checks

v Justification Checks

v Embedded Checks

v Date Checks

v Code-Existence Checks

Presence Checks:

A presence check detects missing values in field most input record contain both required and optional fields. A test for presence should normally apply to all required fields.

Absence Checks:

The converse of a presence check is an absence check which ensures that a field or record area is blank. The absence check is typically limited to situations in which an unused or unassigned area of an input record exists.

Limit Check:

A limit check tests a field against maximum and / or minimum values. The limits can be either absolute amount or percentages.

Reasonableness Check:

A reasonableness check identifies abnormal data values. It is important to remember that certain values identified as exceptions will intact be valid. So, any program must include provisions to over side reasonableness check to force acceptance of the data into the system.

Consistency Check:

A consistency check is the consideration of two or more data elements in relation to one another. It can be powerful way to detect erroneous data. Consistency checks are used not only in uncovering data recording errors but also in monitoring processing operations.

Justification Checks:

A justification check ensures proper alignment of data within a field alphabetic and alphanumeric fields are usually left-justified, numeric-integer fields are normally right-justified and numeric fields with decimal place are decimal-point aligned. Justification check are performed on numeric fields the numeric class test is more powerful because if (i) Detects both blank and non-numeric character and (ii) checks are position field.

Range Check:

A range check is applied to code numbers to verify that they exist in the coding system use.

Embedded Blank Check:

An embedded blank check checks certain alphanumeric fields to ensure that the blank positions were not entered in advertently. An embedded blank is one that has data characters with in the field both to the left and to the right of the blank position.

Date Check:

A date check ensures the validity of calendar dates recorded in input transaction. Two basic formats express data in data-processing systems.

v Gregorian

v Julian

Code-Existence Check:

A code existence check ensures that a particular code is valid. Many numeric codes can be validated through the use of range. Checks or techniques appropriate to a specific applications.

No comments:

Post a Comment