Data validation

In computing, data validation or input validation is the process of ensuring data has undergone data cleansing to confirm it has data quality, that is, that it is 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 and consistency of data in an application or automated system. Data validation rules can be defined and designed using various methodologies, and be deployed in various contexts.[1] Their implementation can use declarative data integrity rules, or procedure-based business rules.[2]

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 kinds of validation according to their scope, complexity, and purpose.

For example:

  • Data type validation;
  • Range and constraint validation;
  • Code and cross-reference 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 types as defined in a programming language or data storage and retrieval mechanism.

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 input for consistency with a minimum/maximum range, or consistency with a test for evaluating a sequence of characters, such as one or more tests against regular expressions. For example, a counter value may be required to be a non-negative integer, and a password may be required to meet a minimum length and contain characters from multiple categories.

Code and cross-reference check

Code and cross-reference validation includes operations to verify that data is consistent with one or more possibly-external rules, requirements, or collections relevant to a particular organization, context or set of underlying assumptions. These additional validity constraints may involve cross-referencing supplied data with a known look-up table or directory information service such as LDAP.

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 other kinds of validation, along with more complex processing. Such complex processing may include the testing of conditional constraints for an entire complex data object or set of process operations within a system.

Consistency check

Consistency validation ensures that data is logical. For example, the delivery date of an order can be prohibited from preceding its shipment date.

Example

Multiple kinds of data validation are relevant to 10-digit pre-2007 ISBNs (the 2005 edition of ISO 2108 required ISBNs to have 13 digits from 2007 onwards[3]).

  • Size. A pre-2007 ISBN must consist of 10 digits, with optional hyphens or spaces separating its four parts.
  • Format checks. Each of the first 9 digits must be 0 through 9, and the 10th must be either 0 through 9 or an X.
  • 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 (ISBN-10 check digits).

Validation types

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 used for markup. An e-mail address might require at least one @ sign and various other structural details. Regular expressions can be effective ways to implement such checks.
Batch totals
Checks for missing records. Numerical fields may be added together for all records in a batch. The batch total is entered and the computer checks that the total is correct, e.g., add the 'Total Cost' field of a number of transactions together.
Cardinality check
Checks that record has a valid number of related records. For example, if a contact record is classified as "customer" then it must have at least one associated order (cardinality > 0). This type of rule can be complicated by additional conditions. For example, if a contact record in a payroll database is classified as "former employee" then it must not have any associated salary payments after the separation date (cardinality = 0).
Check digits
Used for numerical data. To support error detection, an extra digit is added to a number which is calculated from the other digits.
Consistency checks
Checks fields to ensure data in these fields correspond, e.g., if expiration date is in the past then status is not "active".
Cross-system consistency checks
Compares data in different systems to ensure it is consistent. Systems may represent the same data differently, in which case comparison requires transformation (e.g., one system may store customer name in a single Name field as 'Doe, John Q', while another uses First_Name 'John' and Last_Name 'Doe' and Middle_Name 'Quality').
Data type checks
Checks input conformance with typed data. For example, an input box accepting numeric data may reject the letter 'O'.
File existence check
Checks that a file with a specified name exists. This check is essential for programs that use file handling.
Format check
Checks that the data is in a specified format (template), e.g., dates have to be in the format YYYY-MM-DD. Regular expressions may be used for this kind of validation.
Presence check
Checks that data is present, e.g., customers may be required to have an email address.
Range check
Checks that the data is within a specified range of values, e.g., a probability must be between 0 and 1.
Referential integrity
Values in two relational database tables can be linked through foreign key and primary key. If values in the foreign key field are not constrained by internal mechanisms, then they should be validated to ensure that the referencing table always refers to a row in the referenced table.
Spelling and grammar check
Looks for spelling and grammatical errors.
Uniqueness check
Checks that each value is unique. This can be applied to several fields (i.e. Address, First Name, Last Name).
Table look up check
A table look up check compares data to a collection of allowed values.

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.
Another form of enforcement action involves automatically changing the data and saving a conformant version instead of the original version. This is most suitable for cosmetic change. For example, converting an [all-caps] entry to a [Pascal case] entry does not need user input. An inappropriate use of automatic enforcement would be in situations where the enforcement leads to loss of business information. For example, saving a truncated comment if the length is longer than expected. This is not typically a good thing since it may result in loss of significant data.
Advisory Action
Advisory actions typically allow data to be entered unchanged but sends a message to the source actor indicating those validation issues that were encountered. This is most suitable for non-interactive system, for systems where the change is not business critical, for cleansing steps of existing data and for verification steps of an entry process.
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 a mailing address returns a different way of formatting that address or suggests a different address altogether). You would want in this case, to give the user the option of accepting the recommendation or keeping their version. This is not a strict validation process, by design and is useful for capturing addresses to a new location or to a location that is not yet supported by the validation databases.
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 security vulnerability.[4] Data validation checks that data are fit for purpose,[5] valid, sensible, reasonable and secure before they are processed.

See also

References

Read other articles:

