Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Legacy codes

Legacy codes

What's legacy codes? What should we do with it?

Kuncara Adi Nugraha

April 01, 2016
Tweet

More Decks by Kuncara Adi Nugraha

Other Decks in Programming

Transcript

  1. What is legacy code? Code we’ve gotten from somewhere else

    Demoralising code (big ball of mud) Code without unit tests
  2. Reasons to change Legacy Code Kill some BUGS! Add new

    FEATURES Do some OPTIMISATIONS Add new automations things ( tests, scaling, etc)
  3. Reasons not to change Legacy Code It looks ugly I

    would like to see nicer code I want to use new shiny tools ….
  4. What do we do? You can rewrite but you cannot

    rewrite all Fight temptations to refactor a lot of codes DO IT SLOWLY AND CALMLY!!
  5. Edit and Pray Steps Find boundaries Discover the codes Refactor

    / Rewrite Run it and do smoke tests Pray that everything is okay
  6. Cover and Modify Steps Find boundaries Discover the code Start

    write tests around the to-be- refactored code Do refactor / rewrite Tests and ensure its working
  7. Prepare and Write Tests Surround it with tests ( integration,

    GUI, unit tests, exploratory tests ) Testing is an investment