Starting code for the GildedRose Refactoring Kata in many programming languages.
Go to file
Koleh David f75a8b24e5 r docs
2025-02-06 16:10:51 +10:30
.gitignore ignore cov 2025-02-06 14:13:07 +10:30
gilded_rose.py r introduce param 2025-02-06 16:06:32 +10:30
GildedRoseRequirements.md doc: use markdown for english requirements 2023-12-08 21:13:27 +01:00
README.md r docs 2025-02-06 16:10:51 +10:30
requirements.txt First approval 2025-02-06 14:14:45 +10:30
test_gilded_rose.py r rm unittest 2025-02-06 16:07:25 +10:30
test_gilded_rose.test_update_quality.approved.txt r rm unittest 2025-02-06 16:07:25 +10:30

This is a refactoring and implementation kata for the Gilded Rose Kata. In the main branch, I've used the lift up conditional refactoring, inspired by Emily Bache and Llewellyn Falco.

See their videos here:

TODO: link vids

  • Emily Bache:
  • Llewellyn Falco:

Getting setup

Firstly, setup a python 3.12 environment using venv

Then, install the requirements:

pip install -r requirements.txt

Running the tests

This project uses [characterisation tests](TODO: Link to characterisation/approval tests concept) to ensure the behavior of the code remains the same during refactoring.

coverage run --branch -m pytest --approvaltests-add-reporter=diffuse -s ;
coverage html ;
coverage report --fail-under=100

This will run the tests, and will also:

  • automatically bring up [diffuse](TODO: link to) to view differences side by side, if there are any behavior changes
  • warn you if your coverage falls below 100% (either you need more tests, or there is dead code)
  • generate a coverage report (You can view this in the htmlcov directory by opening index.html in a browser)