Coder Social home page Coder Social logo

trip-service-kata's Introduction

Testing legacy code: Hard-wired dependencies

Code related to my Testing legacy code: Hard-wired dependencies blog post. Try not reading the blog post before doing the exercise yourself.

What is it about?

Provides an example of existing code that needs to be unit tested. But there is one rule:

We can't change any existing code if not covered by tests. 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.

Although this is a very small piece of code, it has a lot of the problems that we find in legacy code.

Details

If you want to give it a go, the starting point is TripServiceTest.java and TripService.java. Try unit testing it following the rule above.

For future comparisions, when you are done, you can always check TripService_Original.java

trip-service-kata's People

Contributors

jimmycheng avatar

Watchers

James Cloos avatar  avatar

trip-service-kata's Issues

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.