Reversed Test Pyramid - Testing and dealing with Legacy Code

1,001 views

Published on

Презентация доклада Wiktor Żołnowski на конференции SQADays-14 English Day, Львов 7 ноября 2013

Published in: Education, Technology
  • Be the first to comment

Reversed Test Pyramid - Testing and dealing with Legacy Code

  1. 1. Reversed Tests Pyramid Wiktor Żołnowski @streser http://www.agileszkolenia.pl http://www.codespritners.com
  2. 2. Agile Coach Troublemaker Who am I? Passionate
  3. 3. Can you imagine perfect software?
  4. 4. End to End Tests Functional/Integration Tests Unit Tests
  5. 5. It would be perfect to work with perfect software every day...
  6. 6. But!
  7. 7. Reality...
  8. 8. Is...
  9. 9. Different!
  10. 10. Legacy Code
  11. 11. How did we get to this point?
  12. 12. It's all because of the money...
  13. 13. Technical Debt
  14. 14. Sometimes Technical Debt could be considered as something good...
  15. 15. Unfortunately the temptation of easy money is huge...
  16. 16. People live in an illusion of continuous, fast, low cost software development...
  17. 17. Forgetting about the Quality...
  18. 18. Success in Software Development is something that is not continuous...
  19. 19. Success is a state that you can achieve but also loose very quickly if you can't respond to changes fast enough...
  20. 20. So, is it possible to deal with legacy code?
  21. 21. Reversed Tests Pyramid End-to-End Tests Functional/Integration Tests Unit Tests
  22. 22. - What?!
  23. 23. You can't do unit testing when there are no units in your software...
  24. 24. You can't do integration tests when there is nothing to integrate...
  25. 25. You need to refactor your code so it would be testable...
  26. 26. Now refactor... High level tests give you courage to refactor your code... ●
  27. 27. But.. There are a few reasons why you shouldn't reverse tests pyramid End-To-End tests are too long...
  28. 28. End-to-end tests are difficult (costly) to maintain... If we need end-to-end tests we are probably doing something wrong with our architecture...
  29. 29. So it's all about reversing back our tests pyramid.
  30. 30. Step by step we are introducing a new architecture...
  31. 31. Remember that creating reversed tests pyramid and reversing it back will take some time...
  32. 32. Remember - WHY are we doing this?
  33. 33. Keep your technical debt as low as possible and try to pay it back every time you can. For example use your slack time for that!
  34. 34. “Leave the world better then you found it”
  35. 35. Beware of refactoring just for refactoring! Few final thoughts...
  36. 36. Few final thoughts... ● ● ● ● ● Beware of refactoring just for refactoring! Resist temptation to re-write from scratch – history is against you, such projects usually fail. Remember to always remove your (duplicated) tests! Software quality in many cases could be understood as ability to introduce changes into software! Keep your technical debt as low as possible and try to pay it back every time you can. For example use your slack time for that! Resist temptation to re-write from scratch – history is against you, such projects usually fail.
  37. 37. Few final thoughts... ● ● ● ● Beware of refactoring just for refactoring! Resist temptation to re-write from scratch – history is against you, such projects usually fail. Remember to always remove your (duplicated) tests! Software quality always remove be understood as ability to Remember to in many cases could your (duplicated) tests! introduce changes into software! ● Keep your technical debt as low as possible and try to pay it back every time you can. For example use your slack time for that!
  38. 38. False positive or false negative safety net is even worst than lack of a safety net...
  39. 39. ● Software quality in many cases could be understood as ability to introduce changes into software!
  40. 40. Wiktor Żołnowski www.codesprinters.com Questions? @streser http://medium.com/@streser http://blog.testowka.pl http://www.agileszkolenia.pl http://codesprinters.com

×