Input Validation
PronunciationIN-poot val-ih-DAY-shun
Definition
Input validation checks that data is of the expected type, length, range and format before the program accepts it, and rejects anything else.
Where you hear it
In security checklists, API design, forms, CLI tools, and every bug report about weird data.
Examples
Validate the amount is a positive number before saving it.
Client-side checks are for convenience; the server must validate again.
The form rejects a birth date in the future before it reaches the server.
Common mistake
Validating only in the browser. Anyone can send requests directly and skip it.
Don't confuse with
Escaping or parameterised queries, which protect the output and the database. Validation is the first layer, not the only one.
Say it at work
- In a meeting or chat
Add validation for the empty and negative cases.
- In an email or ticket
Use an allow list of accepted values.