Sequence 4 - Lesson 6: Debugging
Learning Intention
- I can test and debug my programs
Start with the script below taken from Lesson 5. Ask children to predict what the code will do when it runs. Focus on the last block and explain that it should say the callers name.
Ask children to observe what Picoh does closely when the code runs. Run the script. What does Picoh actually do?
How does it differ from what we want?
Model going through the code line by line. Ask children to explain line by line in pairs describing what each block
does.
Get children to work in pairs to come up with possible solutions to make Picoh respond to the answer.
Run children’s code suggestions.
Explain that they can adopt this approach to debugging their own code.
Activity
Children open up Picoh projects they have written this term. Which work and which could be improved? Can they
debug their programs to fix them?
Extension
Can children add extra code to their programs to improve them?
Plenary
Evaluation of the Picoh project. Children to complete the following feedback.
How does it differ from what we want?
Model going through the code line by line. Ask children to explain line by line in pairs describing what each block
does.
Get children to work in pairs to come up with possible solutions to make Picoh respond to the answer.
Run children’s code suggestions.
Explain that they can adopt this approach to debugging their own code.
Activity
Children open up Picoh projects they have written this term. Which work and which could be improved? Can they
debug their programs to fix them?
Extension
Can children add extra code to their programs to improve them?
Plenary
Evaluation of the Picoh project. Children to complete the following feedback.