mikybars / tdd-bowling-kata-java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

title description class toc order image
tdd-bowling-kata
An implementation of the classic bowling kata for a TDD exercise
beginners
things-to-note story-specification test-cases
Things to note
Story Specification
Test Cases
2
/assets/images/cards/beginner.png

Things to note

  1. No judgment, Nothing that happens inside this room will be reported to anyone outside it. The point is to try things out and learn from getting it wrong.
  2. No governance, you can pick whatever tools and programming languages you like.
  3. There are no right answers, it’s ok to come to different solutions. We will make various trade-offs along the way.
  4. Red, Green, Refactor.
  5. Code coverage statistics as a bonus.

Story Specification

  1. The game consists of 10 frames.
  2. In each frame the player has two opportunities to knock down 10 pins.
  3. The score for the frame is the total number of pins knocked down, plus bonuses for strikes and spares.
  4. A spare is when the player knocks down all 10 pins in two tries. The bonus for that frame is the number of pins knocked down by the next roll.
  5. A strike is when the player knocks down all 10 pins on his first try. The bonus for that frame is the value of the next two balls rolled.
  6. In the tenth frame a player who rolls a spare or strike is allowed to roll the extra balls to complete the frame. However no more than three balls can be rolled in tenth frame.

Test Cases

  1. The worst player in the world, hits all gutter balls, scores zero.
  2. The most consistent player in the world, hits one pin every time, scores 20.
  3. Can calculate a spare correctly, followed by a 3 score, scores 16.
  4. Can calculate a strike correctly, followed by a 3 and another 3, scores 22.
  5. Bowls a perfect game, scores 300.

About


Languages

Language:Java 100.0%