Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 1.38 KB

README.md

File metadata and controls

22 lines (17 loc) · 1.38 KB

Tennis Refactoring Kata

Imagine you work for a consultancy company, and one of your colleagues has been doing some work for the Tennis Society. The contract is for 10 hours billable work, and your colleague has spent 8.5 hours working on it. Unfortunately he has now fallen ill. He says he has completed the work, and the tests all pass. Your boss has asked you to take over from him. She wants you to spend an hour or so on the code so she can bill the client for the full 10 hours. She instructs you to tidy up the code a little and perhaps make some notes so you can give your colleague some feedback on his chosen design. You should also prepare to talk to your boss about the value of this refactoring work, over and above the extra billable hours.

You can follow the instructions in the code to refactor. Try using shortcuts to make your operations more efficiently. However, after finishing all refactoring in the instruction, you can challenge yourself not to use if-else in the getScore() method.

There is a deliberate error in several of the implementations - the player names are hard-coded to "player1" and "player2". After you refactor, you may want to fix this problem and add suitable test cases to prove your fix works.

Kata Description

Here is a description of the problem this code is designed to solve: Tennis Kata.