Coding · Grade 9
Testing, Debugging and Edge Cases
Learners design tests with equivalence partitions and boundary value analysis, build edge-case checklists for collections and text, and write test suites that catch hidden buggy versions of real functions. They debug as an investigation (reproduce, hypothesise, predict, fix, regression-test) and use assertions and automated tests to make programs check themselves, while keeping validation for user input.
- 4 lessons
- About 90 minutes
- Check what you learned: 8 questions
- Ways to answer: choose an answer, put code in order, trace code, match pairs, type a number and put in order
What learners will discover
- Design test cases with equivalence partitions and boundary values, with expected outputs taken from the specification.
- Identify edge cases for collections and text and use them to expose bugs.
- Debug systematically by reproducing a failure, forming and testing hypotheses, fixing and adding regression tests.
- Use assertions and automated tests to check a program's own guarantees, and distinguish them from input validation.
Lessons
-
Partitions and boundaries 6 steps3 practiceabout 22 min
-
Edge cases in data 5 steps3 practiceabout 20 min
-
Debugging as an investigation 5 steps3 practiceabout 20 min
-
Assertions and automated tests 5 steps3 practiceabout 20 min
-
Check what you learned 8 questions at the end
Keep exploring
More 9th grade coding
- 9th Grade Coding Worksheets10 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read