Kihagyás

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)

  1. Observe: Study the displayed code together.
  2. Select: Each team secretly picks
  3. 1 refactoring category (e.g., Composing Methods, Organizing Data, Simplifying Conditional Expressions, etc.).
  4. Hide & Reveal: Teams place their cards face down.
  5. Discuss: The tutor flips the cards and leads discussion:
  6. Why this category?
  7. What symptoms point to it?
  8. What other categories could apply?

Round 2 — Pattern (Act)

  1. Refine: Based on the discussion, teams now pick
  2. 1 concrete refactoring pattern from the chosen category (e.g., Extract Method, Replace Magic Number with Symbolic Constant, etc.).
  3. Hide & Reveal: Cards placed face down again.
  4. Discuss: Tutor compares and leads:
  5. Why this specific refactoring?
  6. What would change in the code?
  7. 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.