The Bouncer at the Door

Test yourself on Input Validation with exam style questions, marked instantly.

Flashcards that come back just before you would forget them.

A revision plan that remembers what you know and shows what to do next.

See which topics you have nailed and which need another look.

Quiz yourself on Input ValidationGet your flashcardsBuild my revision planTrack my progress

The Bouncer at the Door

Validation is like a bouncer at a club - checking everyone meets the entry requirements before letting them in. You can't have negative age, a 47-character postcode, or £999,999 in a £50 limit account. Validation catches these impossible values *before* they break your program. It doesn't guarantee data is correct (someone could enter age 25 when they're 52), but it ensures data is sensible and won't crash the system.
Five validation checks, each with a value that passes and a value that fails. Range check, age from 0 to 120: 25 passes, -5 fails. Length check, password 8 to 20 characters: Pass1234! passes, abc fails. Presence check, name must not be empty: Alice passes, blank fails. Format check, email must contain @: a@b.com passes, not-an-email fails. Type check, quantity must be a whole number: 3 passes, three fails

Validation is not verification. Validation checks that data is sensible, as these checks do. Verification checks that the data is what the user meant, for example by typing a password twice. A value can pass validation and still be wrong: 25 passes the range check even if the person is 52.

Make this stick

Signing in gives access to all PrepWise features.

PrepWise is a trading name of A3M Quality Solutions Limited, registered in England and Wales, company number 14959172. Registered office: 202 Stroud Road, Gloucester, GL1 5LA. ICO registration ZC267069.