what s that smell tidying up our test code
play

What's That Smell? Tidying Up Our Test Code Presented - PDF document

W15 Test Automation Wednesday, October 2nd, 2019 2:45 PM What's That Smell? Tidying Up Our Test Code Presented by: Angie


  1. ¡ ¡ W15 ¡ Test ¡Automation ¡ Wednesday, ¡October ¡2nd, ¡2019 ¡2:45 ¡PM ¡ ¡ ¡ ¡ ¡ What's ¡That ¡Smell? ¡Tidying ¡Up ¡Our ¡Test ¡ Code ¡ ¡ Presented ¡by: ¡ ¡ ¡ ¡ Angie ¡ ¡Jones ¡ ¡ Applitools ¡ ¡ Brought ¡to ¡you ¡by: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ 888 -­‑-­‑-­‑ 268 -­‑-­‑-­‑ 8770 ¡ ·√·√ ¡904 -­‑-­‑-­‑ 278 -­‑-­‑-­‑ 0524 ¡-­‑ ¡info@techwell.com ¡-­‑ ¡http://www.starwest.techwell.com/ ¡ ¡ ¡ ¡ ¡ ¡ ¡

  2. ¡ Angie ¡ ¡Jones ¡ ¡ Angie ¡Jones ¡is ¡a ¡Senior ¡Developer ¡Advocate ¡who ¡specializes ¡in ¡test ¡automation ¡ strategies ¡and ¡techniques. ¡She ¡shares ¡her ¡wealth ¡of ¡knowledge ¡by ¡speaking ¡and ¡ teaching ¡at ¡software ¡conferences ¡all ¡over ¡the ¡world, ¡as ¡well ¡as ¡writing ¡tutorials ¡and ¡ blogs ¡on ¡angiejones.tech. ¡As ¡a ¡Master ¡Inventor, ¡Angie ¡is ¡known ¡for ¡her ¡innovative ¡ and ¡out-­‑of-­‑the-­‑box ¡thinking ¡style ¡which ¡has ¡resulted ¡in ¡more ¡than ¡25 ¡patented ¡ inventions ¡in ¡the ¡US ¡and ¡China. ¡In ¡her ¡spare ¡time, ¡Angie ¡volunteers ¡with ¡Black ¡Girls ¡ Code ¡to ¡teach ¡coding ¡workshops ¡to ¡young ¡girls ¡in ¡an ¡effort ¡to ¡attract ¡more ¡women ¡ and ¡minorities ¡to ¡tech. ¡ ¡

  3. What's That Smell? What's That Smell? Tidying Up Our Test Code Tidying Up Our Test Code Angie Jones Angie Jones Senior Developer Advocate Senior Developer Advocate http://angiejones.tech http://angiejones.tech Director of Test Automation University Director of Test Automation University http://TestAutomationU.com http://TestAutomationU.com Applitools, San Francisco, CA, USA Applitools, San Francisco, CA, USA @techgirl1908 @techgirl1908

  4. @techgirl1908

  5. a CODE SMELL CODE SMELL is an implementation that is an implementation that violates fundamental design violates fundamental design principles in a way that may principles in a way that may slow down development and slow down development and increase the risk of future issues. increase the risk of future issues.

  6. APPLICATION APPLICATION UNDER UNDER TEST TEST @techgirl1908

  7. JAKE'S JAKE'S CODE CODE BASE BASE @techgirl1908

  8. LONG CLASS LONG CLASS The purpose of the class is The purpose of the class is multifold. multifold. To find anything, you must To find anything, you must scroll and scroll. scroll and scroll. @techgirl1908

  9. ISSUES ISSUES 1. No single responsibility 1. No single responsibility 2. Hard to find things 2. Hard to find things 3. Difficult to maintain 3. Difficult to maintain @techgirl1908

  10. SEPARATE SEPARATE CONCERNS CONCERNS @techgirl1908

  11. LONG METHOD LONG METHOD This guy does it all! This guy does it all! But it makes it hard to know But it makes it hard to know when to call. when to call. @techgirl1908

  12. ISSUES ISSUES 1. No single responsibility 1. No single responsibility 2. Confusing for callers 2. Confusing for callers 3. Difficult to read and understand 3. Difficult to read and understand @techgirl1908

  13. SPLIT SPLIT METHODS METHODS @techgirl1908

  14. DUPLICATE CODE DUPLICATE CODE When you find yourself When you find yourself coding in haste, coding in haste, it's very tempting it's very tempting to copy and paste. to copy and paste. @techgirl1908

  15. ISSUES ISSUES 1. Any change needed has to 1. Any change needed has to take place in multiple spots take place in multiple spots 2. Can lead to other smells 2. Can lead to other smells @techgirl1908

  16. REMOVE REMOVE DUPLICATION DUPLICATION @techgirl1908

  17. FLAKY LOCATOR STRATEGY FLAKY LOCATOR STRATEGY At this moment, At this moment, your locators work fine. your locators work fine. But can they But can they stand the test of time? stand the test of time? @techgirl1908

  18. ISSUES ISSUES 1. Fragility 1. Fragility 2. Unreliability 2. Unreliability @techgirl1908

  19. STABILIZE STABILIZE LOCATORS LOCATORS @techgirl1908

  20. INDECENT EXPOSURE INDECENT EXPOSURE � Too many see you. Too many see you. Your scope is too wide. Your scope is too wide. All who should know you All who should know you @techgirl1908

  21. ISSUES ISSUES 1. Violates encapsulation 1. Violates encapsulation 2. Allows tests to directly access 2. Allows tests to directly access and manipulate the DOM, and manipulate the DOM, which is not their responsibility which is not their responsibility @techgirl1908

  22. NARROW NARROW SCOPE SCOPE @techgirl1908

  23. INEFFICIENT WAITS INEFFICIENT WAITS The speed of machine The speed of machine is faster than man is faster than man so you slow it down so you slow it down any way you can. any way you can. @techgirl1908

  24. ISSUES ISSUES 1. Slows down runtime 1. Slows down runtime 2. Different environments may 2. Different environments may require different wait times require different wait times @techgirl1908

  25. WAIT WAIT INTELLIGENTLY INTELLIGENTLY @techgirl1908

  26. MULTIPLE POINTS OF FAILURE MULTIPLE POINTS OF FAILURE The framework's job The framework's job is to force state, is to force state, not to determine not to determine a test's fate. a test's fate. @techgirl1908

  27. ISSUES ISSUES 1. Violates single responsibility 1. Violates single responsibility 2. Limits reusuability 2. Limits reusuability @techgirl1908

  28. INCREASE INCREASE FLEXIBILITY FLEXIBILITY @techgirl1908

  29. QUESTIONS? QUESTIONS? @techgirl1908

  30. What's That Smell? What's That Smell? Tidying Up Our Test Code Tidying Up Our Test Code Angie Jones Angie Jones Senior Developer Advocate Senior Developer Advocate http://angiejones.tech http://angiejones.tech Director of Test Automation University Director of Test Automation University http://TestAutomationU.com http://TestAutomationU.com Applitools, San Francisco, CA, USA Applitools, San Francisco, CA, USA @techgirl1908 @techgirl1908

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend