Activity 01
Code Critique: Smell Identification Gallery Walk
Print five code snippets on large paper and post them around the room. Each snippet has two or three distinct code smells (long method, magic numbers, duplicate logic, poor naming, deep nesting). Groups rotate every five minutes, identify the smells with sticky notes, and propose a refactoring. The debrief compares group choices and discusses cases where multiple refactorings are defensible.
Justify the importance of refactoring in the long-term maintainability of software.
Facilitation TipDuring Code Critique: Smell Identification Gallery Walk, circulate and ask students to explain each smell in their own words to reinforce understanding.
What to look forPresent students with a short code snippet containing 2-3 common code smells. Ask them to identify each smell by name and briefly explain why it is problematic. For example: 'Identify the code smell in lines 5-10 and explain why it needs refactoring.'