Kata
Smelly Tic-Tac-Toe
We created a very smelly implementation of Tic-Tac-Toe in our Code Smells: https://github.com/AgileTechPraxis/CodeSmells open source repository. There are quite a few code smells in the implementation:
- Comments
- Data class
- Data clumps
- Divergent change
- Duplicated code
- Feature envy
- Large class
- Lazy class
- Long method
- Long parameter list
- Message chain
- Primitive obsession
- Shotgun surgery
Start by identifying the smells, then slowly refactor the code. Remember to keep the tests passing at all times during the refactor. It's okay to revert back to a previous working state at any moment.
Note
For a sample (partial) solution, see the Appendices section on the page 385.