How are programs tested for correctness, what kinds of error occur, and how are they tracked down?
Testing and correctness: the types of program error (syntax, runtime and logic), test strategies and test data (normal, boundary and erroneous), trace tables and dry runs, and validation and verification of input data.
An Eduqas Component 1 answer on testing and correctness: syntax, runtime and logic errors, choosing normal, boundary and erroneous test data, dry runs with trace tables, and the difference between validation and verification of input.
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 dot point is asking
Eduqas wants you to distinguish the types of error (syntax, runtime, logic), choose appropriate test data (normal, boundary, erroneous), perform a dry run with a trace table, and explain validation and verification of input. Trace-table questions are common and reward careful, row-by-row working.
The answer
The three types of error
Test data and test strategies
Dry runs, trace tables, validation and verification
Examples in context
Every form you fill in online uses validation (a range check on an age, a format check on an email) and often verification (re-enter your email). Trace tables are an exam staple and a real debugging technique when a stepping debugger is not available. The Eduqas project (Component 3) is heavily marked on a thorough test plan with all three data types and evidence of fixing the faults found, so this dot point is as much a project skill as an exam topic. It connects directly to the software development lifecycle in the next module.
Try this
Q1. Classify "dividing by zero while the program runs" as a syntax, runtime or logic error. [1 mark]
- Cue. A runtime error (it occurs during execution and crashes the program).
Q2. For a field accepting ages to , give one boundary value and one erroneous value. [2 marks]
- Cue. Boundary: or (or just outside). Erroneous: or text such as "old".
Q3. State the difference between validation and verification. [2 marks]
- Cue. Validation checks input is reasonable against rules; verification checks input has been entered or transferred accurately.
Exam-style practice questions
Practice questions written in the style of WJEC Eduqas exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Eduqas 20196 marksDistinguish between a syntax error, a runtime error and a logic error, giving an example of each, and explain why a logic error is the hardest to detect.Show worked answer →
Syntax error (up to 2 marks): a breach of the language's grammar rules, caught by the translator before the program runs, for example a missing closing bracket or misspelled keyword.
Runtime error (up to 2 marks): an error that occurs while the program is running, causing it to crash or stop, for example dividing by zero or accessing an array index that does not exist.
Logic error (up to 1 mark): the program runs without crashing but produces the wrong result, for example using + where * was intended.
Hardest to detect (up to 1 mark): a logic error produces no error message and the program appears to work, so it is only found by testing the output against expected values.
Markers reward a correct definition and example for each, and the reason logic errors are hardest (no crash or message, only wrong output).
Eduqas 20215 marksA program accepts an exam mark that must be between and inclusive. Give one example each of normal, boundary and erroneous test data, and explain the difference between validation and verification.Show worked answer →
Test data (up to 3 marks, one each): normal, a typical valid value such as ; boundary, a value at the edge of acceptance such as or (and just outside, such as ); erroneous, an invalid value that should be rejected such as or the text "abc".
Validation versus verification (up to 2 marks): validation checks that input is reasonable and within allowed rules (a range check rejects ); verification checks that input has been entered or transferred accurately (such as a double-entry check or proofreading against the source).
Markers reward a valid example of each test-data category and the rules-versus-accuracy distinction between validation and verification.
Related dot points
- Program construction: the features of an integrated development environment (IDE), modular and structured program design, the use of libraries, and writing maintainable code with sensible naming, comments and indentation.
An Eduqas Component 1 answer on program construction: the features of an integrated development environment (editor, debugger, error diagnostics), modular and structured design, using libraries, and the conventions that make code readable and maintainable.
- Program construction and translators: compilers, interpreters and assemblers and their differences, the distinction between source, object and executable code, and the stages of compilation (lexical analysis, syntax analysis, semantic analysis, code generation and optimisation).
An Eduqas Component 1 answer on translators: how compilers, interpreters and assemblers differ, the distinction between source, object and executable code, and the stages of compilation from lexical analysis through syntax and semantic analysis to code generation and optimisation.
- Programming principles: primitive and composite data types, variables and constants, scope and lifetime, and the three programming constructs of sequence, selection and iteration used to build structured programs.
An Eduqas Component 1 answer on programming principles: the primitive data types, variables versus constants, local versus global scope and lifetime, type conversion, and the three programming constructs sequence, selection and iteration.
- The software development lifecycle: the stages from analysis through design, implementation, testing, installation, evaluation and maintenance, and a comparison of the waterfall and iterative or agile development methodologies.
An Eduqas Component 1 answer on the software development lifecycle: the stages of analysis, design, implementation, testing, installation, evaluation and maintenance, the types of maintenance, and how the waterfall model compares with iterative or agile development.
- Software engineering tools: the tools that support analysis, design, programming and testing, the role of an IDE in the development process, and version (source) control for managing changes and team collaboration.
An Eduqas Component 1 answer on software engineering tools: the tools supporting analysis, design, coding and testing, how an IDE supports development, and why version control manages changes, enables collaboration and allows rollback.
Sources & how we know this
- WJEC Eduqas GCE AS/A Level Computer Science specification (from 2015) — Eduqas (2015)