Skip to content

Commit

Permalink
Merge pull request #50 from sammancoaching/bingo-refactoring-kata-des…
Browse files Browse the repository at this point in the history
…cription

Adding description for the "Bingo refactoring kata"
  • Loading branch information
codecop authored Nov 4, 2024
2 parents 59d5253 + 9fe482b commit 2d4afd4
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions _kata_descriptions/bingo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Bingo Refactoring Kata
kata_name: bingo
---

# Bingo Refactoring Kata

This kata is used for practicing refactoring. The code contains at least the code smells:

- primitive obsession
- data clumps
- missing polymorphism (Board/InitializedBoard/...)
- long methods

The structure of the Bingo Refactoring Kata is similar to the Game of Life kata, but since the focus here is on refactoring, the business rules should be kept as simple as possible. It is not absolutely necessary to understand the business rules in order to complete the task.
However, the business rules are:

- A bingo board must be initialized before it can be used/played
- A board is initialized when each cell has been assigned a value
- A cell may not be assigned a value that has already been assigned to another cell
- When playing, a cell can be marked as selected

## Refactoring

There are several implementations you can use to practice refactoring in this repo: [Bingo-Refactoring-Kata](https://github.com/sammancoaching/Bingo-Refactoring-Kata).

Various aspects of parallel change can be highlighted:

- Swapping the internal data structure (introducing Cell[][])
- Introducing Coordinate and using it as parameter type. This one would affect the API (method signature) and so we have external dependencies on the “old” API which we should preserve in parallel with the new one. In a real system you’d use Parallel Change to eventually remove the “old” API once all the clients were migrated to the new one.

## Notes

All tests exist twice, one more technically oriented, one more professionally oriented (BDD), please use the one that suits you better.

### Acknowledgement

This kata was first published elsewhere: [Bingo Refactoring Kata](https://github.com/atruvia/samman-coaching-katas/tree/master/bingo-refactoring-kata)

0 comments on commit 2d4afd4

Please sign in to comment.