Skip to content
Computing · JC 1

Active learning ideas

Testing and Debugging Techniques

Active learning works for lists and tuples because students need hands-on practice to grasp mutability, which is hard to visualize without direct experimentation. When students try to modify data and see immediate errors or changes, they build durable understanding of why lists and tuples behave differently.

MOE Syllabus Outcomes9569 2.4.1 Identify and correct syntax, logic and runtime errors9569 2.4.2 Design test cases using normal, boundary and erroneous data
20–45 minPairs → Whole Class4 activities

Activity 01

Plan-Do-Review30 min · Pairs

Pair Programming: List Manipulation

Pairs create a list of class subjects and student names. They append new entries, remove outdated ones, sort alphabetically, and slice subsets. Partners alternate coding while the other observes and suggests improvements.

What is the difference between syntax, logic, and runtime errors?

Facilitation TipDuring Pair Programming: List Manipulation, circulate to ask pairs to verbalize their plan before typing to build strategic thinking.

What to look forPresent students with short Python code snippets. Ask them to identify whether each snippet uses a list or a tuple and predict the outcome if they attempt to modify an element. For example: 'my_list = [1, 2, 3]; my_list[0] = 5. What is the new list?' vs. 'my_tuple = (1, 2, 3); my_tuple[0] = 5. What error occurs?'

RememberApplyAnalyzeSelf-ManagementDecision-MakingSelf-Awareness
Generate Complete Lesson

Activity 02

Plan-Do-Review40 min · Small Groups

Small Groups: Tuple vs List Debate

Groups build identical programs: one with lists for editable shopping carts, one with tuples for fixed prices. They attempt modifications on tuples, note errors, and debate use cases. Share findings class-wide.

How do we design effective test cases?

Facilitation TipFor Tuple vs List Debate, assign clear roles to each group member to ensure balanced participation.

What to look forPose the scenario: 'Imagine you are developing a system to store the coordinates for a fixed landmark on a map, like the Merlion statue. Would you use a list or a tuple for these coordinates? Justify your choice, considering data safety and potential operations.'

RememberApplyAnalyzeSelf-ManagementDecision-MakingSelf-Awareness
Generate Complete Lesson

Activity 03

Plan-Do-Review45 min · Whole Class

Whole Class: Data Analysis Relay

Divide class into teams. Each team manipulates a shared list of mock sales data (add, average, filter), passes to next team for tuple conversion and analysis. Discuss immutability benefits at end.

What is the purpose of black-box and white-box testing?

Facilitation TipIn Data Analysis Relay, set a 2-minute timer between stations so urgency keeps energy high.

What to look forAsk students to write down one key difference between lists and tuples on an index card and provide one example of when they would choose a list over a tuple for a programming task.

RememberApplyAnalyzeSelf-ManagementDecision-MakingSelf-Awareness
Generate Complete Lesson

Activity 04

Plan-Do-Review20 min · Individual

Individual: Error Hunt Challenge

Provide buggy code snippets mixing lists and tuples. Students identify and fix mutability errors individually, then pair to verify solutions and explain choices.

What is the difference between syntax, logic, and runtime errors?

Facilitation TipDuring Error Hunt Challenge, provide a checklist of common errors to help students self-correct before asking for help.

What to look forPresent students with short Python code snippets. Ask them to identify whether each snippet uses a list or a tuple and predict the outcome if they attempt to modify an element. For example: 'my_list = [1, 2, 3]; my_list[0] = 5. What is the new list?' vs. 'my_tuple = (1, 2, 3); my_tuple[0] = 5. What error occurs?'

RememberApplyAnalyzeSelf-ManagementDecision-MakingSelf-Awareness
Generate Complete Lesson

A few notes on teaching this unit

Start with a live demo showing the same operation on lists and tuples to make immutability concrete. Avoid abstract lectures; instead, let students discover rules through errors. Research shows that guided discovery with immediate feedback strengthens retention of mutable versus immutable concepts.

Successful learning looks like students confidently choosing between lists and tuples for classroom tasks, explaining mutability in their own words, and debugging errors when they attempt to modify tuples. Participation in debates and relay races shows they can articulate trade-offs and real-world fit.


Watch Out for These Misconceptions

  • During Pair Programming: List Manipulation, watch for students who try to change a tuple element and assume it worked because no syntax error appeared.

    Pause the pair and ask them to run the attempted change, observe the TypeError together, and discuss why immutability matters in safety-critical data like exam scores.

  • During Tuple vs List Debate, listen for claims that tuples are just lists with parentheses.

    Have groups swap their chosen structure mid-debate and rerun their scenario to observe the error or success, then reflect on why fixed data needs immutability.

  • During Data Analysis Relay, note students who treat lists and tuples as interchangeable.

    At the station, ask them to try sorting a tuple and observe the error, then justify why a list would be better for dynamic data like student grades.


Methods used in this brief