Starting code for the GildedRose Refactoring Kata in many programming languages.
Go to file
Emily Bache 7e94dbd722
Merge pull request #664 from Sawalhy/docs-windows-texttest-improvements
docs: improve Windows setup instructions for TextTest with Python
2025-11-03 13:20:44 +00:00
.github Add a CONTRIBUTING.md to clarify project structure and valid contributions (#550) 2024-06-12 17:46:09 +02:00
abap starting code and tests for ABAP 2016-03-21 10:57:47 -05:00
Ada Renames README files consistently. 2018-12-02 20:39:39 +01:00
bash . t bash/texttest_fixture.sh temp file -> variable 2024-01-05 09:11:57 +01:00
c99 Add CMake and Unity test framework for c99 2018-10-30 18:29:14 +01:00
C only need one item in array 2021-10-12 11:19:56 +02:00
c_cmocka remove unneeded files 2023-11-08 13:48:45 +01:00
clojure Add Clojure translation 2022-09-25 20:41:30 +02:00
COBOL Add add script that helps you add items 2022-09-26 15:28:05 +02:00
common-lisp-parachute Update gilded-rose.lisp 2023-07-27 11:55:50 +02:00
commonlisp added functional version. 2022-01-20 08:53:01 +01:00
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 Add D language version 2018-05-09 18:23:31 +02:00
dart Add sdk constraint and update test deps 2021-04-09 10:50:03 +05:30
Delphi Add .res files to .gitignore 2020-01-20 11:54:27 +00:00
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 fix JetBrains erlang link 2021-10-27 09:57:22 -07:00
fortran Adding missing call to update_quality in GildedRose_unity_test 2021-05-26 21:45:07 +02:00
fsharp add fsharp version 2015-10-26 13:38:45 +01:00
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 feat: update go boilerplate 2022-04-26 16:27:42 +01:00
Groovy Added Gradle to Groovy project. 2022-08-26 13:51:13 -05:00
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 updated tests and added README, based on review feedback. 2023-07-13 11:01:41 +01:00
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 Update dependencies for JavaScript 2021-05-14 11:22:05 +02:00
js-jest Get texttests working for Javascript-Jest 2023-11-03 15:36:54 +01:00
js-mocha Make javascript mocha texttests work 2023-11-03 15:39:50 +01:00
julia make julia compatible with texttests 2023-06-12 16:41:55 +03:00
Kotlin Reformat Item ctor and simplify toString 2025-05-12 09:39:48 +01:00
lfe failing unit test with 'fixme != 'foo' 2022-01-23 19:06:42 +01:00
lua add Lua lang 2025-09-02 15:34:44 +02:00
Matlab Add Matlab files 2023-09-21 21:47:48 +02:00
nim Standard ignores for Nim. 2023-12-07 13:07:29 +01:00
ocaml Support texttest with OCaml 2023-10-24 14:04:28 +02:00
odin separate files based on feedback 2025-05-04 13:29:08 +02:00
pascal Port to (Turbo) Pascal. Feeling retro ;-) 2017-12-08 15:53:56 +01:00
perl add texttest fixture for Perl 5 code 2014-05-02 12:25:12 +02:00
perl6 Moves language specific Git ignores into language subfolders. 2018-12-02 20:31:26 +01:00
php add composer.phar 2024-12-10 15:20:12 +01:00
plantuml added a slide-deck for a workshop 2019-12-31 14:17:03 +01:00
plpgsql typo 2020-01-23 19:53:15 +01:00
plsql Updated gilded rose to utplsql version 3 2019-07-02 15:40:46 +02:00
python Update README.md with -m unittest 2025-07-17 15:44:35 +02:00
R Eclipse/StatET R environment configuration (can be imported as existing 2014-12-05 20:09:51 +01:00
rescript adding yarn texttest 2023-09-07 17:07:56 +09:30
ruby Omit parentheses in no‑arg defs 2025-09-03 14:50:22 +09:00
rust Make rust loop worse to make it closer to the original 2023-05-21 10:36:45 +02:00
scala approvaltests/gildedrose.approved.txt removed 2025-10-06 16:38:00 +02:00
scheme Fixes bug in Scheme version, not deeply nested enough. 2018-12-03 22:45:26 +01:00
Smalltalk Fixes encoding Smalltalk source. 2018-12-02 21:48:42 +01:00
sql Add SQL (without test support) 2019-12-18 21:58:10 +01:00
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 Add VB.NET implementation 2022-03-16 20:35:25 -04:00
xslt Description how to run the XSLT. 2018-12-07 23:53:54 +01:00
zig Add Zig implementation 2024-06-02 17:15:37 +02:00
.gitignore ignore mac DS_Store 2024-02-13 16:53:41 +01:00
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 improve language 2022-02-11 21:08:27 +01:00
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 removed a word that didn't mean anything in the sentence in french 2022-11-07 09:31:27 +01:00
GildedRoseRequirements_gl.md fix: Added small corrections 2025-09-22 14:23:44 +02:00
GildedRoseRequirements_it.md Update Italian translation: 2023-09-06 12:38:04 +02:00
GildedRoseRequirements_jp.md Update GildedRoseRequirements_jp.md 2020-08-17 10:47:34 +09:00
GildedRoseRequirements_kr.md Update GildedRoseRequirements_kr.md 2023-01-12 14:08:50 +09:00
GildedRoseRequirements_nl.md Added Dutch requirement specification Markdown translation 2024-04-25 14:44:22 +02:00
GildedRoseRequirements_pl.md add polish translation of requirements 2022-06-09 20:17:36 +02:00
GildedRoseRequirements_pt-BR.md Update GildedRoseRequirements_pt-BR.md 2017-07-13 18:46:22 -03:00
GildedRoseRequirements_ru.md Improve the translation of the specification in Russian 2024-07-20 00:17:53 +00:00
GildedRoseRequirements_th.md Update GildedRoseRequirements_th.md 2021-03-16 15:28:32 +07:00
GildedRoseRequirements_ua.md Improve the translation of the specification in Ukrainian 2025-03-15 15:40:23 +02:00
GildedRoseRequirements_zh.txt Update GildedRoseRequirements_zh.txt 2020-09-25 13:05:39 +08:00
GildedRoseRequirements.md doc: use markdown for english requirements 2023-12-08 21:13:27 +01:00
license.txt added MIT license 2015-07-07 19:46:17 +02:00
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 Update convenience texttest scripts for windows and docs 2023-11-03 13:42:00 +00:00
start_texttest.sh Add convenience shell script for running texttests 2023-11-03 14:08:40 +01:00

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.