Refactoring Pattern Hunt¶
Goal¶
Recognize and justify which refactoring pattern categories and concrete refactoring patterns best improve a real piece of student code — and practice moving from high-level diagnosis to actionable improvement.
Setup¶
- Each team gets a full deck of refactoring pattern cards.
- The tutor projects or displays a short code chunk from one of the projects.
- Each team uses cards and markers to show their picks.
Play¶
Round 1 — Category (Recognize)¶
- Observe: Study the displayed code together.
- Select: Each team secretly picks
- 1 refactoring category (e.g., Composing Methods, Organizing Data, Simplifying Conditional Expressions, etc.).
- Hide & Reveal: Teams place their cards face down.
- Discuss: The tutor flips the cards and leads discussion:
- Why this category?
- What symptoms point to it?
- What other categories could apply?
Round 2 — Pattern (Act)¶
- Refine: Based on the discussion, teams now pick
- 1 concrete refactoring pattern from the chosen category (e.g., Extract Method, Replace Magic Number with Symbolic Constant, etc.).
- Hide & Reveal: Cards placed face down again.
- Discuss: Tutor compares and leads:
- Why this specific refactoring?
- What would change in the code?
- What trade-offs exist?
Scoring¶
Round 1¶
- +1 point if two teams suggest the same type.
- +1 point if the code’s author team and one other team suggest the same type.
- +1 point if at least half of all teams + 1 choose the same type.
- +1 point if the tutor’s choice matches your team’s.
Round 2¶
- +2 points if two teams suggest the same pattern.
- +2 points if the code’s author team and one other team suggest the same pattern.
- +2 points if at least half of all teams + 1 choose the same pattern.
- +2 points if the tutor’s choice matches your team’s.
Points add up — moving from correct diagnosis to actionable refactoring matters more than guessing.