OCR · GCSE · Computer Science
Overview guide · Check your current course specification before revising.
Testing and Evaluation
Testing and Evaluation (3.4) is a critical component of the OCR GCSE Computer Science specification, focusing on the systematic validation of software through test data selection, trace table execution, and error identification. This topic assesses your ability to distinguish between Normal, Boundary, and Erroneous test data, execute trace tables to identify logic errors, and differentiate between iterative testing during development and final testing after implementation. Mastering this topic is essential because it directly applies to real-world software development and is heavily tested across multiple question formats in the exam.
- 11 min read
- 4 worked examples
- 6 practice questions
- 9 key terms
Study Notes
Overview
Testing and Evaluation is where Computer Science theory meets practical software development. Every application you use daily—from social media platforms to banking apps—has undergone rigorous testing to ensure it functions correctly, handles unexpected inputs gracefully, and meets user requirements. In the OCR GCSE specification, this topic assesses your understanding of how programmers systematically validate their code through test data selection, trace table execution, and error identification. You will encounter questions requiring you to select appropriate test data (Normal, Boundary, Erroneous), complete trace tables to track variable values through pseudocode execution, distinguish between syntax and logic errors, and explain the difference between iterative and final testing. Typical exam questions include providing test data with justifications (2-4 marks), completing trace tables (4-6 marks), identifying errors in code (2-3 marks), and explaining testing strategies (3-4 marks). This topic is assessed across AO1 (30%), AO2 (50%), and AO3 (20%), meaning you need both theoretical knowledge and the ability to apply it to unfamiliar scenarios.
Key Concepts
Concept 1: Types of Test Data
When testing a program, candidates must select test data that systematically validates different aspects of the software's behaviour. There are three distinct categories of test data, each serving a specific purpose in the testing process.
Normal Data represents typical, valid inputs that the program should accept and process correctly under standard operating conditions. For example, if a program validates ages between 1 and 100, normal data might include values such as 25, 50, or 73. Normal data confirms that the program functions correctly under everyday usage scenarios. Examiners award marks for identifying normal data that falls comfortably within the valid range and demonstrating that the program handles it without errors.
Boundary Data is the most frequently misunderstood category. Boundary data consists of values at the exact limits of the valid range—the extreme valid values that are still acceptable. This is crucial: boundary data is NOT data outside the valid range. For a range of 1 to 100, the boundary values are 1 and 100, not 0 or 101. Boundary testing is essential because errors often occur at the edges of acceptable input ranges, particularly when programmers use incorrect comparison operators (e.g., using < instead of <=). OCR examiners are extremely precise about this distinction, and candidates lose marks every year by confusing boundary data with erroneous data.
Erroneous Data (also called invalid or abnormal data) consists of inputs that the program should reject because they fall outside the valid range or are of the wrong data type. For the age example, erroneous data might include -5 (negative value), 150 (exceeds maximum), or "hello" (wrong data type). Erroneous data tests whether a program is robust—meaning it can handle unexpected or incorrect inputs gracefully without crashing, by validating inputs, displaying appropriate error messages, and continuing to function.
Example: For a program that accepts exam scores between 0 and 100:
- Normal Data: 45, 67, 82 (typical valid scores)
- Boundary Data: 0, 100 (extreme valid limits)
- Erroneous Data: -10, 150, "ninety" (invalid inputs)
Open full-size image (opens in a new tab)
Concept 2: Trace Tables
A trace table is a systematic tool used to manually simulate program execution by tracking the values of variables as each line of code is executed. Trace tables are invaluable for identifying logic errors—errors where the program runs without crashing but produces incorrect output.
When completing a trace table, candidates must work methodically through the pseudocode, updating variable values only when an assignment statement is executed. The golden rule is: do not anticipate changes. Only update a variable when the line of code that explicitly assigns a new value to that variable is reached. Many students lose marks by updating values prematurely or in the wrong row.
Trace tables typically include columns for line numbers, variable names, and output. As you step through the code, you record the current value of each variable after each assignment or modification. Conditional statements (IF, WHILE) determine which lines execute, and loops require you to trace through multiple iterations, updating values each time.
Example: Consider this pseudocode:
1 total = 0
2 counter = 1
3 WHILE counter <= 3
4 total = total + counter
5 counter = counter + 1
6 ENDWHILE
7 OUTPUT total
The trace table would be:
| Line | total | counter | Output |
|---|---|---|---|
| 1 | 0 | ||
| 2 | 0 | 1 | |
| 3 | 0 | 1 | |
| 4 | 1 | 1 | |
| 5 | 1 | 2 | |
| 3 | 1 | 2 | |
| 4 | 3 | 2 | |
| 5 | 3 | 3 | |
| 3 | 3 | 3 | |
| 4 | 6 | 3 | |
| 5 | 6 | 4 | |
| 3 | 6 | 4 | |
| 7 | 6 | 4 | 6 |
Notice how the loop condition (line 3) is checked multiple times, and values are only updated when assignment statements (lines 4 and 5) are executed.
Concept 3: Types of Errors
Programmers encounter different categories of errors during software development, and distinguishing between them is essential for effective debugging.
Syntax Errors are grammatical violations in the code that prevent the program from compiling or running. Examples include missing brackets, misspelled keywords, incorrect indentation (in Python), or using undefined variables. Syntax errors are detected by the compiler or interpreter before the program executes, and they must be fixed before the program can run. The error message typically indicates the line number and nature of the syntax violation.
Logic Errors occur when the program runs without crashing but produces incorrect or unexpected output. The code is syntactically correct, but the algorithm or logic is flawed. Examples include using the wrong comparison operator (e.g., < instead of <=), incorrect calculation formulas, or loops that iterate one too many or too few times. Logic errors are more difficult to identify because the program appears to work, but the results are wrong. Trace tables are an excellent tool for identifying logic errors by revealing where variable values deviate from expected values.
Runtime Errors occur during program execution and cause the program to crash or terminate unexpectedly. Examples include division by zero, attempting to access an array index that doesn't exist, or running out of memory. While runtime errors are not explicitly part of the OCR GCSE specification's Testing and Evaluation section, understanding them helps distinguish between errors that stop execution (syntax and runtime) and those that produce incorrect output (logic).
Example:
- Syntax Error:
IF age > 18(missing THEN keyword in pseudocode) - Logic Error:
IF age > 18 THEN OUTPUT "Adult"(should be >= 18 to include 18-year-olds) - Runtime Error:
result = 10 / 0(division by zero)
Concept 4: Iterative vs Final Testing
OCR distinguishes between two fundamental testing strategies based on when and how testing occurs during the software development lifecycle.
Iterative Testing (also called modular or unit testing) occurs during the development phase. Programmers test individual modules, subroutines, or components as they are coded, before integrating them into the complete system. Iterative testing is continuous and cyclical—code a module, test it, fix errors, code the next module, test it, and so on. This approach allows developers to identify and fix errors early, when they are easier and cheaper to correct. Iterative testing focuses on ensuring that each individual component works correctly in isolation.
Final Testing (also called system or acceptance testing) occurs after implementation, when the entire system is complete. Final testing evaluates the whole program as an integrated system, checking that all modules work together correctly, that the software meets the original requirements, and that it performs as expected in realistic usage scenarios. Final testing often involves end users or clients testing the software to ensure it meets their needs.
The key distinction for OCR exams is the timing and scope: iterative testing is "during development, module by module," while final testing is "after implementation, on the whole system." These exact phrases are essential for earning full marks.
Open full-size image (opens in a new tab)
Concept 5: Robust Programs
A robust program is one that can handle erroneous and unexpected inputs without crashing or producing nonsensical output. Robustness is achieved through input validation, error handling, and defensive programming techniques.
Input validation checks that user inputs meet specified criteria before processing them. This might include checking data types (e.g., ensuring a number is entered when expected), range checking (e.g., ensuring an age is between 0 and 120), presence checks (e.g., ensuring a required field is not empty), and format checks (e.g., ensuring an email address contains an @ symbol).
When invalid input is detected, a robust program should display a clear, user-friendly error message explaining what went wrong and what the user should do, then allow the user to re-enter the data rather than crashing or proceeding with invalid data.
Example: A robust program asking for an age might include:
REPEAT
OUTPUT "Enter your age (0-120): "
INPUT age
IF age < 0 OR age > 120 THEN
OUTPUT "Error: Age must be between 0 and 120. Please try again."
ENDIF
UNTIL age >= 0 AND age <= 120
This ensures that only valid ages are accepted, and the user receives clear feedback if their input is invalid.
Practical Applications
Testing and Evaluation principles are fundamental to all real-world software development. Professional developers use automated testing frameworks (such as JUnit for Java or pytest for Python) to systematically test their code with thousands of test cases, including normal, boundary, and erroneous data. Companies like Google, Microsoft, and Amazon employ dedicated testing teams who design comprehensive test plans, execute tests, and identify bugs before software is released to users.
In safety-critical systems—such as medical devices, aircraft control systems, and automotive software—rigorous testing is legally required and can mean the difference between life and death. The Therac-25 radiation therapy machine, for example, caused several deaths in the 1980s due to inadequate testing that failed to identify a critical logic error.
When you develop your own programs for the OCR GCSE coursework (Programming Project), you must demonstrate systematic testing by providing test plans with normal, boundary, and erroneous data, documenting expected vs actual results, and explaining how you identified and fixed errors. This practical application of Testing and Evaluation principles is worth significant marks in the coursework assessment.
Listen to the Podcast
Listen to this 10-minute podcast episode for a comprehensive audio review of Testing and Evaluation, including exam tips, common mistakes, and a quick-fire recall quiz to test your knowledge.
Check what you remember
Read the wording for your board, then hide it and explain Normal Data in your own words. Rough notes are fine. This is a self-check, with no mark or grade.
Reference: OCR
Valid input that falls within the expected range or meets the specified criteria, representing typical usage that the program should accept and process correctly without errors.
Interactive Diagrams
2 interactive diagrams to visualise key concepts
Conceptual Flow Outline
Testing Process Flowchart - This diagram shows the systematic approach to testing software, from selecting appropriate test data through to identifying and fixing errors. Notice how different test data types lead to the same execution process, and how error identification branches based on error type.
Conceptual Flow Outline
Software Development Lifecycle with Testing Strategies - This diagram illustrates where iterative testing (during the implementation phase, module by module) and final testing (after implementation, on the whole system) occur in the software development process. The dotted lines show the cyclical nature of iterative testing and the linear nature of final testing.
Worked Examples
4 worked examples — open one to explore the question and available guidance.
Practice Questions
Try the question, then reveal an answer plan or example response
A program asks users to enter their year of birth, which must be between 1900 and 2024. Give one example of boundary data that could be used to test this program. [1 mark]
Hint: Boundary data is at the exact limit of the valid range—the extreme values that are still acceptable.
Explain why trace tables are useful for identifying logic errors. [3 marks]
Hint: Think about what trace tables show you and how this helps you see where the program's logic goes wrong.
A company is developing a new online shopping system. The development team tests each module (such as the shopping cart, payment processing, and user account management) as they code it. After all modules are complete, the entire system is tested with real users. Identify and explain the two types of testing described. [4 marks]
Hint: Look for keywords about timing (when testing occurs) and scope (what is being tested).
Complete the trace table for the following pseudocode when the input is 3. [4 marks]
1 INPUT num
2 total = 0
3 FOR i = 1 TO num
4 total = total + (i * 2)
5 NEXT i
6 OUTPUT total
Hint: Track each variable carefully through each iteration of the loop. Remember that i increases by 1 each time through the FOR loop.
A program asks users to enter a percentage score (0-100). The programmer wants to ensure the program is robust. Describe two validation checks the programmer could implement and explain why each check is necessary. [4 marks]
Hint: Think about what could go wrong with user input - what types of erroneous data might be entered?
A programmer has written code that runs without error messages but produces incorrect results. Identify the type of error and explain how the programmer could identify the specific line where the error occurs. [3 marks]
Hint: If the program runs but gives wrong results, what type of error is that? What tool helps you track values line by line?
Ready to test yourself interactively?
Active recall beats reading alone. Answer questions on Testing and Evaluation with instant AI scoring and mark scheme guidance.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge
Exam technique
How to turn what you know into marks
How to approach the question
For test data questions: (1) Identify the valid range or criteria, (2) Select one value comfortably within the range (Normal), (3) Select the exact minimum and/or maximum valid values (Boundary), (4) Select values outside the range or wrong data type (Erroneous), (5) Always state the value AND the category. For trace table questions: (1) Draw the table with columns for line number and each variable, (2) Use a ruler to track your current line, (3) Work through each line sequentially, (4) Only update variables when assignment statements execute, (5) Check loop conditions carefully, (6) Double-check your final output. For error identification questions: (1) Read the code carefully, (2) Identify what the code is supposed to do, (3) Trace through with a simple input to see where it goes wrong, (4) Classify the error type (syntax/logic) based on whether it prevents execution or produces wrong output.
How to structure your answer
For 2-mark questions: Provide a clear definition or example with one supporting point. For 4-mark questions: Provide two distinct points, each with explanation or justification (2+2 structure). For 6-mark questions: Provide three distinct points with detailed explanation (2+2+2 structure) OR two points with extensive detail and examples (3+3 structure). Always use technical terminology from the specification.
Timing
Approximately 1 minute per mark. A 4-mark question should take about 4-5 minutes. For trace tables, allow slightly more time (1.5 minutes per mark) due to the detailed work required.
Common pitfalls
- Confusing boundary data with erroneous data—remember boundary values are still valid, at the extreme edges of the acceptable range
- Updating trace table variables prematurely or in the wrong row—only update when an assignment statement is executed
- Describing logic errors as causing crashes—logic errors produce incorrect output, not crashes (that's a runtime error)
- Vague definitions of robust programs—must specifically mention handling erroneous/unexpected inputs without crashing
- Failing to provide both the test value AND the category when asked for test data—always state '5 - Normal data' not just '5'
- Not showing working in trace tables—examiners award marks for correct intermediate values, not just the final output
What the command words want
- Compare
- Identify similarities AND differences - use comparative language like 'whereas', 'in contrast', 'both', 'however'. Example: 'Compare iterative and final testing' → 'Iterative testing occurs during development on individual modules, whereas final testing occurs after implementation on the whole system'
- Explain
- Say HOW or WHY - provide reasoning, causes, or consequences. Use 'because', 'therefore', 'this means that' to link cause and effect. Usually 2 marks per point. Example: 'Explain why boundary data is important' → 'Boundary data tests the extreme limits of valid input because errors often occur at the edges of acceptable ranges when incorrect comparison operators are used'
- Describe
- Say what happens or what something is like - provide characteristics, features, or steps. Use correct terminology. Usually 2 marks per point. Example: 'Describe normal data' → 'Normal data is valid input within the expected range that the program should accept and process correctly'
- Evaluate
- Consider both sides, use evidence, make a judgement. Not common in Testing and Evaluation questions, but if asked to evaluate a testing strategy, discuss advantages, disadvantages, and suitability for the context
- Calculate
- Not typically applicable to Testing and Evaluation, but if asked to calculate output from a trace table, show each step of working clearly
- State/Give
- Brief factual answer - provide the specific value, term, or fact requested. Usually 1 mark per point. Example: 'State one type of test data' → 'Boundary data'
Test your understanding of Testing and Evaluation
Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge