Playing Pieces for the Refactoring Grid
Game
The Refactoring
Grid Game
uses a nonprogramming domain to help people quickly become acquainted
with
the concepts of refactoring. The game, created by William Wake (and
found at xp123, his Exploring Extreme
Programming
website), uses a series of paned windows arranged in a grid
in-which a
set of tokens lies. Certain configurations of tokens are defined as
“smells”. Smells are generally undesirable since they indicate signs of
possibly poor design and/or implementation. By using refactoring rules
it is often possible to reorganize the internal structure of the system
and remove the smells. Rules provide instructions to transform the
tokens to new configurations. The situation is analogous to refactoring
source code to make it easier to understand or modify.
To
make the game more suitable for group classroom exercises, an
adaptation which uses a set of physical tokens, cards and a game board
was developed. This also works nicely as an ice-breaker to get students
comfortable working together at the start of the semester. Be
sure to
check the original game description for ideas and discussion
questions and to help resolve some ambiguities that might arise when
trying to apply the rules. You will probably discover more analogies
between the game and actual code refactoring than you might first
expect.
Worksheets were also
designed for solving exercises with paper and pencil - these are useful
for follow-up homework assignments. We use Tablet PCs in my software class,
and I find using “digital ink” to fill out the worksheets helps
students gain familiarity with the functionality of Tablet PCs.
I hope you find these materials useful and I would be happy to hear of
your experiences.
-Michael Wainer
Dept. of Computer Science, SIUC, Carbondale, IL
wainer@cs.siu.edu
Here are pdf files for the printed game components. I've found that tictacs
of 2 colors for each set serve as good tokens. The cards correspond to
the rules, smells and exercises presented in the original
game description.
- The game cards are designed to be printed 2 at-a-time onto
4x6 index cards. Also includes a pattern for the card backsides.
- The board
can be printed onto standard 8.5 x 11 inch paper. Insertion into a
sheet protector with an additional sheet of card stock makes it more
durable and easier to work with.
- The worksheet
is suitable for solving exercises on paper or on a Tablet PC with
digital ink.