Starting code for the GildedRose Refactoring Kata in many programming languages.
Go to file
2025-12-28 10:02:09 +05:30
.github Add a CONTRIBUTING.md to clarify project structure and valid contributions (#550) 2024-06-12 17:46:09 +02:00
abap
Ada
bash . t bash/texttest_fixture.sh temp file -> variable 2024-01-05 09:11:57 +01:00
c99
C
c_cmocka remove unneeded files 2023-11-08 13:48:45 +01:00
clojure
COBOL
common-lisp-parachute
commonlisp
cpp Introduce four CMake options to enable/disabled test variants or test frameworks 2025-02-15 09:38:07 +01:00
csharp.NUnit Refactoring c# projects (#544) 2024-06-06 14:13:44 +02:00
csharp.xUnit make additional test for C# like Java-Approvals 2024-12-02 08:24:06 +01:00
d
dart
Delphi
elisp Removed car 2024-10-18 15:32:03 +02:00
elixir test(elixir): fix CRLF problems 2025-08-15 19:30:58 +02:00
elm Update dependencies, remove unused ones 2024-09-26 01:30:34 +02:00
erlang
fortran
fsharp
fsharp-core Fsharp updated to .NET 9 2025-05-09 11:44:12 +02:00
gleam refactor: update gleam_stdlib and glint version 2024-11-17 16:01:36 +07:00
go
Groovy
haskell add working directories to haskel .gitignore 2024-09-14 13:14:49 +02:00
io Port TextTestFixture. 2024-12-13 01:46:44 +01:00
janet
Java Make Gradle Java projects compatible with Java 17+ 2024-11-21 16:12:55 +01:00
Java-Approvals fix layout 2025-02-03 11:52:22 +01:00
Java-Cucumber Make Gradle Java projects compatible with Java 17+ 2024-11-21 16:12:55 +01:00
Java-Spock Make Gradle Java projects compatible with Java 17+ 2024-11-21 16:12:55 +01:00
jq - r jq: jaq -> jq, rm foreach 2024-01-05 09:21:12 +01:00
js-jasmine
js-jest
js-mocha
julia
Kotlin Reformat Item ctor and simplify toString 2025-05-12 09:39:48 +01:00
lfe
lua add Lua lang 2025-09-02 15:34:44 +02:00
Matlab
nim Standard ignores for Nim. 2023-12-07 13:07:29 +01:00
ocaml
odin separate files based on feedback 2025-05-04 13:29:08 +02:00
pascal
perl
perl6
php add composer.phar 2024-12-10 15:20:12 +01:00
plantuml
plpgsql
plsql
python Refactored GlidedRose class 2025-12-28 10:02:09 +05:30
R
rescript
ruby Omit parentheses in no‑arg defs 2025-09-03 14:50:22 +09:00
rust
scala approvaltests/gildedrose.approved.txt removed 2025-10-06 16:38:00 +02:00
scheme
Smalltalk
sql
swift swift: use && instead of , for beginners and for automated mutation 2024-03-18 16:03:09 -07:00
texttests docs: improve Windows setup instructions for TextTest with Python 2025-10-28 22:13:36 +03:00
TypeScript port typescript approval tests from jest to vitest 2025-01-09 19:54:34 -04:00
TypeScript-deno fix: typo 2025-01-22 18:36:51 +01:00
vbnet
xslt
zig Add Zig implementation 2024-06-02 17:15:37 +02:00
.gitignore Initial setup 2025-12-28 08:35:45 +05:30
CONTRIBUTING.md Add a CONTRIBUTING.md to clarify project structure and valid contributions (#550) 2024-06-12 17:46:09 +02:00
GildedRoseRequirements_ar.md Update GildedRoseRequirements_ar.md 2025-04-28 16:31:46 +01:00
GildedRoseRequirements_de.md
GildedRoseRequirements_es.md improve Spanish wording and apply format consistency with other languages 2024-08-01 14:06:12 +02:00
GildedRoseRequirements_eu.md Add Basque (Euskara) requirements translation 2023-11-07 17:25:00 +01:00
GildedRoseRequirements_fr.md
GildedRoseRequirements_gl.md fix: Added small corrections 2025-09-22 14:23:44 +02:00
GildedRoseRequirements_it.md
GildedRoseRequirements_jp.md
GildedRoseRequirements_kr.md
GildedRoseRequirements_nl.md Added Dutch requirement specification Markdown translation 2024-04-25 14:44:22 +02:00
GildedRoseRequirements_pl.md
GildedRoseRequirements_pt-BR.md
GildedRoseRequirements_ru.md Improve the translation of the specification in Russian 2024-07-20 00:17:53 +00:00
GildedRoseRequirements_th.md
GildedRoseRequirements_ua.md Improve the translation of the specification in Ukrainian 2025-03-15 15:40:23 +02:00
GildedRoseRequirements_zh.txt
GildedRoseRequirements.md doc: use markdown for english requirements 2023-12-08 21:13:27 +01:00
license.txt
README.md docs: Add reference to the Requirements file in Galician to README 2025-09-22 14:23:44 +02:00
start_texttest_from_python.bat docs: improve Windows setup instructions for TextTest with Python 2025-10-28 22:13:36 +03:00
start_texttest.bat
start_texttest.sh

Support this and all my katas via Patreon

Gilded Rose Refactoring Kata

You can find out more about this exercise in my YouTube video Why Developers LOVE The Gilded Rose Kata. I also have a video of a worked solution in Java - Gilded Rose Kata, Hands-on

I use this kata as part of my work as a technical coach. I wrote a lot about the coaching method I use in this book Technical Agile Coaching with the Samman method. A while back I wrote this article "Writing Good Tests for the Gilded Rose Kata" about how you could use this kata in a coding dojo.

How to use this Kata

The simplest way is to just clone the code and start hacking away improving the design. You'll want to look at the "Gilded Rose Requirements" which explains what the code is for. I strongly advise you that you'll also need some tests if you want to make sure you don't break the code while you refactor.

You could write some unit tests yourself, using the requirements to identify suitable test cases. I've provided a failing unit test in a popular test framework as a starting point for most languages.

Alternatively, use the Approval tests provided in this repository. (Read more about that in the section "Text-based Approval Testing").

The idea of the exercise is to do some deliberate practice, and improve your skills at designing test cases and refactoring. The idea is not to re-write the code from scratch, but rather to practice taking small steps, running the tests often, and incrementally improving the design.

Gilded Rose Requirements in other languages

Text-Based Approval Testing

Most language versions of this code have a TextTest fixture for Approval testing. For information about this, see the TextTests README

History of the exercise

This Kata was originally created by Terry Hughes (http://twitter.com/TerryHughes). It is already on GitHub here. Bobby Johnson described the kata in an article titled "Refactor This: The Gilded Rose Kata", but unfortunately it is no longer on the internet. I found it on the Wayback Machine here.

I translated the original C# into a few other languages, (with a little help from my friends!), and slightly changed the starting position. This means I've actually done a small amount of refactoring already compared with the original form of the kata, and made it easier to get going with writing tests by giving you one failing unit test to start with. I also added test fixtures for Text-Based approval testing with TextTest (see the TextTests)

As Bobby Johnson points out in his article "Why Most Solutions to Gilded Rose Miss The Bigger Picture" (on the Wayback Machine here), it'll actually give you better practice at handling a legacy code situation if you do this Kata in the original C#. However, I think this kata is also really useful for practicing writing good tests using different frameworks and approaches, and the small changes I've made help with that. I think it's also interesting to compare what the refactored code and tests look like in different programming languages.

Contributing

Contributions are encouraged! You could add a translations of the specification in another language or a new starting point for your favorite programming language. Please see CONTRIBUTING.md for more details.