mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-04 09:11:39 +00:00
Starting code for the GildedRose Refactoring Kata in many programming languages.
| .gitignore | ||
| gilded_rose.py | ||
| GildedRoseRequirements.md | ||
| README.md | ||
| requirements.txt | ||
| test_gilded_rose.py | ||
| test_gilded_rose.test_update_quality.approved.txt | ||
This is my implementation of the Gilded Rose Kata.
Tidy/refactor -> behavior change
/main
In the main branch is simply a refactoring, with the new requirement yet to implemented. I use the lift up conditional refactoring, inspired by Emily Bache and Llewellyn Falco.
See their videos here:
TODO: link vids
- Emily Bache:
- Llewellyn Falco:
/feature/implement-new-requirement
In this branch, I have implemented the new requirement.
/archive/original-code
This branch contains the original code, before the refactoring.
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 testing to ensure the behavior of the code remains the same during refactoring. Specifically, it uses pytest-approvals
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 to view differences side by side, if there are any behavior changes.
- feel free to install and use a diff reporter of your choice. See pytest docs for more info on configuring reporters: selecting a reporter
- 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
htmlcovdirectory by openingindex.htmlin a browser)