Content deleted Content added
+OWASP |
m Added internal link to "Database" |
||
(47 intermediate revisions by 40 users not shown) | |||
Line 1:
{{Short description|Process of ensuring computer data is both correct and useful}}
{{redirect|Input validation||Improper input validation}}
{{more citations needed|date=November 2016}}
In [[
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, accuracy, and consistency for any of various kinds of user input into an application or automated system. Data validation rules can be defined and designed using any of various methodologies, and be deployed in any of various contexts.<ref>[https://ec.europa.eu/eurostat/cros/system/files/methodology_for_data_validation_v1.0_rev-2016-06_final.pdf Methodology for data validation 1.0]</ref>▼
▲==Overview ==
▲Data validation is intended to provide certain well-defined guarantees for fitness
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.
In evaluating the basics of data validation, generalizations can be made regarding the different
▲==Different kinds of data validation==
▲In evaluating the basics of data validation, generalizations can be made regarding the different types of validation, according to the scope, complexity, and purpose of the various validation operations to be carried out.
For example:
* Data type validation;
* Range and constraint validation;
* Code and
* [[Structure validation|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 type|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.
▲An example of a validation check is the procedure used to verify an [[ISBN]].<ref>[http://www.lac-bac.gc.ca/iso/tc46sc9/isbn.htm ''Frequently Asked Questions about the new ISBN standard''] {{Webarchive|url=https://web.archive.org/web/20070610160919/http://www.lac-bac.gc.ca/iso/tc46sc9/isbn.htm |date=2007-06-10 }} [[International Organization for Standardization|ISO]].</ref>
* [[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]]).
▲* Format checks. Data must conform to a specified format. Thus, the first 9 characters must be the digits 0 through 9' the 10th must be either those digits or an ''X''
▲==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 ⟶ 57:
;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
;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 ⟶ 93:
;Table look up check
:A table look up check
===Post-validation actions===
{{
;Enforcement Action
:Enforcement action typically rejects the data entry request and requires the input actor to make a change that brings the data into compliance. This is most suitable for interactive use, where a real person is sitting on the computer and making entry. It also works well for batch upload, where a file input may be rejected and a set of messages sent back to the input source for why the data is rejected.
Line 132 ⟶ 105:
;Verification Action
:Verification actions are special cases of advisory actions. In this case, the source actor is asked to verify that this data is what they would really want to enter, in the light of a suggestion to the contrary. Here, the check step suggests an alternative (e.g., a check of
;Log of validation
:Even in cases where data validation did not find any issues, providing a log of validations that were conducted and their results is important. This is helpful to identify any missing data validation checks in light of data issues and in improving
==Validation and security==
Failures or omissions in data validation can lead to [[data corruption]] or a [[
== See also ==
* [[Data processing]]
* [[Data verification]]
* [[Triangulation (social science)]]
* [[Verification and validation]]
Line 154 ⟶ 129:
{{DEFAULTSORT:Data Validation}}
[[Category:Data processing]]
[[Category:Data security]]
[[Category:Data quality]]
|