Skip to main content
Northern IrelandSoftware Systems DevelopmentSyllabus dot point

How is input validated, and how is a program tested with well-chosen test data to find errors?

Validation techniques, test data categories (normal, boundary and erroneous), test plans, and the types of program error (syntax, run-time and logic).

A CCEA A-Level Software Systems Development answer on validation techniques, choosing normal, boundary and erroneous test data, building a test plan, and distinguishing syntax, run-time and logic errors.

Generated by Claude Opus 4.812 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Examples in context
  4. Try this

What this dot point is asking

CCEA expects you to apply validation to inputs, design test data in the three standard categories (normal, boundary, erroneous), build a test plan, and distinguish the three types of error (syntax, run-time, logic). You must explain the purpose of each test category and recognise that validation checks input is sensible, not that it is correct. These ideas reappear in AS 2 testing and in the A2 project, so learn the definitions precisely.

The answer

Validation

Common validation checks include:

  • Range check: the value lies between a minimum and maximum (a mark 0 to 100).
  • Type / data check: the value is of the expected type (a number, not text).
  • Presence check: a required field is not left blank.
  • Length check: a string has an acceptable number of characters (a password of 8 or more).
  • Format / pattern check: the value matches a required pattern (a postcode or email shape).
  • Lookup / list check: the value is one of a set of allowed values (a valid subject code).

Test data categories

Test plans and error types

A test plan is a table prepared in advance listing each test: a description, the test data, the expected result and (after running) the actual result. It gives systematic, repeatable evidence that the program meets its requirements.

The three types of error:

  • Syntax error: breaks the language rules; the program will not translate or run (a missing bracket, a misspelt keyword). Caught by the translator.
  • Run-time error: occurs during execution and stops the program (dividing by zero, an out-of-bounds index, a missing file).
  • Logic error: the program runs but gives the wrong result, because the algorithm or a condition is incorrect (using > instead of >=). The hardest to find, because nothing crashes.

Worked example: a test plan for a range check

Examples in context

Example 1. An online registration form. A range check confirms the age is 13 or over, a presence check ensures the email is not blank, a format check tests the email pattern, and a length check requires a password of at least eight characters. The form is then tested with normal data (a typical sign-up), boundary data (exactly 13, exactly 7 characters) and erroneous data (age 200, a blank email) to prove each check works.

Example 2. A grade calculator with a logic error. The code reads marks and prints a grade but uses if mark > 70 then "A". A mark of exactly 70 is wrongly given the next grade down, a logic error: no crash, no syntax fault, just a wrong result. A boundary test of 70 against the expected "A" catches it, where normal data alone would not.

Try this

Q1. State the difference between validation and verification. [2 marks]

  • Cue. Validation checks input is sensible and within limits; verification checks it has been entered or transferred accurately.

Q2. A field accepts a percentage from 0 to 100. Give one boundary test value and one erroneous test value. [2 marks]

  • Cue. Boundary: 0 or 100 (or 101/-1 just outside); erroneous: 150 or a letter such as "x".

Q3. Name the type of error that causes a program to compile and run but produce the wrong output. [1 mark]

  • Cue. A logic error.

Exam-style practice questions

Practice questions written in the style of CCEA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

CCEA 20196 marksA field accepts an exam mark from 0 to 100. Describe three categories of test data you would use, giving an example value for each, and explain the purpose of each category.
Show worked answer →

The three categories are normal (valid), boundary (extreme) and erroneous (invalid) data.

Normal data is typical valid input that the field should accept, for example 57. Its purpose is to check the program works correctly for ordinary cases.

Boundary data lies at the edges of the valid range, for example 0 and 100 (the lowest and highest acceptable marks), and the values just outside, such as -1 and 101. Its purpose is to check the program handles the limits correctly, because boundary conditions are where off-by-one errors hide.

Erroneous data is invalid input that should be rejected, for example 150, -20, or a letter such as "x". Its purpose is to check the program detects and handles bad input gracefully, with a sensible error message, rather than crashing or storing nonsense.

Markers reward correctly naming all three categories, a sensible example value for each within the 0 to 100 context, and a clear purpose statement for each.

CCEA 20215 marksDistinguish between a syntax error, a run-time error and a logic error, giving an example of each.
Show worked answer →

A syntax error breaks the rules of the programming language, so the program will not compile or run. An example is a missing bracket or a misspelt keyword such as pritn instead of print. The translator detects it before execution.

A run-time error occurs while the program is running and causes it to stop or crash, even though the syntax is correct. An example is dividing by zero, accessing an array index that is out of bounds, or trying to open a file that does not exist.

A logic error means the program runs without crashing but produces the wrong result, because the algorithm or a condition is incorrect. An example is using + where * was intended, or testing > 40 when >= 40 was meant, so a pass mark of exactly 40 is wrongly failed.

Markers reward a correct definition and a valid example for each of the three error types, and the key contrast that syntax errors stop translation, run-time errors crash a running program, and logic errors give wrong but uncrashed output.

Related dot points

Sources & how we know this