
- By Emmanuel Valverde
- ·
- Posted Jan 28, 2023 9:00:00 AM
Shopping cart
What do we want to build? We are building a shopping cart for an online grocery shop. The idea of this kata is to build the product in an iterative..
We want to create a small game. The game consists of a player trying to guess a random number. The player will have three attempts to guess the number. If the number is correctly guessed, then the player wins, if not, the player loses.
If the player fails to guess the number, the game must notify the user if the number it's higher or lower.
This kata is meant to work on test doubles. But it can also be solved without them. Also, it's an excellent kata to work on Primitive obsession and baby steps.
As player
I play the number 5
the player wins
Initial state | Player wins on the first move |
![]() |
![]() |
As player
I play a 10
I play a 3
I play a 5
the player wins
Initial state | Player first move | Player second move | Player third move |
![]() |
![]() |
![]() |
![]() |
As player
I play a 10
I play a 3
I play a 5
the player loses
Initial state | Player first move | Player second move | Player third move |
![]() |
![]() |
![]() |
![]() |
public class GuessingNumberGame {
GuessingNumberGame(RandomNumberGenerator generator){}
public String guessNumber(int guessedNumber) {}
}
What do we want to build? We are building a shopping cart for an online grocery shop. The idea of this kata is to build the product in an iterative..
Iteration 1 Business rules We want to build an ATM machine and the first thing we need to do, is to create the software that will breakdown which..
In computer science, a stack is a famous abstract data type that provides certain operations on a collection of elements. Stacks have a long history,..
Join our newsletter for expert tips and inspirational case studies
Join our newsletter for expert tips and inspirational case studies