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

9_ways_to_test_your_spaghetti_code_-_Devoxx_Ukraine.pdf

52482b46b478633a2b766bbf36916fd3?s=47 Mads Opheim
November 23, 2018
43

 9_ways_to_test_your_spaghetti_code_-_Devoxx_Ukraine.pdf

52482b46b478633a2b766bbf36916fd3?s=128

Mads Opheim

November 23, 2018
Tweet

Transcript

  1. Devoxx Ukraine 9 ways to test your spaghetti code Mads

    Opheim @MadsOpheim
  2. Goal of this talk: You’ll be inspired and enabled to

    test your legacy code 2
  3. What is spaghetti code? 3

  4. Precondition: You are creative The computer is not 4

  5. 1. Extract interface 5

  6. 6

  7. 7 2. Set your dependencies

  8. 8

  9. Singletons 9

  10. 3. Package-protect problematic parts 10

  11. 11

  12. 4. Consider removing final 12

  13. Well-designed code is testable code 13

  14. 14 5. Help your team

  15. 6. Run your tests - and care 15

  16. 7. Feature toggles 16

  17. 8. One class != one test class 17

  18. 9. Test-driven development 18

  19. Test-driven spaghetti 19

  20. Give me more @lisacrispin, @lisihocke, @techgirl1908... 20

  21. Key takeaways 21 1. Good code design improves testability 2.

    Short-term sacrifices are ok 3. Write tests for you legacy code - you can do it!
  22. спасибі! 22 @MadsOpheim mads.opheim@computas.com