Skip to content

Validation

Jaber Askari M2947

Discription

Data validation is the process of ensuring data have undergone data cleansing to ensure they have data quality, that they are both correct and useful. Validation is an automatic check to ensure that data entered is sensible and parctical.

Validation cannot ensure data is accurate.

When programming, it is important that you include validation for data inputs. This stops unexpected or abnormal data from crashing your program and prevents you from receiving impossible garbage outputs.

Validation methods

  • Range check: Checks the data falls between an acceptable upper and lower value, within a set range
  • Type check: Checks that the data entered is of an expected type, e.g. text or a number
  • Length check:Checks the number of characters meets expectations, e.g. an 8 character password
  • Presence check: Checks that the user has at least inputted something, stopping them from accidentally entering nothing
  • Check digit: An extra digit added to a number which is calculated from the other digits, this ensures the rest of the number has been entered properly

Sources

https://en.wikipedia.org/wiki/Data_validation