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

Legacy Code Kata at SWK Berlin

ilkezilci
October 26, 2015

Legacy Code Kata at SWK Berlin

Our slides with rradczewski from the Legacy Code Kata, October '15.

ilkezilci

October 26, 2015
Tweet

More Decks by ilkezilci

Other Decks in Programming

Transcript

  1. But fear not, for you are here tonight :) Last

    Time Gilded Rose Kata - Test Coverage for adding features Full Evening This Time Trivia Kata - Improving code without adding features Retreat Style
  2. Tomorrow, when you get to the office... Gather data Where

    are your pain points? How often do they hinder you? How much time do you waste because of them? Make it transparent Put up Post-It’s with your “best” pain points Let other developers vote on them or add others Build prototypes Prove that you can improve your codebase for simple use-case
  3. Safety Net Toolbox - Test coverage - Golden master technique

    - Use your IDE refactoring tools - Commit often to your local version control - Mutation testing (do the tests fail if we introduce mutants in the code)
  4. Test Coverage - No specifications but GameRunner might help -

    Use your code coverage tool to improve your safety net
  5. Golden Master Technique - Make the system testable - Replace

    any random number generators/current datetime calls, inject mocks for external stuff - Produce output - Find a balance between pseudo random and specific input or scenarios - Capture the output of the system without changing the production code - In the trivia game, we see lots of console output lines - In your tests, compare the output of the “original” Golden Master to your implementation
  6. Use Your IDE Improve readability ~ Find code duplicates and

    extract methods ~ Isolate calls to low level classes, things which write to or read from sources ~ Fix stringly typed variables