Coder Social home page Coder Social logo

keroami / expensereport Goto Github PK

View Code? Open in Web Editor NEW

This project forked from christianhujer/expensereport

0.0 0.0 0.0 324 KB

The ExpenseReport legacy code refactoring kata in >50 programming languages (Ada to Zig)

License: Other

Shell 8.65% JavaScript 5.38% Ruby 2.81% C++ 4.78% Scheme 4.75% Python 5.10% Perl 4.46% C 4.51% PHP 4.53% Objective-C 5.31% Java 5.42% Common Lisp 4.63% Lua 4.68% Haskell 4.40% Scala 4.08% Smalltalk 6.45% Groovy 3.79% Fortran 7.12% Clojure 4.97% Tcl 4.18%

expensereport's Introduction

ExpenseReport

License: CC-BY-SA 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 and code smells. Make a list of all code and design smells that you find.
  3. ๐Ÿง‘โ€๐Ÿ”ฌ Analyze what you would have to change to implement the new requirement without refactoring the code.
  4. ๐Ÿงช Write a characterization test. Expand your list of code and design smells. Add those smells that you missed earlier and discovered now because they 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:

Planned languages

(in no particular order and with no guarantee)

  • ABAP
  • Amiga E
  • AMOS BASIC
  • APL
  • More Assembler implementations (arm, aarch64, i686, powerpc, powerpc64, mpis, mips64, sparc, sparc64, risc-v, etc, usually on Linux)
  • Carbon
  • CLIPS
  • Cluster
  • Concurnas
  • Curry
  • Dark
  • Eiffel
  • Elm
  • Erlang
  • Flix
  • Forth
  • Gleam
  • Gosu
  • Hack
  • Hare
  • Java Byte Code / JVM Assembler
  • Lobster
  • Logo
  • Mercury
  • Modula-2 (once the linker starts working again)
  • Mojo
  • Oberon
  • OCaml
  • Pony
  • PureScript
  • R
  • Reason
  • REBOL
  • Scratch
  • SNOBOL
  • Solidity (maybe)
  • TeX
  • Unison
  • WebAssembly

Languages explicitly not planned

  • Brainfuck
  • False
  • Malbolge
  • Whitespace

Undecided Languages

There are many more programming languages than in the list above. Find a more complete list on Wikipedia.

Other plans

  • Make sure that all languages are providing the identical challenge. To be practical, this will require the removal of the timestamp side-effect.
  • Provide the time-stamp side-effect on a separate branch.
  • Provide a test setup (without test) on a separate branch so that folks can choose whether they want to include the setup work in the kata or not.
  • Provide a level 2 challenge for creating an HTML report besides the Plain Text report.

Solutions

To see solutions, switch to the solutions branch.

Warning The solutions branch will be rebased!

Credits and License

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. However, he seems to not be the original author (https://twitter.com/unclebobmartin/status/1537063143326855176?s=20&t=lh_vVb9jUQmY6PYG50974w) 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.

As I was asked for the license conditions, I have decided to put this under CC-BY-SA, with the following considerations:

  • Please credit me, last but not least to retain the opportunity for people to experience this exercise in as many programming languages as they are interested in.
  • Share it under the same license.
  • Using this as training material should be allowed, even if the trainer is charging money for their time.

Disclaimer: As stated above, I did not come up with the original version. The original author is unknown to me. The CC-BY-SA license thus can only cover my contribution: Recreating the Java version from memory, creating the versions in other programming languages than Java, and keeping them consistent.

expensereport's People

Contributors

christianhujer avatar jonreid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.