Judging what code does from runtime input and output evidence
Running unfamiliar code with chosen inputs and recording the outputs to infer what it does without reading the source. The evidence only covers the inputs you tried.
Understanding Judging what code does from runtime input and output evidence in QCE Digital Solutions Unit 1
What it does: An input-output table is how black-box evidence is recorded. The pairs 2 to 8 and 3 to 27 suggest the code cubes its input. The inference matches the evidence, but a good tester states what was not covered. Untested inputs could behave differently. Black-box testing builds evidence from real runs. A name alone is not evidence of behaviour. The pattern suggests squaring, but the evidence only covers the inputs you tried. Test zero, negatives and decimals before claiming more. Choose inputs that could break your current theory. Repeating a tested input adds no new information. Black-box testing looks only at inputs and outputs. The inner workings stay hidden, so you infer the process.
Common mistakes: Each test must run mystery() on one input at a time. Passing the whole list tests mixes every input together. It should be mystery(x) so each input has its own output. The table should map each input to its output. Here the key and value are swapped, so the evidence is recorded backwards. It should be results[x] = out.
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 158–380) and word search (Modules 82–380).
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
black-box testingFill in the Blanks
Spot the Error
Student with a class code? Join your class →