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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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
- The iterative software development process: analysis, design, implementation, testing, documentation and evaluation, and why the process is iterative rather than strictly linear.
An SQA National 5 Computing Science answer on the software development process, covering the six stages of analysis, design, implementation, testing, documentation and evaluation, what is produced at each stage, and why the process is iterative so that developers loop back to earlier stages when problems are found.
- Computational constructs: assignment, arithmetic, comparison and logical operators, concatenation, predefined functions, and the control structures of selection and iteration (fixed and conditional).
An SQA National 5 Computing Science answer on computational constructs, covering assignment, arithmetic, comparison and logical operators, string concatenation, predefined functions, and the control structures of selection (IF) and iteration (fixed and conditional loops) used to build programs in a high-level language.
- Standard algorithms: input validation, running total within a loop, and traversing a 1-D array, each as a reusable pattern built from selection and iteration.
An SQA National 5 Computing Science answer on the three standard algorithms, covering input validation with a conditional loop, keeping a running total inside a loop, and traversing a one-dimensional array with a fixed loop, with worked code-style examples of each reusable pattern.
- Analysis: identifying the purpose, scope and boundaries of a problem and writing functional requirements in terms of inputs, processes and outputs.
An SQA National 5 Computing Science answer on the analysis stage of software development, covering how to identify the purpose, scope and boundaries of a problem and how to write functional requirements in terms of the inputs, processes and outputs a finished program must provide.
- Design techniques: representing a program design with structure diagrams, flowcharts and pseudocode, and designing the user interface with a wireframe.
An SQA National 5 Computing Science answer on design techniques, covering how developers plan a program using structure diagrams, flowcharts and pseudocode, how to read and write each notation, and how a wireframe is used to design the layout of a user interface before coding begins.