Reversed Test Pyramid - Testing and dealing with Legacy Code

  • Upload
    sqalab

  • View
    394

  • Download
    4

Embed Size (px)

DESCRIPTION

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

Citation preview

  • 1. Reversed Tests PyramidWiktor onowski @streser http://www.agileszkolenia.pl http://www.codespritners.com

2. Agile CoachTroublemakerWho am I? Passionate 3. Can you imagine perfect software? 4. End to End Tests Functional/Integration Tests Unit Tests 5. It would be perfect to work with perfect software every day... 6. But! 7. Reality... 8. Is... 9. Different! 10. Legacy Code 11. How did we get to this point? 12. It's all because of the money... 13. Technical Debt 14. Sometimes Technical Debt could be considered as something good... 15. Unfortunately the temptation of easy money is huge... 16. People live in an illusion of continuous, fast, low cost software development... 17. Forgetting about the Quality... 18. Success in Software Development is something that is not continuous... 19. Success is a state that you can achieve but also loose very quickly if you can't respond to changes fast enough... 20. So, is it possible to deal with legacy code? 21. Reversed Tests Pyramid End-to-End Tests Functional/Integration TestsUnit Tests 22. - What?! 23. You can't do unit testing when there are no units in your software... 24. You can't do integration tests when there is nothing to integrate... 25. You need to refactor your code so it would be testable... 26. Now refactor...High level tests give you courage to refactor your code... 27. But.. There are a few reasons why you shouldn't reverse tests pyramidEnd-To-End tests are too long... 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. So it's all about reversing back our tests pyramid. 30. Step by step we are introducing a new architecture... 31. Remember that creating reversed tests pyramid and reversing it back will take some time... 32. Remember - WHY are we doing this? 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. Leave the world better then you found it 35. Beware of refactoring just for refactoring!Few final thoughts... 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. 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. False positive or false negative safety net is even worst than lack of a safety net... 39. Software quality in many cases could be understood as ability to introduce changes into software! 40. Wiktor onowski www.codesprinters.comQuestions? @streser http://medium.com/@streser http://blog.testowka.pl http://www.agileszkolenia.pl http://codesprinters.com