Outside In: Using UI Tests to Start Improving Your App - UIKonf Berlin, 2016

Outside In: Using UI Tests to Start Improving Your App - UIKonf Berlin, 2016

Video:
https://www.youtube.com/watch?v=hYCUy-9yq_M

Quite a bit of theory and a bit of practice about how you can use UI tests to give yourself a framework to improve an existing, untested app without unintentionally breaking functionality for your users.

Video of XCUI tests running painfully slowly available here: https://youtu.be/XbqDFokGkQc

C4861b1dfdf3bbb21faec4a1acdf183d?s=128

Ellen Shapiro

May 23, 2016
Tweet

Transcript

  1. USING UI TESTS TO START IMPROVING YOUR APP Ellen Shapiro

    | UIKonf 2016 | Berlin, Germany spothero.com | justhum.com | @designatednerd
  2. THEORY VS PRACTICE

  3. THEORY

  4. TAKING OVER AN EXISTING APP

  5. TAKING OVER AN EXISTING APP WITH NO TESTS

  6. None
  7. None
  8. None
  9. None
  10. None
  11. None
  12. None
  13. None
  14. None
  15. None
  16. None
  17. DOES THIS WORK FOR THE USER?

  18. ADD A SCAFFOLDING OF UI TESTS AROUND YOUR APP

  19. ! BEFORE YOU START DEMOLITION ON THE EXISTING CODE

  20. UNIT TESTS VS UI TESTS

  21. UNIT TESTS

  22. UI TESTS

  23. SNAPSHOT TESTS VS INTEGRATION TESTS

  24. None
  25. INTEGRATION TESTING

  26. INTEGRATION TESTING

  27. PRACTICE

  28. XCUI VS KIF

  29. XCUI TESTING XCODE 7 / IOS 9+ / OS 10.11+

  30. APPLE BUILT IT

  31. APPLE BUILT IT TO FIT UIAUTOMATION

  32. ! BLACK-BOX STYLE TESTS TEST RECORDER

  33. TESTS IN ONE PROCESS APP IN ANOTHER PROCESS

  34. ! MOCKING IS IMPOSSIBLE TEST CODE IN YOUR APPLICATION

  35. ! MOCKING IS IMPOSSIBLE TEST CODE IN YOUR APPLICATION

  36. None
  37. KIF TESTING FACILITATING FUTURAMA JOKES SINCE JUNE 2011

  38. ! EASY MOCKING BACKWARDS-COMPATIBLE OPEN-SOURCE CODE

  39. ! EASY MOCKING BACKWARDS-COMPATIBLE OPEN-SOURCE CODE

  40. ! USES PRIVATE APIS LOTS OF CRUFT FOR BACKWARDS COMPATIBILITY

    INCONSISTENT (ESP. ON CI SERVERS)
  41. ! USES PRIVATE APIS LOTS OF CRUFT FOR BACKWARDS COMPATIBILITY

    INCONSISTENT (ESP. ON CI SERVERS)
  42. WHAT DO I USE?

  43. SIMPLE APPS: XCUI COMPLEX APPS: KIF

  44. SIMPLE APPS: XCUI COMPLEX APPS: KIF * AS OF A

    MONTH BEFORE WWDC 2016
  45. WHAT DO I TEST NEXT?

  46. CODE COVERAGE YOUR TESTING ASSISTANT

  47. CODE COVERAGE YOUR TESTING ASSISTANT

  48. None
  49. None
  50. None
  51. None
  52. None
  53. REMINDER

  54. ROBOTS ARE AWESOME, BUT THEY CANNOT REPLACE HUMAN TESTERS

  55. None
  56. OBLIGATORY SUMMARY SLIDE! > UI Tests give you user-centric feedback

    > UI Tests let you refactor confidently > Use XCUI for simple, KIF for complex stuff > Use Code Coverage to guide your testing > ! + " = ######
  57. LINKS (PT 1) XCUI WWDC Session: https:// developer.apple.com/videos/play/ wwdc2015-406/ ObjC.io

    on Snapshot Testing: https:// www.objc.io/issues/15-testing/ snapshot-testing/
  58. LINKS (PT 2) PSPDFKit "Ludicrous Speed" KIF: https:// pspdfkit.com/blog/2016/running-ui- tests-with-ludicrous-speed/

  59. PHOTO CREDITS (PT 1) 130320-Z-TK422-893 by the Oregon National Guard

    https://www.flickr.com/photos/ oregonmildep/8576624536/ Serious Scaffolding by Dan DeLuca https:// www.flickr.com/photos/dandeluca/ 3261603273/
  60. PHOTO CREDITS (PT 2) Gears by Joe deSousa https:// www.flickr.com/photos/mustangjoe/

    20437315996/