Subroutines make programs easier to test and read
A program split into small named subroutines. Each one can be tested alone and read quickly, so errors are easier to find and the whole program is easier to understand.
Understanding Subroutines make programs easier to test and read in IGCSE Computer Science Paper 2
What it does: The name IsPassMark tells the reader what the function does, which makes the program easier to read. Each line is one named step, so the whole program can be understood at a glance. Testing one small subroutine alone narrows the search for a bug to that subroutine only, instead of the whole program. A short main program made of subroutine calls reads like a list of steps, so the overall plan is clear at a glance. Each programmer can write and test their own subroutines separately, then the parts are combined in the main program. If the subroutine is tested alone and gives the wrong answer, the error must be inside it, so there is far less code to check.
Common mistakes: Testing Half on its own with the input 10 should give 5, but N * 2 gives 20. Because the function is small and separate, the fault is easy to find. The line should be RETURN N / 2. The main program is a list of steps, and each step must start with CALL to run a procedure. Line 2 should be CALL FindAverage().
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 439–448) and word search (Modules 439–458).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
modular programFill in the Blanks
Spot the Error
Student with a class code? Join your class →