6.8. Debugging Caesar Cipher

This lesson reviews debugging and has students debug a Caesar Cipher app with 5 bugs in it. The lesson reinforces their understanding of what it means for a program to work correctly.

Professional Development

The Student Lesson: Complete the activities for Mobile CSP Unit 6: Lesson 6.8 Debugging Caesar App.

Materials

6.8.1. Learning Activities

Estimated Length: 45 minutes

  • Hook/Motivation (10 minutes): (Think-Pair-Share) Show a sample of App Inventor code to students and ask them to write down what they think the code is supposed to do and what it actually does. Have them share answers with a partner and with the class. The example below is from a Space Invaders game with a Sprite for one of the invaders, which moves similar to the lightbulb in the Lights Off app. The MyCanvas property should be Width instead of BackgroundImage. For this example, make sure everyone in the class knows what happens in the Space Invaders game.
  • Experiences and Explorations (25 minutes):
    • Explanation (10 minutes): Either use the slides to present concepts on debugging or have students watch the video.
    • Debugging (15 minutes): Have students download the buggy app and try to find the 5 errors. The students should do any necessary tests to determine what the bugs may be. The students should make incremental corrections. After attempting to fix one bug, the students should test the app before continuing. If they need hints, tell them to first look at encryption, then decryption, tell them to pay attention to how many times each loop is run in these functions and their return values. They can also compare their code to their finished Caesar app from the last lesson.
      Here are the solutions to this debugging exercise.
  • Rethink, Reflect and/or Revise (10 minutes): Review the debugging strategies and syntax vs. semantic errors. Have students complete the interactive exercises and portfolio reflection

AP Classroom

The College Board's AP Classroom provides a question bank and Topic Questions. You may create a formative assessment quiz in AP Classroom, assign the quiz (a set of questions), and then review the results in class to identify and address any student misunderstandings.The following are suggested topic questions that you could assign once students have completed this lesson.

Suggested Topic Questions:

Assessment Opportunities and Solutions

Solutions:

  1. Debugging Caesar Cipher Solutions

You can examine students’ work on the interactive exercise and their reflection portfolio entries to assess their progress on the following learning objectives. If students are able to do what is listed there, they are ready to move on to the next lesson.

  • Interactive Exercises:
  • Portfolio Reflections:
    LO X.X.X - Students should be able to ...
  • In the XXX App, look for:

Differentiation: More Practice

If students are struggling with the lessons, they should explain in their own words how the app is supposed to work and identify what is not working. If needed, they can review the code from the completed app and compare it to the buggy app.

Differentiation: Enrichment

Students can introduce their own bug to the app and then have a partner try to debug it.

Teaching Tips: Debugging

Debugging is a very common programming practice that should be emphasized throughout the course. However, in order for students to be effective debuggers, they must first understand how the program is supposed to work. If they are struggling, have them describe out loud how the program should work and then identify what is not working correctly.

6.8.2. Professional Development Reflection

Discuss the following questions with other teachers in your professional development program.

    I am confident I can teach this lesson to my students.
  • 1. Strongly Agree
  • 2. Agree
  • 3. Neutral
  • 4. Disagree
  • 5. Strongly Disagree

You have attempted of activities on this page