Royal Italian Army infantry division during World War II 221st Coastal DivisionActive1942 – 1943Country Kingdom of ItalyBranch Royal Italian ArmySizeDivisionGarrison/HQPontiniaEngagementsWorld War IIInsigniaIdentificationsymbol 221st Coastal Division gorget patchesMilitary unit The 221st Coastal Division (Italian: 221ª Divisione Costiera) was an infantry division of the Royal Italian Army during World War II.[1] Royal Italian Army coastal divisions were second line divisi...

 

Este artículo o sección necesita referencias que aparezcan en una publicación acreditada.Este aviso fue puesto el 4 de agosto de 2009. Linde Lindström Información personalNombre de nacimiento Mikko LindströmOtros nombres Linde, Lily Lazer, Daniel Lioneye, BambiNacimiento 12 de agosto de 1976 (47 años)Nurmijärvi, Finlandia[1]​Nacionalidad FinlandesaInformación profesionalOcupación MúsicoAños activo desde 1983Seudónimo Linde, Lily Lazer, Daniel Lioneye, BambiGénero...

 

Pelabuhan Thi NaiPelabuhan Thị Nại, berlawanan dengan pegunungan Semenanjung Phuong Mai.LokasiNegaraVietnamLokasiQuy Nhơn Pelabuhan Thị Nại (bahasa Vietnam: Cảng Thị Nại) adalah pelabuhan terbesar kedua di Provinsi Bình Định, Vietnam. Pelabuhan tersebut terletak di kawasan Hai Cang (artinya pelabuhan laut) di ujung timur kota Quy Nhơn. Pada 2009, 644 ton barang diangkut ke Pelabuhan Thị Nại, 113 ton diantaranya diekspor dan 3 ton diantaranya diimpor.[1] Sej...

 

