Trip Service Kata

Credits

Inspired by Sandro Mancuso

Your Task

The objective is to test and refactor the legacy TripService class. The end result should be well-crafted code that expresses the domain. We do not need tests for collaborators (right now), we want to test only the logic contained in the TripService class.

Rules

  • We can’t change any existing code if not covered by tests. We can’tafford to break any existing behavior.
  • The only exception is if we need to change the code to add unit tests, but in this case, just automated refactorings (via IDE) are allowed.

Get the Code

On GitHub (This kata can be done using ABAP, C#, C++, Java, JavaScript, Kotlin, Objective C PHP, Python, Ruby, Scala, Swift) If your favorite language is missing, feel free to create a pull request. Be sure the maintainer will be happy ;-)