Form groups of about 3 people and review Pub.java in nerdschool.bar. Which code smells can you find? Refactor to remove smell(s). There is a small test suite (nerdschool.bar.PubPricesTest.java) that will help you along the way. Introduce more tests if you need them.
You will learn to:
- Identify bad code
- Fix code smells
- Refactor with tests
- IntelliJ Community Edition: IntelliJ Community Edition
- Java dev kit: Java SE Development Kit
✏️ Open pom.xml in IntelliJ by selecting Import project from the Welcome Screen. You can also use File --> New --> Project from existing sources.
✏️ Run all the tests and examine the code.
❓ What does this code do? Before you start changing the code, understand what the code does.
✏️ Refactor the code step by step so that it becomes more readable. Introduce more tests if you need them.