Skip to content
PlayOwl

Coding · Grade 2

Debug and Test Cases

Second graders write test cases (an input and the expected result worked out by hand), run programs to compare actual and expected results, discover that a single passing test can hide a bug, and use a failing test with a trace to find, fix and re-test.

  • 3 lessons
  • About 70 minutes
  • Testing and debugging check: 8 questions
  • Ways to answer: fill in the blanks, program with blocks, choose an answer, trace code, highlight a text and match pairs
See plans Included with Family, Teacher and School plans. Open in PlayOwl

What learners will discover

  • Write a test case: an input and the expected result, worked out by hand.
  • Run test cases and decide pass or fail by comparing the actual result with the expected result.
  • Use a failing test and a trace to find a bug, fix it, and re-run every test.

Lessons

  1. What is a test case? 4 steps2 practiceabout 14 min
  2. Pass or fail? 5 steps3 practiceabout 15 min
  3. Find, fix, re-test 5 steps3 practiceabout 16 min
  4. Testing and debugging check 8 questions at the end

Keep exploring

Games to practice with

More 2nd grade coding

Guide for grown-ups