Validation, Verification and Testing: Question 6

Syllabus 7.5

Multiple choice 1 mark

A garden centre's stock system has a Quantity field for each item ordered. The system will only accept an entry into this field if every character typed is a digit. It rejects the entry immediately if even one letter or symbol is typed, no matter how many digits are entered and no matter how large or small the resulting number is.

Which type of validation check is being applied to the Quantity field here?

Choose an answer to check it, then compare with the worked solution below.

Show worked solution Hide worked solution

Worked solution

Step 1: Work out exactly what rule is being described

The scenario says the entry is rejected “if even one letter or symbol is typed” and that this happens “no matter how many digits are entered and no matter how large or small the resulting number is”. So the only thing being tested is whether every character is a digit. Nothing is said about a required count of digits, a required arrangement, or a minimum/maximum value.

Step 2: Match the rule to a validation check

  • A type check confirms that data entered is of the required data type (here, numeric/integer), rejecting anything containing letters or symbols regardless of size or length.
  • A range check tests whether a numeric value falls between an upper and lower limit.
  • A length check counts the number of characters entered and compares this to a required count.
  • A format check compares the entered data against a required pattern or layout, such as specific characters in specific positions.

Step 3: Rule out the distractors

No minimum or maximum value is mentioned, so this is not a range check. No required number of digits is mentioned, so this is not a length check. No specific pattern or arrangement of characters is mentioned, only whether each character is a digit, so this is not a format check. The rule is testing data type alone.

Final answer

The rule described. Rejecting any entry containing a letter or symbol, regardless of its length or size, is a type check, option D.