Top Banner
Cookpad Tech Kitchen #2 ~ continuous delivery for iOS ~
61

20160913 cookpad ios_en

Feb 18, 2017

Download

Software

Kazuaki MATSUO
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 20160913 cookpad ios_en

Cookpad Tech Kitchen #2~ continuous delivery for iOS ~

Page 2: 20160913 cookpad ios_en

Cookpad(domestic)

2

Page 3: 20160913 cookpad ios_en

Cookpad(domestic)

3

2016年12月期 第2四半期 https://cf.cpcdn.com/info/assets/wp-content/uploads/20160809153218/2016.2Qir.pdf

Page 4: 20160913 cookpad ios_en

Cookpad(world)

4

Page 5: 20160913 cookpad ios_en

Cookpad(world)

5

2016年12月期 第2四半期 https://cf.cpcdn.com/info/assets/wp-content/uploads/20160809153218/2016.2Qir.pdf

Page 6: 20160913 cookpad ios_en

my.name // Kazuaki Matsuo my.role // Test Engineer my. // @Kazu_cocoa my. // KazuCocoa my. // kazucocoa.wordpress.com

let my = Profile()

6

Page 7: 20160913 cookpad ios_en
Page 8: 20160913 cookpad ios_en

Agenda✓About our development style ✓ relationship between departments

✓ Dev process / flow ✓Ice break ✓ Test strategy ✓ Test tools / tips ✓Testing strategy and what test we run ✓ UI Testing

8

Page 9: 20160913 cookpad ios_en

Our relationship

~ departments ~

9

Page 10: 20160913 cookpad ios_en

Relationship(2014)

mobile first department

Mobile app engineersService engineers10

Page 11: 20160913 cookpad ios_en

Relationship(2015)

mobile infrastructure

11

Mobile app engineersService engineers

Page 12: 20160913 cookpad ios_en

Relationship(2016)

mobile infrastructure

12

Mobile app engineersService engineers

Page 13: 20160913 cookpad ios_en

Our relationship

~ roles in iOS development ~

13

Page 14: 20160913 cookpad ios_en

Owner

test engineers

designers

directors

iOS engineers

Our roles(2016)

14

Page 15: 20160913 cookpad ios_en

Our dev cycleOur dev process

15

Page 16: 20160913 cookpad ios_en

previous release

Deadline of Pull Request

Code Freeze submit release

about a month

5 days2 weeks 3 days 4 days

Dev cycle

🍎🍏

16

Page 17: 20160913 cookpad ios_en

Dev process

🍎

design/implement/check

🍏

17

submit release

Page 18: 20160913 cookpad ios_en

Today’s focus point

18

Page 19: 20160913 cookpad ios_en

Today’s focus pointDev Flow ~ PR ~

Pact for iOS

UI Testing

19

Page 20: 20160913 cookpad ios_en

Today’s focus point

UI Testing

20

Page 21: 20160913 cookpad ios_en

Today’s focus point

Pact for iOS

21

Page 22: 20160913 cookpad ios_en

Today’s focus pointDev Flow ~ PR ~

22

Page 23: 20160913 cookpad ios_en

What I talked

23

✓ About Cookpad

✓ Our relationship between departments

✓ Our role in iOS development

✓ Our development cycle and process

✓ Who is going to proceed talking each topics

Page 24: 20160913 cookpad ios_en

My role and work

~ Focus on technical activities ~

24

Page 25: 20160913 cookpad ios_en

~ pyramid ~

25

Our test strategy

Page 26: 20160913 cookpad ios_en

Small

Medium

Large

Enormous

manual

Our test strategy

26http://techlife.cookpad.com/entry/2016/08/13/test-size-for-mobile

Page 27: 20160913 cookpad ios_en

Small

Medium

Large

Enormous

http://techlife.cookpad.com/entry/2016/08/13/test-size-for-mobile

Our test strategy

27

manual

Page 28: 20160913 cookpad ios_en

✓ Automated tests ✓ running tests, judgement the results ✓ GUI Testing ✓ HTTP Requests check ✓ …

✓ Manual tests ✓ new features ✓ difficult to run automatically ✓ exploratory testing

What we checkin test size L/E

28

Page 29: 20160913 cookpad ios_en

✓ Automated tests ✓ running tests, judgement the results ✓ GUI Testing ✓ HTTP Requests check ✓ …

✓ Manual tests ✓ new features ✓ difficult to run automatically ✓ exploratory testing

What we checkin test size L/E

29

Page 30: 20160913 cookpad ios_en

~ GUI Test / Scenario Test ~ ~ L/E size ~

UI Testing

30

Page 31: 20160913 cookpad ios_en

✓ Run tests based on scenarios

✓ We cover over 80% screen transitions

✓ Frequency we run tests

✓ arbitrary timing or before release the app

Test cases

31

Page 32: 20160913 cookpad ios_en

✓ Scenario based automated test

✓ Capture HTTP requests

✓ Screen captures

✓ Image diff

Our automated tests

32

Page 33: 20160913 cookpad ios_en

✓ Unexpected broken scenario

✓ Unexpected broken network traffic

✓ Unexpected broken layout

✓ Crashes

What we can find out

33

Page 34: 20160913 cookpad ios_en

