drogus / expensereport

The ExpenseReport legacy code refactoring example in various languages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ExpenseReport

The ExpenseReport legacy code refactoring kata in various languages.

This is an example of a piece of legacy code with lots of code smells. The goal is to support the following new feature as best as you can:

  • Add Lunch with an expense limit of 2000.

Process

  1. πŸ“š Read the code to understand what it does and how it works.
  2. 🦨 Read the code and check for design smells.
  3. πŸ§‘β€πŸ”¬ Analyze what you would have to change to implement the new requirement without refactoring the code.
  4. πŸ§ͺ Write a characterization test. Take note of all design smells that you missed that made your life writing a test miserable.
  5. πŸ”§ Refactor the code.
  6. πŸ”§ Refactor the test.
  7. πŸ‘Ό Test-drive the new feature.

Supported Languages

The ExpenseReport example currently exists in the following languages:

Credits

I first encountered the ExpenseReport example during a bootcamp at Equal Experts. I also have seen the ExpenseReport example being used by Robert "Uncle Bob" C. Martin. I have tried to research its origins but so far I have failed. If you know who has first come up with this example, please get in touch with me.

About

The ExpenseReport legacy code refactoring example in various languages


Languages

Language:TypeScript 15.7%Language:C# 11.3%Language:Makefile 10.2%Language:JavaScript 9.4%Language:Python 9.0%Language:Java 7.8%Language:C++ 7.6%Language:Kotlin 7.5%Language:Rust 7.3%Language:C 7.1%Language:Go 6.8%Language:Shell 0.3%