Lesson 7: Debugging Unplugged: Relay Programming

Unplugged | Relay Programming | Algorithms

Overview

This activity will begin with a short review of "Graph Paper Programming," then will quickly move to a race against the clock, as students break into teams and work together to write a program one instruction at a time.

Purpose

There are many important components to this lesson. Students will be able to run around and get their wiggles out while building teamwork, programming, and debugging skills. Teamwork is very important in computer science. While Pair Programming - Student Video is common, it is more common for computer scientists to work in teams. These teams write and debug code as a group rather than individuals. In this lesson, students will learn to work together while being as efficient as possible.

This activity also provides a sense of urgency that will teach them to balance their time carefully and avoid mistakes, but not to fall too far behind.

Agenda

Warm Up (15 min)

Main Activity (15 min)

Wrap Up (15 min)

Assessment (10 min)

Extended Learning

Objectives

Students will be able to:

  • Practice communicating ideas through code and symbols.
  • Use teamwork to complete a task.
  • Verify the work done by teammates to ensure a successful outcome.

Preparation

Links

For the Teacher

Vocabulary

  • Algorithm - A list of steps to finish a task.
  • Bug - Part of a program that does not work correctly.
  • Debugging - Finding and fixing problems in an algorithm or program.

Support

Report a Bug

Teaching Guide

Warm Up (15 min)

Introduction

Recall that in "Graph Paper Programming" we guided our teammate's Automatic Realization Machine (ARM) using arrows. Take a moment to go through a quick "Graph Paper Programming" image as a reminder. It can either be one that you have already covered or one that is new.

We are going to do the same kind of thing today, but instead of controlling each other, we are going to work together to create a program one symbol at a time.

Main Activity (15 min)

Relay Programming Activity

Relay Programming Activity Packet - Teacher Prep Guide

The practice lesson was easy enough; let's add some action! We're going to do the same type of thing (create a program describing an image) but now we're going to do it in relay teams, one symbol at a time.

Clarifications

Here are some clarifications that need to be shared from time to time:

  • Only one person from each group can be at the image at one time.
  • It is okay to discuss algorithms with the rest of the group in line, even up to the point of planning who is going to write what when they get to the image.
  • When a student debugs a program by crossing out an incorrect instruction (or a grouping of incorrect instructions) this counts as their entire turn. The next player will need to figure out how to correct the removed item.

The rules of this game are simple:

  • Divide students into groups of 3-5.
  • Have each group queue up relay-style.
  • Place an identical image at the other side of the room/gym/field from each team.
  • Have the first student in line dash over to the image, review it, and write down the first symbol in the program to reproduce that image.
  • The first student then runs back and tags the next person in line, then goes to the back of the queue.
  • The next person in line dashes to the image, reviews the image, reviews the program that has already been written, then either debugs the program by crossing out an incorrect symbol, or adds a new one. That student then dashes back to tag the next person, and the process continues until one group has finished their program.

First group to finish with a program that matches the image is the winner! Play through this several times, with images of increasing difficulty.

Wrap Up (15 min)

Flash Chat: What did we learn?

  • What did we learn today?
  • What if we were each able to do five arrows at a time?
    • How important would it be to debug our own work and the work of the programmer before us?
    • How about with 10 arrows?
    • 10,000? Would it be more or less important?
  • Is it easier or harder to have multiple people working on the same program?
  • Do you think people make more or fewer mistakes when they're in a hurry?
  • If you find a mistake, do you have to throw out the entire program and start over?

Journaling

Having students write about what they learned, why it’s useful, and how they feel about it can help solidify any knowledge they obtained today and build a review sheet for them to look to in the future.

Journal Prompts:

  • What was today's lesson about?
  • How did you feel during today's lesson?
  • How did teamwork play a role in the success of writing today's program?
  • How did you use your debugging skills in today's lesson?

Assessment (10 min)

Relay Programming - Assessment

Pass around this assessment and have the students work on it independently. At the very end, you can take time to go over and discuss the answers.

Extended Learning

Use these activities to enhance student learning. They can be used as outside of class activities or other enrichment.

Pass the paper

  • If you don't have the time or room for a relay, you can have students pass the paper around their desk grouping, each writing one arrow before they move the paper along.

Fill It, Move It

  • As the teacher, draw an image with as many filled squares as children in each group.
  • Have the students write as many arrows in the program as it takes to get to a filled-in square (including actually filling that square in) before passing to the next person.

Debugging Together

Draw an image on the board. Have each student create a program for the image. Ask students to trade with their elbow partner and debug each other's code.

  • Circle the first incorrect step, then pass it back.
  • Give the students another chance to review and debug their own work.
  • Ask for a volunteer to share their program.

Ask the class:

  • How many students had the same program?
  • Anyone have something different?
  • Levels
  • 1
  • (click tabs to see student view)
View on Code Studio

Student Instructions

Standards Alignment

View full course alignment

CSTA K-12 Computer Science Standards

AP - Algorithms & Programming
  • 1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
  • 1B-AP-15 - Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.