Unexpected brokennetwork traffic

34

Page 35: 20160913 cookpad ios_en

Unexpected brokennetwork traffic

35

Page 36: 20160913 cookpad ios_en

Example of traffics

36

Page 37: 20160913 cookpad ios_en

only for iOS8.2Unexpected broken

layoutsOrder of Dialog Button

is revered

37

Page 38: 20160913 cookpad ios_en

only for iOS8.2Unexpected broken

layouts

Here is diff

38

Page 39: 20160913 cookpad ios_en

Expected layoutsexcept for iOS8.2

This order is correct

39

Page 40: 20160913 cookpad ios_en

✓ Easy to figure out what kind of unexpected defects caused

✓ Regression test

✓ Humans can do other creative activities, other tasks and so on while running the automated tests

Advantage ofautomated tests

40

Page 41: 20160913 cookpad ios_en

✓ If we run all tests with manual

✓ Scenario/GUI diff

✓ It takes around a few hours per a device at least

✓ We run several devices per release

✓ We can reduce human resources to do this kind of tasks

Costs

41

Page 42: 20160913 cookpad ios_en

iOS 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 10.0

iPhone ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ -

iPad ◯ ◯ ◯ ◯ ◯ ◯ ◯ ◯ -

iPad Pro ◯ ◯ ◯ ◯ -

✓ ◯: select devices we run tests

✓ 6~8 devices per a release

✓ iOS8.0 was removed from Xcode

✓ Do test partially with manual

Combination

42

Page 43: 20160913 cookpad ios_en

http://www.slideshare.net/KazuMatsu/20141018-selenium-appiumcookpad

Architecture

Test scenario / wrapper / frameworks

43

Page 44: 20160913 cookpad ios_en

✓ We should update scenario every release

✓ BTW, other libraries and wrappers are updated only to solve unstable environment

✓ We can update scenario within a day

✓ Include libraries and wrappers

✓ We can do other tasks except for automated test

Maintenance costs

44

Page 45: 20160913 cookpad ios_en

✓ Currently, we try convert Objective-C to Swift

Code changes

45

Page 46: 20160913 cookpad ios_en

✓ Keeping 99.9% crash free users

Crashes(Answer)

46

Page 47: 20160913 cookpad ios_en

✓ What is our motivation to enhance test automation

✓ 2014/1~: I joined to Cookpad ✓ I’m first test engineer

✓ Test is not only my activity

✓We’d like to ensure minimum quality to release the application

Motivation

47

Page 48: 20160913 cookpad ios_en

~ our work ~

UI Testing

48

Page 49: 20160913 cookpad ios_en

✓ include libraries and scenarios

✓ Appium 0.18.0 ~>

How long have wedeveloped this tests?

49

Page 50: 20160913 cookpad ios_en

✓ We should define concrete plans to tests ✓ What kind of test should we plan? ✓ We should consider software design,

configuration and so on against software tests

✓ I used Mindmap to arrange test targets

How to design tests

50

Page 51: 20160913 cookpad ios_en

Maindmap

51

Page 52: 20160913 cookpad ios_en

Example of mind maps

52

Page 53: 20160913 cookpad ios_en

~ tool stack for iOS ~

UI Testing

53

Page 54: 20160913 cookpad ios_en

✓ UI Testing ✓ Appium (JavaScript) ✓ Turnip/RSpec (Ruby) ✓ EarlGrey (Objective-C/Swift) ✓ WebDriverAgent(Objective-C)

✓ image diff ✓ kobold (JavaScript)

✓ Others ✓ wiremock (Jave) ✓ http_proxy (Elixir)

Tool stack for iOS

54

Page 55: 20160913 cookpad ios_en

✓ UI Testing ✓ Appium (JavaScript) ✓ Turnip/RSpec (Ruby) ✓ EarlGrey (Objective-C/Swift) ✓ WebDriverAgent(Objective-C)

✓ image diff ✓ kobold (JavaScript)

✓ Others ✓ wiremock (Jave) ✓ http_proxy (Elixir)

Tool stack for iOS

55

Page 56: 20160913 cookpad ios_en

Appium

56

Page 57: 20160913 cookpad ios_en

✓ Backend differ from:

✓ Appium 1.6.x

✓ WebDriverAgent for xcuitest strategy

✓ UIAutomator for appium strategy

✓ Before Appium 1.5.x

✓ UIAutomator for appium strategy

✓ Appium try to solve problems between iOS <=> Appium Server

✓ Users only know about interface against Appium server

Appium

57

Page 58: 20160913 cookpad ios_en

EarlGrey

58

Page 59: 20160913 cookpad ios_en

✓ XCUITest supports over iOS9 ✓ Cookpad supports iOS8.0

✓ Lifecycle of XCUITest is same as XCTest ✓ So, we can’t clean environment

every tests. ✓ e.g. Permission dialog ✓ This make tests flaky.

✓ BTW, we should do XCUITest based UI Testing in the future.

How about XCUITest ?

59

Page 60: 20160913 cookpad ios_en

Others✓ image diff ✓ kobold (JavaScript)

✓ Others ✓ wiremock (Jave) ✓ http_proxy (Elixir)

60

Page 61: 20160913 cookpad ios_en

End

61