Learning Resource Type

Learning Activity

Can You Debug?

Subject Area

Digital Literacy and Computer Science

Grade(s)

4

Overview

Students will learn about Grace Hopper, who was a computer science pioneer that was one of the first programmers of the Mark I, invented one of the first compiler-related tools, and coined the term “debug.” They will practice their detection and debugging skills as they work through several algorithms created by the teacher.

This activity was created as a result of the DLCS COS Resource Development Summit.

    Digital Literacy and Computer Science (2018) Grade(s): 4

    DLCS18.4.4

    Detect and debug logical errors in various basic algorithms.

    Unpacked Content

    UP:DLCS18.4.4

    Vocabulary

    • detect
    • debug
    • logical
    • errors
    • algorithms

    Knowledge

    Students know:
    • strategies to detect logical errors in various basic algorithms.
    • strategies to debug or repair logical errors in various basic algorithms.

    Skills

    Students are able to:
    • detect and debug logical errors in various basic algorithms.

    Understanding

    Students understand:
  • how to detect and debug logical errors in various basic algorithms.
  • strategies to detect and debug logical errors in various basic algorithms.
  • Phase

    Before/Engage
    Learning Objectives

    Learning Objectives

    Students will practice detecting and debugging logical errors in various basic algorithms.

     

    Activity Details

    Students will:

    Use the listen and sketch strategy (see this website for detailed directions on this strategy), as the teacher reads aloud the non-fiction text Grace Hopper, Queen of Computer Code by Laurie Wallmark (or use the digital tool for a virtual read-aloud. Fold a blank sheet of paper into fourths and sketch while listening to each chunk. The teacher will stop for 30 seconds to one minute at the end of each chunk to give time to finish sketching the information learned while listening.

    • 1st chunk - pages 1 - 4

    • 2nd chunk - pages 5 - 12

    • 3rd chunk - pages 13 - 22

    • 4th chunk - pages 23 - end

    Discuss unfamiliar words from the story, such as code, computer program (algorithm), Mark I and II, programmer, and bug (debug).

    As a class, students will evaluate a basic algorithm for making a peanut butter and jelly sandwich to detect and debug logical errors. The teacher will reenact the following algorithm. The students will read the algorithm (a set of steps) as the teacher follows the steps.

    Algorithm to perform and give to each student group for review

    Open jar of peanut butter

    Open jar of jelly

    Open tie on bag of bread

    Take out two pieces of bread and place on plate

    Put peanut butter on bread (Note - does not say with a utensil. Place the entire jar of peanut butter on top of the bread slices)

    Put jelly on bread (Note - again does not say with a utensil. Place the entire jar of jelly on top of the bread slices)

    Eat peanut butter and jelly sandwich (note - does not say pick up the sandwich and eat).

    Student groups will discuss any errors they see and make suggestions for change.

    After class discussion and suggested edits, students watch as the teacher is the robot that follows the edited algorithm exactly to attempt to successfully construct a PB&J. Note - the “robot” will only do what is written. The students will see that they did not list every step needed, but thought the person would infer what they meant.  Make sure to discuss that the robot/computer will complete the steps as written exactly.

    With a partner or small group, students will again debug the algorithm above to edit for someone to follow the algorithm to successfully create a PB&J sandwich. Share with the class.

    With a partner, select one of the three algorithms below to detect and debug logical errors. The teacher will create algorithms for each process below (as steps will differ from classroom to classroom). The teacher-created algorithms should have at least two errors for the students to identify and correct.

    1) check out and read a book from the classroom library or a book available in the room

    2) line up to leave the room

    3) go to the office/library/clinic

    Groups will share their algorithm with the class and strategies for detecting and debugging.

    Assessment Strategies

    Assessment Strategies

    Students will be assessed based on their ability to detect and debug the PB&J algorithm and the additional algorithm given by the teacher. Students can rewrite the algorithm to correct or highlight the errors and write correct directions.

    Variation Tips

    Research elements from the story such as binary, Mark I and Mark II, Flow-matic language, history of computer languages, and any additional element of interest in Grace’s timeline which is on the last two pages of the book.

    Students can learn more about Grace Hopper using these tools:

    Grace Hopper on 60 Minutes Overtime, March 6, 1983

    Grace Hopper, National Women's History Museum

    Background and Preparation

    Background / Preparation

    Purchase or check out Grace Hopper, Queen of Computer Code by Laurie Wallmark (available on Amazon)

    Optional Video Clips: "Grace Hopper, Computer Scientist and Military Leader, Biography" and "Grace Hopper on 60 Minutes Overtime, March 6, 1983"

    Create a poster and post in the room - “Dare and Do. - Grace Hopper, Queen of Computer Code.”

    Blank paper per student

    Pen per student

    Gather all possible materials to make a PB&J sandwich but do not show the items to students. Have hidden until their algorithm states getting the item.

    Write or show the PB&J algorithm on the board (do not add notes).

    Create at least three algorithms for partners to detect and debug. Make sure to have at least two bugs in each algorithm.

     

    Digital Tools / Resources

    ALSDE LOGO