Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

20170302 tryswift tasting_tests

6,562 views

Published on

a talk at https://www.tryswift.co/tokyo

Published in: Software
  • Be the first to comment

  • Be the first to like this

20170302 tryswift tasting_tests

  1. 1. Tasting tests at Cookpad by @Kazu_cocoa for Try!SwiftTokyo
  2. 2. Kazuaki Matsuo( @Kazu_cocoa) : Cookpad Inc. Test Engineer / Software Engineer in Quality Lang: / / / Maintainer: Appium Ruby binding
  3. 3. 😋
  4. 4. A bunch of themes in tests
  5. 5. Test Level Focus on UI Tests
  6. 6. How UI Tests support our development
  7. 7. We should know about the test target 🍽
  8. 8. What is Cookpad?
  9. 9. https://www.similarweb.com/top-websites/category/food-and-drink/cooking-and-recipes
  10. 10. Cookpad for iOS(Japan and Global) 35 million users (include Web/mobile) 63 million users (include Web/mobile) 4Q and Full Year 2016 Results / https://cf.cpcdn.com/info/assets/wp-content/uploads/20170214121206/2016Q4en.pdf
  11. 11. Cookpad for iOS(Japan) 35 million users (include Web/mobile) 63 million users (include Web/mobile)
  12. 12. The app has been developed for a long time
  13. 13. How often Cookpad app changes Release cycle: 2weeks ~ 1month Code changes: 5,000 ~ 10,000 lines UI changes: Frequently(large or small)
  14. 14. kano-model and Japan market Must-be Attractive
  15. 15. Diachronic Quality for Mobile
  16. 16. take a break 🍵 Cookpad iOS app has been developed so long time. Must-be quality in Japan is high, especially crash free rate. 🍽🥗
  17. 17. Tasting how re-engineering the app with UI Tests😋🍴
  18. 18. We’ve been developed UI Tests for mobile since 2014
  19. 19. Why have we implemented this UI tests?🤔
  20. 20. Should we taste from? Writing unit tests before refactoring is sometimes impossible and often pointless. Re-Engineering Legacy Software
  21. 21. Basic strategy 👪 from Internal from External
  22. 22. Make checkable from external to internal Unit Tests UI Tests re-write/re-factor
  23. 23. Make checkable from external to internal Unit Tests UI Tests re-write/re-factor External
  24. 24. Make checkable from external to internal Unit Tests UI Tests re-write/re-factor Internal
  25. 25. Make checkable from external to internal Unit Tests UI Tests re-write/re-factor External
  26. 26. Make checkable from external to internal Unit Tests UI Tests re-write/re-factor
  27. 27. Unit tests for Re-Engineering Most developers would agree that unit test should be fully automated, Re-Engineering Legacy Software
  28. 28. Unit tests are not a silver bullet but the level of automation for other kind of tests(such as integration tests) is often much lower. Re-Engineering Legacy Software
  29. 29. UI Test should be automated One area that cries out for automation is UI testing. Re-Engineering Legacy Software
  30. 30. Test Pyramid UI Tests Integration Tests Unit Tests Manual Testing
  31. 31. Flipped pyramid make development cycle slow Unit Tests UI Tests Manual Testing Integration Tests
  32. 32. Flipped pyramid make development cycle slow Unit Tests UI Tests Manual Testing Integration Tests the largest area to check the app
  33. 33. Flipped again UI Tests Integration Tests Manual Testing Unit Tests 🔀Unit Tests UI Tests Manual Testing Integration Tests
  34. 34. Conduct tests for combinations 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 10.0 iPhone ● ● ● ● ● ● ● iPad ● ● ● iPad Pro ●
  35. 35. Automated UI Tests help Re-Engineering 2015/3 2017/2
  36. 36. implement the strategy
  37. 37. We’ve been developed UI Tests since 2014
  38. 38. Architecture for UI Tests Scenarios steps wrapper Appium Binding Focus on User Scenario Convert scenarios to Ruby code Appium/other utils Focus on iOS side 👪
  39. 39. Scenarios with data-driven testing feature: A user can search several words via search field background: given Conduct tests with ‘iPhone’ device scenario_outline: Users can see search results when I login with <user_status> when I search <search_words> via search fields then I swipe down ‘3’ times then I can see ‘xxx’ on the display example: | user_status | search_words | | 'ps' | 'sushi' | | 'non-ps' | '🍣' | | 'guest' | 'sukiyaki' |
  40. 40. steps/wrapper/bindings step "Conduct tests with :device device" do |device| start_device(device) end def start_device(device) driver_start_with(desired_capabilities: des_app_caps, server_caps: des_server_caps) set_location(DEFAULT_LOCATION) close_initial_information(device) end
  41. 41. 🍛Seasoning🍲
  42. 42. Reduce dependency from internal product code find_element :xpath, “//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[1]” ❌
  43. 43. Reduce dependency from internal product code find_element :xpath, “//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[1]” ❌ Strongly depends on view structures
  44. 44. Reduce dependency from internal product code find_element :xpath, “//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[1]” ❌ find_element :accessibility_id, “an arbitrary identifier” ⭕
  45. 45. Don't conduct tests for all boundaries in UI Tests
  46. 46. more 🍛🌶
  47. 47. image diff e.g. Broken the order of Allow/Cancel button
  48. 48. image diff e.g. Broken the order of Allow/Cancel button
  49. 49. Request counts
  50. 50. Request counts
  51. 51. Re-Engineering re-write/re-factor without fear for developers
  52. 52. introduce Swift
  53. 53. faster🚴 and more stable
  54. 54. Conclusion Quality, Environment and Services change frequently in Mobile UI Tests support Re-Engineering 🍽🥗 🍛🍲
  55. 55. Do you get motivations to challenge automated UI Tests? 🙌
  56. 56. Don’t forget this kind of challenges can’t do in developer’s spare time 🍝 ≠ 🍜
  57. 57. Thanks for listening😋

×