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.
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
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?
Give two other names for iterative testing.
In iterative testing, how much of the program does the programmer write before testing?
What is each section tested for in iterative testing?
Iterative testing detects an error in a section. When does it get dealt with?
What is integration testing?
Is testing only done once the program is finished?
How should the overall approach to testing be decided?
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 postedMore OCR GCSE Computer Science topics
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.