Coding · Grade 7
Automated Tests, Debugging and Version History
Learners write automated tests with assert and test functions, design test cases from a specification that catch hidden buggy versions, and follow a systematic debugging process (reproduce, isolate, fix, re-test). They finish by using version history (commits, messages, diffs and reverting) to find when a bug appeared and to keep a project safe.
- 4 lessons
- About 85 minutes
- Check what you learned: 8 questions
- Ways to answer: choose an answer, put code in order, trace code, highlight a text, match pairs and put in order
What learners will discover
- Write automated tests with assert and test functions, and predict whether each test passes or fails.
- Design test cases from a specification, including edge cases, that catch likely bugs.
- Apply a systematic debugging process: reproduce, isolate with prints or checks, fix and re-test.
- Explain version history (commits, messages, diffs, reverting) and use it to find when a bug was introduced.
Lessons
-
Tests that run themselves 6 steps3 practiceabout 20 min
-
Designing tests that find bugs 5 steps3 practiceabout 20 min
-
A debugging process 5 steps3 practiceabout 20 min
-
Version history 6 steps3 practiceabout 18 min
-
Check what you learned 8 questions at the end
Keep exploring
Games to practice with
- Bug DetectiveA robot program almost works. Run it, spot the buggy block, and fix it.
- Sorting FactoryTurn a work order into if/else rules and watch the conveyor sort every item.
- Garden AutomationProgram a garden robot with sensor rules — then watch a whole day play out.
More 7th grade coding
- 7th Grade Coding Games4 games to play free
- 7th Grade Coding Worksheets11 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read