The

Brutal

Refactoring

Game

Thanks to

@AdiBolb

Who are you?

What are we going to do?


How will we do it?

 

while (inSession())
{
writeSomeCode();

while (!codebase().isPerfect())
{
refactor();
}
}


"Perfect"?

  1. Lack of tests
  2. Name not from domain
  3. Name not expressing intent
  4. Unnecessary if
  5. Unnecessary else
  6. Duplication of constant
  7. Method does more than
    one thing
  8. Primitive obsession
  1. Feature envy
  2. Method too long (> 6 lines)
  3. Too many parameters (> 3)
  4. Tests: not unitary
  5. Tests: setup too complex
  6. Tests: unclear action
  7. Tests: more than one assert
  8. Tests: no assert
  9. Tests: too many paths

Three Questions.



Was your code better than usual?


What upset you?


Would you do this again?

SoCraTes UK











http://socratesuk.org/

Cheers, Folks.

The Brutal Refactoring Game

By Samir Talwar

The Brutal Refactoring Game

  • 1,227