↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Tennis-Refactoring-Kata

The page presents a refactoring kata built around tennis scoring code. It recommends starting with TennisGame1, using the fast test suite as you refactor, and notes that the implementations include a deliberate hard-coded player-name problem.

Reading notes
#

  • The exercise is framed as work on a consulting job where the code should be tidied up while the tests keep passing.
  • The provided test suite is described as comprehensive and fast, so it should be run often during refactoring.
  • Several versions of the kata are available, each with its own design smells and challenges.
  • The first version, TennisGame1, is suggested as the starting point.
  • One deliberate error in several implementations is that the player names are hard-coded to player1 and player2.
  • After refactoring, the page suggests fixing that problem and adding tests to prove the fix.
  • The page links to a kata description, follow-up discussion questions, and a code reading practice exercise about scanning for code smells.