GRADE 7 · COMPUTING · UNIT 6 · LESSON 6.6
Sequencing and pattern recognition: Getting the message across
Identifying errors and debugging
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Identifying errors and debugging
Debugging locates and corrects errors, then retests against the requirements. A program can fail to parse, fail while running or run with the wrong output sequence. Fixing a syntax error does not prove the whole program is correct.
- Use sequence patterns and a flowchart to locate an incorrect program action.
- Distinguish syntax mistakes from a program that runs but produces the wrong sequence.

Explore the clues
Tap one card to find out more.
Understand the idea
Debugging locates and corrects errors, then retests against the requirements. A program can fail to parse, fail while running or run with the wrong output sequence. Fixing a syntax error does not prove the whole program is correct.
Concept to practise: Identifying errors and debugging.
Work through an example
The supplied faulty sound-triggered starter includes a syntax problem, an incorrect image name and an order error. Compare each repair with the intended flowchart, save a new revision and test the inactive and triggered cases.
Try before your workbook
If a repaired program now starts, what else must you check before claiming that its visual alarm meets the plan?
Check my readiness thinking
Check trigger behaviour, image identity and order, waits, clearing and return to monitoring. The built-in microphone practical requires suitable micro:bit V2 hardware. Keep actual tests separate from predicted traces or controlled test stubs.
Your original programs and learning models
These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.
Find, explain, repair and retest
Testing compares behaviour with requirements. A correction needs a retest: fixing one line does not establish that every other requirement works.
Use a sequence pattern to locate a mismatch
| Position | Required output | Traced faulty output |
|---|---|---|
| 1 | HEART | HEART |
| 2 | DIAMOND | TRIANGLE |
| 3 | TRIANGLE | DIAMOND |
Trace the required sound-response routine
- correct
- Play ENTERTAINER tune
- Wait 500 ms
- Display YES tick
- Wait 2000 ms
- Clear display
- Return
Keep the inactive path clear
Decision: Loud event?
True branch
- correct
False branch
- Clear display
Inspect the original faulty starter
Original program model
from microbit import *
import music
def correct():
display.show(Image.Yes)
sleep(2000)
music.play(music.ENTERTAINER)
sleep(500)
display.clear()
microphone.was_event(SoundEvent.LOUD)
display.clear()
while True:
if microphone.was_event(SoundEvent.LOUD)
correct()
else:
display.clear()
sleep(30)Use a focused debugging checklist
| Area | What to inspect |
|---|---|
| Imports | Device names imported; music module imported. |
| Brackets and quotes | Calls close correctly; text literals have matching quotes. |
| Colon and indentation | if, while and def use a colon and an indented body. |
| Exact names | Image.YES uses uppercase YES; spelling and case matter. |
| Order and timing | Compare every action and delay with the flowchart. |
| Retest evidence | Use the saved revision; check active and inactive paths. |
Practice files for this lesson
Save a copy of these original PaxaKids learner files before editing in suitable software. Some code and datasets deliberately need completion or repair. Downloading a file does not run it. Use invented data; record actual tests separately from predictions. Native software practice files are not print-optimised; use the student PDF for printing.

Try one step with Paxa!
Use supplied fictional records. Do not disclose personal details, upload private photos or bypass browser warnings to complete an activity. Save personal responses before leaving.
Our Unit 6 learning path
- Lesson 6.1: Prototyping
- Lesson 6.2: Pattern recognition
- Lesson 6.3: Patterns between text-based programming languages
- Lesson 6.4: Boolean selection and sub-routines
- Lesson 6.5: Project plans and test plans
- Lesson 6.6: Identifying errors and debugging
- Lesson 6.7: Sequences and lights
- Lesson 6.8: Creating a moving sequence of lights
- Lesson 6.9: Extending a light sequence
- Lesson 6.10: Light brightness
- Lesson 6.11: Loading-screen and name-sequence extensions
- Lesson 6.12: Final project: Sound-triggered visual alarm
- Lesson 6.13: Evaluation
- Lesson 6.14: What can you do?
For grown-ups: using this lesson
Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.
2. Fill in your workbook
Read the teaching and the complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.
Opening your PDF…
Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.
You’ve completed the checked activities.
TAKE YOUR PRACTICE OFFLINE
3. Download the student worksheet
All 8 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.
Student worksheet only · PDF · 8.2 MiB · No answer key included
TRY FIRST, THEN CHECK TOGETHER
Download the student worksheet →4. Answers & guidance
Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.
Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.
Show answers for all 8 worksheets
Worksheet 1
- Question 1: Which can be a logic error in a program that runs? two valid output actions in the wrong order
- Question 2: What should follow a repair? retest against the requirements
Worksheet 2
- Question 3: At which position does the first mismatch occur? 2
- Question 4: What repair matches the required sequence? exchange the second and third image actions
Worksheet 3
- Question 5: When does the half-second pause begin? after the tune call completes
Worksheet 4
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 5
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 6
- Question 6: After the missing colon is repaired, Image.Yes is best described as what? a wrong attribute name that can fail when executed
Worksheet 7
- Question 7: Repair DebugProgram_Paxa.py and explain each error and correction. Use the intended routine and main chart to justify the order, waits and inactive behaviour. Give the saved revision. Explain to a partner why debugging and testing matter, what could happen if an untested program were released, and examples of MicroPython mistakes. Record the discussion, or mark it Pending. Add the missing colon after the loud-event condition. Correct Image.Yes to Image.YES. Reorder the routine to play ENTERTAINER, sleep(500), show YES, sleep(2000), clear; retain repeated monitoring and the stated event-history clearing policy. Imports and indentation must remain valid. Explain syntax versus runtime name failure versus valid but wrong sequence. Explain effects of untested defects using relevant examples, without claiming testing guarantees no errors. Saved corrected source and actual partner discussion or Pending. This retains source tasks 1 and 3; no numeric scores. Grown-up review; personal evidence is required.
Worksheet 8
- Question 8: Flash your repaired revision to a micro:bit V2. Apply all three checks using a hand clap and a quiet starting condition. Give expected and actual results, including the exact order and waits, and a justified Pass/Fail or Pending. Record the file, method and any correction/retest. Keep simulator and source checks separate from physical microphone and speaker observations. Check activation by a loud hand clap; complete order is ENTERTAINER tune, then 500 ms wait, YES tick, 2000 ms wait, clear. The tune call completes before the half-second pause begins. Startup and inactive state are clear with no new tune when no loud event is recorded. Use V2 for the built-in microphone/speaker. The original program discards loud-event history at the end of its busy routine to avoid queuing its own sound; claps during that routine are also discarded. Record actual board/USB/audio evidence, or Pending; no fabricated observations. Compare the actual result to the requirement and retain any retest. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing 7 Student’s Book — pages 203–207
- PaxaKids Grade 7 Computing Lesson 6.6: Identifying errors and debugging — pages 1–8
Computing for your homeschool day
Explore Identifying errors and debugging with this free Grade 7 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.
Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.
Understand your results
Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.
For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.
The book pages identify the related teaching topic. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.
Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.
