Skip to main content
ScotlandComputer ScienceSyllabus dot point

How do we test a program and judge whether it is any good?

Testing with normal, extreme and exceptional test data; the three kinds of error (syntax, execution and logic); and evaluating software for fitness for purpose, efficiency, robustness and readability.

An SQA National 5 Computing Science answer on testing and evaluation, covering the three categories of test data (normal, extreme and exceptional), the three kinds of error (syntax, execution and logic), and the four criteria for evaluating software: fitness for purpose, efficiency, robustness and readability.

Generated by Claude Opus 4.810 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 key area is asking
  2. Testing with the right test data
  3. The three kinds of error
  4. Evaluating the finished program
  5. Why testing and evaluation matter
  6. How this key area is examined
  7. For the official course specification

What this key area is asking

The SQA wants you to test a program with the right kinds of test data, recognise the three kinds of error, and evaluate finished software against the four standard criteria.

Testing with the right test data

Testing is not random poking; it uses chosen data designed to catch problems.

Using all three categories gives confidence the program is correct. Normal data shows it works in ordinary use; extreme data catches off-by-one errors at the boundaries; exceptional data checks the program does not crash or misbehave on bad input, which is what input validation is for.

The three kinds of error

The crucial distinction: a syntax error stops the program before it runs, an execution error stops it part-way through, and a logic error does not stop it at all but gives incorrect output. Logic errors are the hardest to find because nothing visibly breaks; you only notice the answer is wrong.

Evaluating the finished program

After testing, the developer evaluates the software against four criteria.

Fitness for purpose links straight back to analysis: the functional requirements written then are the checklist now. Robustness links to testing with exceptional data and to input validation. Readability is about the code itself - meaningful variable names, internal comments and consistent indentation make a program easier to maintain.

Why testing and evaluation matter

Testing finds errors before users do; evaluation judges whether the finished product is actually good. Together they close the development process: testing checks the program works, and evaluation checks it meets its purpose well. Both feed the iterative loop - a failed test or a poor evaluation sends the developer back to fix the code.

How this key area is examined

Questions ask you to give examples of normal, extreme and exceptional test data for a stated range, identify or describe a syntax, execution or logic error, or evaluate a program against fitness for purpose, efficiency, robustness or readability. For test data, place each example in the correct category. For errors, state whether the program will not run, crashes, or gives a wrong answer. For evaluation, name the criterion and say what it means for this program.

For the official course specification

The SQA publishes the full National 5 Computing Science course specification, specimen question papers and coursework tasks at sqa.org.uk. Always revise from the current specification and SQA past papers, because question style and terminology are board-specific.

Exam-style practice questions

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

SQA N5 style3 marksA program accepts a percentage mark from 0 to 100. Give one example each of normal, extreme and exceptional test data for it.
Show worked answer →

Three marks, one for each correctly categorised example.

Normal: any value comfortably inside the range, for example 57. Normal data is typical valid input.

Extreme: a value at the boundary of the valid range, for example 0 or 100. Extreme data checks the limits.

Exceptional: a value that should be rejected, for example -5, 150 or "abc". Exceptional data is invalid and tests that the program copes.

Markers reward picking a value in the correct category. A common error is giving another normal value when asked for extreme; extreme means the boundary, not just a different valid number.

SQA N5 style4 marksDescribe the difference between a syntax error and a logic error, giving an example of each.
Show worked answer →

Two marks per error: a description and an example.

Syntax error: a mistake in the rules (grammar) of the language, so the program will not run or translate. Example: a missing bracket or a misspelled keyword such as "pint" instead of "print".

Logic error: the program runs without crashing but gives the wrong result because the algorithm is wrong. Example: using a plus where a minus was needed, so an average comes out wrong.

Markers reward making clear that a syntax error stops the program running while a logic error lets it run but produces incorrect output, each with a sensible example.

Related dot points

Sources & how we know this