Capilla de los Españoles LocalizaciónPaís ItaliaDivisión FlorenciaCoordenadas 43°46′29″N 11°14′56″E / 43.77483333, 11.24885278Historia del edificioFundación siglo XIVjulianoConstrucción 1343-1355Arquitecto Jacopo TalentiObras artísticas Frescos de Andrea di Bonaiuto (1365-1367)Crucifijo de mármol de Domenico PierattiMapa de localización Capilla de los Españoles Ubicación en Florencia.[editar datos en Wikidata] La capilla de los Españoles (en ita...

 

 Nota: Para outros significados, veja Transformers (desambiguação). Esta página cita fontes, mas que não cobrem todo o conteúdo. Ajude a inserir referências. Conteúdo não verificável pode ser removido.—Encontre fontes: ABW  • CAPES  • Google (N • L • A) (Setembro de 2020) Optimus Prime e Bumble Bee,; Transformers na Universal Studios. Transformers são robôs alienígenas fictícios de uma franquia popular da Hasbro...

 

No debe confundirse con Ministerio Secretaría General de Gobierno de Chile. Secretaría General de la Presidencia de Chile Logo del SEGPRES.LocalizaciónPaís ChileInformación generalSigla SEGPRESMINSEGPRES[1]​Jurisdicción ChileTipo MinisterioSede Moneda 1160, SantiagoOrganizaciónMinistro Secretario General de la Presidencia Álvaro Elizalde SotoSubsecretaria General de la Presidencia Macarena Lobos PalaciosJefe de Gabinete Carlos Durán MigliardiJefe de Asesores[Nota 1]​ Migu...

 

Norpropoxyphene Names Preferred IUPAC name (2S,3R)-3-Methyl-4-(methylamino)-1,2-diphenylbutan-2-yl propanoate Identifiers CAS Number 32501-12-5 Y 3D model (JSmol) Interactive image ChemSpider 2341605 Y PubChem CID 3084563 UNII C812VVS96K Y InChI InChI=1S/C21H27NO2/c1-4-20(23)24-21(17(2)16-22-3,19-13-9-6-10-14-19)15-18-11-7-5-8-12-18/h5-14,17,22H,4,15-16H2,1-3H3/t17-,21+/m1/s1 YKey: IKACRWYHQXOSGM-UTKZUKDTSA-N YInChI=1/C21H27NO2/c1-4-20(23)24-21(17(2)16-22-3,19-13...

 

ZincoliveniteZincolivenite from Agios Konstantinos, Lavrion District Mines, Lavreotiki District, East Attica Prefecture, GreeceGeneralCategoryArsenate mineralFormula(repeating unit)CuZn(AsO4)(OH)IMA symbolZoli[1]Strunz classification8.BB.30Dana classification41.06.06.06Crystal systemOrthorhombicCrystal classDipyramidal (mmm) H-M symbol: (2/m 2/m 2/m)Space groupPnnmUnit cella = 8.5839(15) Å b = 8.5290(13) Å c = 5.9696(9) Å; Z = 4IdentificationColorGreen, gre...

 

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (أبريل 2021) USS San Francisco في حوض جاف بعد جنوحها 350 ميل (560 كـم) جنوب غوام في عام 2005 تتناول هذه المقالة الحوادث الرئيسية المتعلقة بالغواصات منذ عام 2000. 2000 انفجار كورسك في أ�...

 

Extended play by Who-ya Extended Vivid ViceRegular editionEP by Who-ya ExtendedReleasedFebruary 17, 2021 (2021-02-17)GenreJ-poprockLanguageJapaneseLabelSony Music JapanWho-ya Extended chronology Wyxt(2020) Vivid Vice(2021) Ice Ivy(2021) CD+DVD / Limited Pressing Singles from Vivid Vice Vivid ViceReleased: February 17, 2021 Vivid Vice (stylized in all caps) is the first extended play by Japanese band Who-ya Extended. It was released on February 17, 2021 by Sony Music Japan. ...

 

Toilet pesawat (Inggris:aircraft lavatory) adalah sebuah ruangan kecil di pesawat terbang dengan toilet dan wastafel. Airlines dan produsen pesawat terus menyelidiki cara-cara untuk meningkatkan teknologi desain toilet untuk meningkatkan fungsi dan mengurangi biaya produksi, dengan tetap menjaga tingkat keamanan yang memadai, kebersihan dan kemudahan. Referensi Pranala luar Wikimedia Commons memiliki media mengenai Aircraft toilets. A typical aircraft Vacuum Toilet System Aircraft Toilets lbs...

 

Catholic church in Sri Lanka Church in Colombo, Sri LankaSt. Anthony's ShrineSinhala: ශාන්ත අන්තෝනි සිද්ධස්ථානයTamil: புனித அந்தோனியார் திருத்தலம்St. Anthony's ShrineLocation in Colombo Municipality06°56′48.80″N 79°51′21.90″E / 6.9468889°N 79.8560833°E / 6.9468889; 79.8560833LocationKotahena, ColomboCountrySri LankaDenominationRoman CatholicArchitectureFunction...

 

Series of manga and essays written by Hayao Miyazaki Hayao Miyazaki's Daydream Data NotesCover of the collected Hayao Miyazaki's Daydream Data Notes (1997 edition)宮崎駿の雑想ノート(Miyazaki Hayao no Zassō nōto) MangaWritten byHayao MiyazakiPublished byDainippon KaigaMagazineModel GraphixOriginal runNovember 1984 – October 1994Volumes1 Hayao Miyazaki's Daydream Data Notes (Miyazaki Hayao no Zassō Nōto) is the collective name for Hayao Miyazaki's annotated manga and il...

 

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Gerbert TV series – news · newspapers · books · scholar · JSTOR (July 2016) (Learn how and when to remove this template message) American TV series or program GerbertTitle cardCreated byAndy HolmesCountry of originUnited StatesNo. of seasons3No. of ep...

 

Native American tribe in Idaho, United States Coeur d'Alene Tribe[1]Schitsu'umshSkitswishCoeur d'Alene people and tipis, Desmet Reservation, c. 1907Total population1,976[2] (2015 census)Regions with significant populations United States IdahoLanguagesEnglish • Coeur d'Alene The Coeur d'Alene Tribe /kɜːrdəˈleɪn/[3] (also Skitswish and in the Coeur d'Alene language: Schi̲tsu'umsh) are a Native American tribe and one of five federally recogn...

 

Australian cricket tournament 1895–96 Sheffield ShieldCricket formatFirst-classTournament format(s)Double round-robinChampionsNew South Wales (1st title)Participants3Matches6← 1894–951896–97 → The 1895–96 Sheffield Shield season was the fourth season of the Sheffield Shield, the domestic first-class cricket competition of Australia. New South Wales won the championship.[1][2] Table Team Pld W L D New South Wales 4 3 1 0 Victoria 4 2 2 0 South Australia 4 1 ...

 

1917 munitions factory explosion in Lyndhurst, New Jersey, USA This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Kingsland explosion – news · newspapers · books · scholar · JSTOR (January 2011) (Learn how and when to remove this template message) Kingsland explosionPart of World War OneA view of a section of t...

 

Цей файл був автоматично скопійований з Вікісховища через відсутність свободи панорами в Україні та може потребувати: зміну опису файлу та/чи заміну ліцензії заміну використання оригінального файлу File:Yalta Ukrainska House.JPG цією копією. Це зображення було скопійоване з Wikicommons. �...

 

Former railway station in Norfolk, England StanhoeGeneral informationLocationStanhoe, King's Lynn and West Norfolk, NorfolkEnglandGrid referenceTF798386Platforms1Other informationStatusDisusedHistoryOriginal companyWest Norfolk Junction RailwayPre-groupingGreat Eastern RailwayPost-groupingLondon and North Eastern Railway Eastern Region of British RailwaysKey dates17 August 1866Opened2 June 1952Closed[1] Stanhoe was a railway station which served the village of Stanhoe in Norfolk, Engl...

 

1969 single by the KinksDrivin'French picture sleeveSingle by the Kinksfrom the album Arthur (Or the Decline and Fall of the British Empire) B-sideMindless Child of MotherhoodReleased20 June 1969RecordedMay 1969[1]StudioPye, LondonGenrePoprockmusic hallLabelPyeSongwriter(s)Ray DaviesProducer(s)Ray DaviesThe Kinks UK singles chronology Plastic Man (1969) Drivin' (1969) Shangri-La (1969) Arthur (Or the Decline and Fall of the British Empire) track listing12 tracks Side one ...