← IGCSE Computer Science Paper 2

The testing stage

The final PDLC stage: run the finished program with test data, compare results with expected results, check every requirement is met, and send any errors back to coding.

Understanding The testing stage in IGCSE Computer Science Paper 2

What it does: Testing comes last in the PDLC order, after the program has been written in the coding stage. Each test case has an expected output. If the actual output is different from the expected output, there is an error. Testing must check each requirement. A program that runs but misses a requirement has not passed testing. The test shows a requirement is not met. The program goes back to coding to fix the calculation.

Common mistakes: The actual result equals the expected result, so the test has passed. The line should be OUTPUT "Test passed". An IF statement must have THEN at the end of the condition. It should be IF Errors > 0 THEN.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 17–26) and word search (Modules 1–26).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which statement describes the testing stage of the program development life cycle?
The programmer writes the first lines of code for the programThe finished program is run with test data to check it works and meets the requirements
Matches
The program is tested only on one line of code, so it must work
↓
Testing means running the whole finished program, not just one part. Other parts could still contain errors.
Applying
Meanings
Term
Testing stage
Meaning
The final PDLC stage: run the finished program with test data, compare results with expected results, check every requirement is met, and send any errors back to coding.
Practice
// Testing stage: compare results
Testing
Gaps
// The final stage of the PDLC is
Check Answer
Spots
3IF Actual = Expected THEN
4 OUTPUT "Test failed"

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Octopus' badge — Multi-Tasker, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which statement describes the testing stage of the program development life cycle?
A. The programmer writes the first lines of code for the program
B. The finished program is run with test data to check it works and meets the requirements ✓
Testing is the final stage. The program is run with test data, and the results show whether it works correctly and meets the requirements.
2. During the testing stage, what is the actual output of the program compared with?
A. The expected output ✓
B. The programmer's comments
Each test case has an expected output. If the actual output is different from the expected output, there is an error.
3. A tester runs the program and the actual output does not match the expected output. What happens next?
A. The program is accepted because it ran without crashing
B. The error goes back to the coding stage to be fixed ✓
Errors found in testing are sent back to the coding stage. The programmer fixes them and the program is tested again.
4. Which is the best description of what the tester checks against?
A. Every requirement from the analysis stage is met ✓
B. Only the requirements that are easy to test
Testing must check each requirement. A program that runs but misses a requirement has not passed testing.
5. True or false: in the testing stage, the whole finished program is run.
A. True: the complete program is run with test data ✓
B. False: only single lines of code are ever run
Small parts are tested while coding. In the testing stage the finished program is run as a whole.

Match the Pairs

Expected result: 45, Actual result: 54 → The results do not match, so an error has been found and must be fixed
Requirement: Accept marks from 0 to 100. Test: enter 101 and check it is rejected → Checking that a requirement is met by running the program with test data
Testing is the final stage of the PDLC, where the finished program is run to see if it works correctly → Analysis -> Design -> Coding -> Testing
When testing finds an error, the program goes back to the coding stage to be fixed and then tested again → Testing -> error found -> Coding -> Testing
The program is tested only on one line of code, so it must work → Testing means running the whole finished program, not just one part. Other parts could still contain errors.
Test result is different from expected, so skip it and move on to the next stage → Errors found in testing must go back to coding to be fixed. There is no stage after testing to hide them in.

Key Term

Testing stage
The final PDLC stage: run the finished program with test data, compare results with expected results, check every requirement is met, and send any errors back to coding.

Fill in the Blanks

1. // The final stage of the PDLC is testing
Hint: Type the name of the last PDLC stage, where the finished program is run with test data.
2. IF Actual = Expected THEN OUTPUT "Pass" ENDIF
Hint: Type the relational operator that checks the actual result is equal to the expected result.
3. IF Actual <> Expected THEN OUTPUT "Fail" ENDIF
Hint: Type the relational operator that means the two results are not equal, so an error has been found.
4. IF RequirementsMet = TRUE THEN OUTPUT "Testing complete" ENDIF
Hint: Type the BOOLEAN value that shows every requirement has been met.
5. OUTPUT "Errors found: return to coding"
Hint: Type the name of the stage that errors found in testing are sent back to.

Spot the Error

Question 1
A Expected ← 10
B Actual ← 5 * 2
C IF Actual = Expected THEN
D OUTPUT "Test failed"
E ENDIF
Line D — The actual result equals the expected result, so the test has passed. The line should be OUTPUT "Test passed".
Question 2
A PassedAll ← TRUE
B Errors ← 1
C IF Errors > 0
D PassedAll ← FALSE
E ENDIF
Line C — An IF statement must have THEN at the end of the condition. It should be IF Errors > 0 THEN.
Question 3
A Expected ← 7
B Actual = 3 + 4
C OUTPUT "Expected: ", Expected
D OUTPUT "Actual: ", Actual
Line B — Cambridge pseudocode stores a value in a variable with the assignment arrow ←, not =. It should be Actual ← 3 + 4.
Question 4
A DECLARE Expected : STRING
B Expected ← 12
C Actual ← 3 * 4
Line A — Expected stores the whole number 12, so it must be declared as INTEGER, not STRING.
Question 5
A Errors ← 2
B IF Errors > 0 THEN
C OUTPUT "Go to design"
D ELSE
E OUTPUT "Testing complete"
F ENDIF
Line C — When testing finds errors, the program goes back to the coding stage to be fixed. The line should be OUTPUT "Return to coding".

Student with a class code? Join your class →