mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +00:00
commit
795efa9974
BIN
plantuml/gilded-rose.png
Normal file
BIN
plantuml/gilded-rose.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 272 KiB |
72
plantuml/gilded-rose.puml
Normal file
72
plantuml/gilded-rose.puml
Normal file
@ -0,0 +1,72 @@
|
||||
@startuml
|
||||
|
||||
skinparam backgroundColor transparent
|
||||
|
||||
start
|
||||
note left
|
||||
Do this for each item in the list.
|
||||
An item has a name, a sell in value and a quality value
|
||||
end note
|
||||
|
||||
if (not "Aged Brie" and not "Backstage passes to a TAFKAL80ETC concert") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
if ("Backstage passes to a TAFKAL80ETC concert") then (yes)
|
||||
if (sell in < 11) then (yes)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
if (sell in < 6) then (yes)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
endif
|
||||
|
||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||
:lower sell in with 1;
|
||||
else (no)
|
||||
endif
|
||||
|
||||
if (sell in < 0) then (yes)
|
||||
if (not "Aged Brie") then (yes)
|
||||
if (not "Backstage passes to a TAFKAL80ETC concert") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
:lower quality with quality;
|
||||
endif
|
||||
else (no)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
12
plantuml/history/01_lower-both-values.puml
Normal file
12
plantuml/history/01_lower-both-values.puml
Normal file
@ -0,0 +1,12 @@
|
||||
@startuml
|
||||
|
||||
skinparam backgroundColor transparent
|
||||
|
||||
start
|
||||
|
||||
:lower quality with 1;
|
||||
:lower sell in with 1;
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
17
plantuml/history/02_sell-by-passed.puml
Normal file
17
plantuml/history/02_sell-by-passed.puml
Normal file
@ -0,0 +1,17 @@
|
||||
@startuml
|
||||
|
||||
skinparam backgroundColor transparent
|
||||
|
||||
start
|
||||
|
||||
:lower quality with 1;
|
||||
:lower sell in with 1;
|
||||
|
||||
if (sell in < 0) then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
24
plantuml/history/03_quality-never-negative.puml
Normal file
24
plantuml/history/03_quality-never-negative.puml
Normal file
@ -0,0 +1,24 @@
|
||||
@startuml
|
||||
|
||||
skinparam backgroundColor transparent
|
||||
|
||||
start
|
||||
|
||||
if (quality > 0) then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
|
||||
:lower sell in with 1;
|
||||
|
||||
if (sell in < 0) then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
32
plantuml/history/04_aged-brie.puml
Normal file
32
plantuml/history/04_aged-brie.puml
Normal file
@ -0,0 +1,32 @@
|
||||
@startuml
|
||||
|
||||
skinparam backgroundColor transparent
|
||||
|
||||
start
|
||||
|
||||
if (not "Aged Brie") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
:increase quality with 1;
|
||||
endif
|
||||
|
||||
:lower sell in with 1;
|
||||
|
||||
if (sell in < 0) then (yes)
|
||||
if (not "Aged Brie") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
:increase quality with 1;
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
38
plantuml/history/05_quality-max-50.puml
Normal file
38
plantuml/history/05_quality-max-50.puml
Normal file
@ -0,0 +1,38 @@
|
||||
@startuml
|
||||
|
||||
skinparam backgroundColor transparent
|
||||
|
||||
start
|
||||
|
||||
if (not "Aged Brie") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
endif
|
||||
|
||||
:lower sell in with 1;
|
||||
|
||||
if (sell in < 0) then (yes)
|
||||
if (not "Aged Brie") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
47
plantuml/history/06_sulfuras.puml
Normal file
47
plantuml/history/06_sulfuras.puml
Normal file
@ -0,0 +1,47 @@
|
||||
@startuml
|
||||
|
||||
skinparam backgroundColor transparent
|
||||
|
||||
start
|
||||
|
||||
if (not "Aged Brie") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
endif
|
||||
|
||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||
:lower sell in with 1;
|
||||
else (no)
|
||||
endif
|
||||
|
||||
if (sell in < 0) then (yes)
|
||||
if (not "Aged Brie") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
68
plantuml/history/07_backstage-passes.puml
Normal file
68
plantuml/history/07_backstage-passes.puml
Normal file
@ -0,0 +1,68 @@
|
||||
@startuml
|
||||
|
||||
skinparam backgroundColor transparent
|
||||
|
||||
start
|
||||
|
||||
if (not "Aged Brie" and not "Backstage passes to a TAFKAL80ETC concert") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
if ("Backstage passes to a TAFKAL80ETC concert") then (yes)
|
||||
if (sell in < 11) then (yes)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
if (sell in < 6) then (yes)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
endif
|
||||
|
||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||
:lower sell in with 1;
|
||||
else (no)
|
||||
endif
|
||||
|
||||
if (sell in < 0) then (yes)
|
||||
if (not "Aged Brie") then (yes)
|
||||
if (not "Backstage passes to a TAFKAL80ETC concert") then (yes)
|
||||
if (quality > 0) then (yes)
|
||||
if (not "Sulfuras, Hand of Ragnaros") then (yes)
|
||||
:lower quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
else (no)
|
||||
:lower quality with quality;
|
||||
endif
|
||||
else (no)
|
||||
if (quality < 50) then (yes)
|
||||
:increase quality with 1;
|
||||
else (no)
|
||||
endif
|
||||
endif
|
||||
else (no)
|
||||
endif
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
22
plantuml/readme.md
Normal file
22
plantuml/readme.md
Normal file
@ -0,0 +1,22 @@
|
||||
# PlantUML
|
||||
This UML refactoring exercise is aimed at less technical people like analysts, testers and other non-programmers. The key takeaway message is clarifying the need for continuous refactoring to people who do not code on a daily basis.
|
||||
|
||||
## Running and rendering
|
||||
If you want to get started quickly, just copy the contents of `plantuml/gilded-rose.puml`, and paste it in https://www.planttext.com/
|
||||
|
||||
Several alternatives are available to render PlantUML, see https://plantuml.com/running.
|
||||
|
||||
## Syntax
|
||||
For the syntax of activity diagrams in PlantUML, please refer to https://plantuml.com/activity-diagram-beta
|
||||
|
||||
## Workshop
|
||||
You can run this exercise as a workshop.
|
||||
|
||||
During this workshop, you start off with a presentation explaining the domain, while filling out the testcases found under `plantuml/workshop`. After that, participants are invited to refactor the UML Activity Diagram, using the examples that were discovered during the presentation.
|
||||
[The google slides can be found here](https://docs.google.com/presentation/d/1kkRnVQjZELcfuGoFXaiSY_HxbO4lPQnSgHRGQZIH2nU/edit?usp=sharing).
|
||||
|
||||
## History
|
||||
If you want to illustrate how this activity diagram got to this state, you can show the requirements and the files under the /history directory. These individual files show the evolution of the activity diagram.
|
||||
|
||||
## Original state
|
||||

|
||||
BIN
plantuml/workshop-materials/testcases.pdf
Normal file
BIN
plantuml/workshop-materials/testcases.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user