# Clean Code ### **Objective:** * To learn to read code and write test for the `Inventory` class * To refactor (aka clean up) the code in the `Inventory` class to make it more maintainable and readable ### **Purpose:** * To understand why writing readable code matter ### **Instructions:** 1. Fork this Repository * [fork](https://help.github.com/articles/fork-a-repo/) this repository to your personal github account * [clone](https://help.github.com/articles/cloning-a-repository/) **your** `forked` repository to your local machine. * clean up the code in the `Inventory` class * commit your changes * submit a `pull request` which compares Zipcoder `master` to your `master`. 3. DO NOT CHANGE THE ITEM CLASS ### See test coverage 1. Right click on the `java` folder in the `test` directory 2. Select `Run all with test coverage` 3. Note a window pop up which display which line is covered # Part 1 - Add tests Add test and make sure the line of code coverage is 100%. DO NOT alter the Item or Inventory class. Here are the requirements for the shop. [Link](./requirement.md) This is optional reading, but it will help you create your tests. ## Part 2 - Refactor the code Note how hard it is to read this code. Your task is to refactor the code to make it more readable. First create a new branch called `refactor`. ## Part 3 - Add a new item We have recently signed a supplier of conjured items. This requires an update to our system. First create a new branch called `new-item`. Add a `conjured` item. - "Conjured" items degrade in Quality twice as fast as normal items Feel free to make any changes to the UpdateQuality method and add any new code as long as everything still works correctly. This originated from [Bobby Johnson's Blog](https://iamnotmyself.com/2011/02/13/refactor-this-the-gilded-rose-kata/).