- 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..
You have been hired as a developer for FridgeCraft, a fridge manufacturer who pride themselves on their craftsmanship of delivering a quality fridge.
FridgeCraft have decided to adopt the trend of making a “smart” fridge, and it’s your job to build the software to integrate into the new test model.
The Research and Development team have given you the following requirements for the first iteration of the test model:
- Item name
- Expiration date
- Timestamp when added
- 1 hour (sealed)
- 5 hours (opened)
- Expired Items displayed first with "EXPIRED: $item.name"
- Non-expired items displayed after with "$item.name: n day(s) remaining
You may also need to consider a way to simulate days passed, so the functionality can be easily demonstrated for the test model. However, make sure this does not affect the core functionality of the system and can be easily removed for release models.
The Research and Development team have also provided the following you do not have to worry about:
Even though this is just a prototype to show the stakeholders, you should still treat it with the care you would for a real system. Keep in mind the decisions you make and how they would affect the extensibilty of the system for the future.
Good luck, and keep your cool.
One approach you could take to this kata is Event Sourcing.
The following is an example of typical events performed around your test model, you could even use this as a final acceptance test.
> Set Current Date - "18/10/2021"
> Fridge Door Opened
> Item added - name: "Milk", expiry: "21/10/21", condition: "sealed"
> Item added - name: "Cheese", expiry: "18/11/21", condition: "sealed"
> Item added - name: "Beef", expiry: "20/10/21", condition: "sealed"
> Item added - name: "Lettuce", expiry: "22/10/21", condition: "sealed"
> Fridge Door Closed
> (Day Over)
> Fridge Door Opened
> Fridge Door Closed
> Fridge Door Opened
> Fridge Door Closed
> Fridge Door Opened
> Item removed - name: "Milk"
> Fridge Door Closed
> Fridge Door Opened
> Item added - name: "Milk", expiry: "26/10/21", condition: "opened"
> Item added - name: "Peppers", expiry: "23/10/21", condition: "opened"
> Fridge Door Closed
> (Day Over)
> Fridge Door Opened
> Item removed - name: "Beef"
> Item removed - name: "Lettuce"
> Fridge Door Closed
> Fridge Door Opened
> Item added - name: "Lettuce", expiry: "22/10/21", condition: "opened"
> Fridge Door Closed
> Fridge Door Opened
> Fridge Door Closed
> (Day Over)
These interactions should generate the following display on the fridge:
EXPIRED: Milk
Lettuce: 0 days remaining
Peppers: 1 day remaining
Cheese: 31 days remaining
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..
Santa wants to increase the number of Christmas trees that he has in his allotment.
Introduction Sudokuis a very popular number-placementpuzzle. The objective is to fill a 9 × 9 grid with digits so that each column, each row, and..
Join our newsletter for expert tips and inspirational case studies
Join our newsletter for expert tips and inspirational case studies