GCSE · Computer Science · OCR · Spec J277

Iterative testing

Picture writing a whole program, running it for the first time, and watching it crash. Where's the bug? Could be anywhere. Testing as you go avoids that.

Build the loop

The iterative testing loop

2 stages are missing. Use the rest of the loop to work out which goes where.

  1. Stage 1: Write one section

    The programmer codes one individual section, or part, of the program. Not the whole thing.

  2. Stage 4: Move on to the next section

    Only now does development of the next section start. It will be tested too, so the loop begins again.

…and stage 4 leads back to stage 1.

Same goal, different target

Iterative or integration?

Iterative testing has a cousin: integration testing. That's when modules that have each already been tested separately get tested together. For each statement, tick the kind of testing it describes. Tick both if it fits both, and neither if it fits neither. Then check.

  • A Iterative testing
  • B Integration testing
  1. Also known as module or unit testing
  2. Tests one section on its own, straight after it's written
  3. Carried out at every stage of development
  4. Tests modules that have already been tested separately, together
  5. Checks that modules are compatible with each other
  6. Checks the code functions as it should
  7. Done just once, when the whole program is finished

What do you reckon?

When does testing actually happen?

Two friends are about to build an app for a school project. Before they write a line of code, they argue about testing.

Which of these is closest to what you'd tell them?
How sure are you?

Your turn

Write it, then mark it

Describe what iterative testing is and how it works. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Don't wait until the whole program is finished to find out it's broken. Test each piece as you build it, and fix it before you move on.

What you need to know

  • Testing isn't a one-off at the end. It happens throughout the whole development process.
  • Iterative testing means testing carried out at every stage of development.
  • You'll also hear it called module testing or unit testing.
  • The programmer starts by writing one individual section, or part, of the program.
  • Next, that section gets tested to make sure it functions correctly.
  • Have a goA programmer has just finished writing the 'save game' section of a game. Before writing anything else, what should happen next?

    Test the 'save game' section to check it functions correctly.

    It's tempting to crack on with the next feature, but in iterative testing each section is tested straight after it's written, before anything new is added.

  • Errors the test detects are resolved before the next section is developed and tested.
  • Integration testing takes modules that were already tested separately and tests them together.
  • Its job is to check those modules are compatible and function as expected together.
  • Have a goTwo modules each passed their own tests. Your friend grins: 'Sorted, they're guaranteed to work together then.' What would you tell them?

    Not guaranteed. Testing them together is integration testing's job.

    Passing on their own shows each module works alone; whether they're compatible and function as expected together is only checked by testing them together.

  • Testing has specific stages and methods, rather than being one big check.
  • The overall testing approach should be agreed and planned to suit the system's requirements.
  • Have a goA school wants a simple quiz app. A bank wants a payment system. Should both teams copy exactly the same testing approach?

    Not necessarily. Each approach is planned around that system's own requirements.

    One approach for everything sounds efficient, but the testing approach is agreed and planned depending on what each system needs.

The big picture

Testing happens throughout development, not just at the end. Iterative testing (also called module or unit testing) means testing at every stage: the programmer writes one section, tests it to make sure it functions correctly, and resolves any errors detected before the next section is developed and tested. Integration testing is different: modules that have already been tested separately are tested together to check they are compatible and function as expected. There are specific stages and methods of testing, and the overall approach should be agreed and planned to suit the requirements of the system.

Key points

1Testing is carried out throughout development, not only at the end.
2Iterative (module or unit) testing: write a section, test that it functions correctly, resolve errors, then develop the next section.
3Integration testing: modules already tested separately are tested together to check they're compatible and function as expected.
4There are specific stages and methods of testing, and the overall approach is agreed and planned to suit the system's requirements.

Worked example

Problem

Here's an invented developer's diary from building a recipe app, one section at a time. Monday: wrote the 'search' section, tested it, found two errors and fixed them. Tuesday: wrote the 'shopping list' section, tested it, found one error and decided to fix it later. Wednesday: wrote the 'favourites' section, then went straight on to the 'timer' section without testing favourites. Which days followed iterative testing, and what should have happened on the others?

⚠ Watch out

Mixing up iterative and integration testing. Iterative (module or unit) testing checks one section on its own, at every stage of development. Integration testing checks modules that have already been tested separately, together, to make sure they're compatible.

🧠

Memory hook

Write a bit, test a bit, fix a bit, then move on. Bits that pass on their own still get tested together: that's integration.

✓

Check yourself

Cover the page. Say the four stages of the iterative testing loop in order, then explain in one sentence what integration testing checks that iterative testing doesn't.

Flashcards

(8)
What is iterative testing?
Testing carried out at every stage of development.
Give two other names for iterative testing.
Module testing and unit testing.
In iterative testing, how much of the program does the programmer write before testing?
One individual section, or part, of the program.
What is each section tested for in iterative testing?
To make sure it functions correctly.
Iterative testing detects an error in a section. When does it get dealt with?
Straight away: it is resolved before any new section is developed.
What is integration testing?
Testing modules that have already been tested separately together, to check they're compatible and function as expected.
Is testing only done once the program is finished?
No. Testing is carried out throughout the development process, with specific stages and methods.
How should the overall approach to testing be decided?
It should be agreed and planned, depending on the requirements of the system.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More OCR GCSE Computer Science topics

See the full OCR Computer Science curriculum →

How this lesson was checked. This OCR GCSE Computer Science (specification J277)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 3 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.