Content deleted Content added
→Different kinds of data validation: refpunct., simplify heading |
Reorganized general content, removed overly specific content Tags: Visual edit Mobile edit Mobile web edit |
||
Line 1:
{{more citations needed|date=November 2016}}
In [[computer science]], '''data validation''' is the process of ensuring [[data]] have undergone [[data cleansing]] to ensure they have [[data quality]], that is, that they are both correct and useful. It uses routines, often called "validation rules", "validation constraints", or "check routines", that check for correctness, meaningfulness, and security of data that are input to the system. The rules may be implemented through the automated facilities of a [[data dictionary]], or by the inclusion of explicit [[application program]] validation logic of the computer and its application.
This is distinct from [[formal verification]], which attempts to prove or disprove the correctness of algorithms for implementing a specification or property.
==Overview ==
Data validation is intended to provide certain well-defined guarantees for fitness
Note that the guarantees of data validation do not necessarily include accuracy, and it is possible for data entry errors such as misspellings to be accepted as valid. Other clerical and/or computer controls may be applied to reduce inaccuracy within a system.
==Different kinds==
In evaluating the basics of data validation, generalizations can be made regarding the different
For example:
* Data type validation;
* Range and constraint validation;
* Code and
* Structured validation; and
* Consistency validation
===Data-type check===
Data type validation is customarily carried out on one or more simple data fields.
The simplest kind of data type validation verifies that the individual characters provided through user input are consistent with the expected characters of one or more known primitive data types
For example, an integer field may require input to use only characters 0 through 9.
===Simple range and constraint check===
Simple range and constraint validation may examine
===Code and cross-reference check===
Code and cross-reference validation includes
For example, a user-provided country code might be required to identify a current geopolitical region.
===Structured check===
Structured validation allows for the combination of
===Consistency check===
Consistency
===
* Size. A pre-2007 ISBN must consist of 10 digits, with optional hyphens or spaces separating its four parts.
* Format checks.
* [[Check digit]]. To detect transcription errors in which digits have been altered or transposed, the last digit of a pre-2007 ISBN must match the result of a mathematical formula incorporating the other 9 digits ([[International Standard Book Number#ISBN-10 check digits|ISBN-10 check digits]]).
==Validation methods==
;Allowed character checks
:Checks to ascertain that only expected characters are present in a field. For example a numeric field may only allow the digits 0–9, the decimal point and perhaps a minus sign or commas. A text field such as a personal name might disallow characters
;Batch totals
Line 72 ⟶ 55:
;Cardinality check
:Checks that record has a valid number of related records. For example, if
;Check digits
:Used for numerical data.
;Consistency checks
:Checks fields to ensure data in these fields correspond, e.g.,
;Cross-system consistency checks
:Compares data in different systems to ensure it is consistent
;Data type checks
:Checks
;File existence check
:Checks that a file with a specified name exists. This check is essential for programs that use file handling.
;Format
:Checks that the data is in a specified format (template), e.g., dates have to be in the format
;Presence check
:Checks that
;Range check
:Checks that the data is within a specified range of values, e.g.,
;Referential integrity
:
;Spelling and grammar check
Line 120 ⟶ 91:
;Table look up check
:A table look up check
===Post-validation actions===
|