Kazuaki Matsuo
International Business Development
Product/Engineering Group
What/How To Design
Test Automation
for Mobile
Cookpad Inc.Feb 10th, 2018
Who I am
2
Kazuaki Matsuo
• International Business Development Product/Engineering Group
• Software Engineer in Quality
• Social Media
• Twitter: @Kazu_cocoa, GitHub: KazuCocoa
• OSS: Appium Project
Why do you evolve
test automation?
3
Okay, let’s go
4
Motivations
• Build fast feedback cycle
• Make test deterministic
• Design and build product lines
• Build “Culture of automation” to be autonomous organisation
By the way,
5
Can you work with the same context?
A: What about this integration test?
B: Well… we should use mock to make them stable.
A: I won’t use mocking since it hides real world.
B: I see, but without mock, the test may be flaky.
A: This is integration and my understanding of the type is less
mocking and close to in the wild, though…
In this session, you can learn
6
Concepts and Ways you go
• Concepts for automated test design / plan
• How adapt them to real projects/products
• Cookpad International applications
• Cookpad Japan applications
In this session, you can learn
7
Concepts and Ways you go
• Concepts for automated test design / plan
• How adapt them to real projects/products
• Cookpad International applications
• Cookpad Japan applications
Won’t talk about
business/humans/
techniques/tools
Scope Phase Level sIze Type
Scope
9
What is your test target?
Entire system?
10
Entire system?
11
Entire system?
12
Entire system?
13
Focus on the mobile
14
Focus on the mobile
15
The app has some UI flows
16
The app has some UI flows
17
Focus on UI flow?
18
Focus on UI flow?
19
Focus on UI flow?
20
Focus on UI flow?
21
More internal process?
22
More internal process?
23
More internal process?
24
Thus,
25
Thus,
26
Thus,
27
Scope Phase Level sIze Type
29
Phase
What phase do you focus?
What phase would you like to automate?
30
What phase would you like to automate?
31
Timeline for release
What phase would you like to automate?
32
release
What phase would you like to automate?
33
unit test
component
test
coding
low-level
design
integration
test
high-level
design
system
test
acceptance
test
specification
analyse
requirement
What phase would you like to automate?
34
unit test
component
test
coding
low-level
design
integration
test
high-level
design
system
test
acceptance
test
specification
analyse
requirement
Phase for development or production
35
Phase for development or production
36
release
What phase would you automate?
37
In Development
What phase would you automate?
38
In Production
What phase would you automate?
39
In Development
In Production
Scope Phase Level sIze Type
41
Level
How deep do you dive to
automation world?
What activity is the target?
42
Plan/Design Implement Run
Analyse

The Results
How deep would you like to drill down?
43
https://blog.appdiff.com/test-autonomy-levels-7de7967d030e
0. Manual Testing
1. Scripted Testing
2. Exploratory Bots
3. Human-Directed
4. Generative
5. Fully Autonomous
Scope Phase Level sIze Type
45
Size
What size to you test?
Test Pyramid
46
UI Tests
Integration Tests
Unit Tests
47
UI Tests
Unit Tests
manual testing
Integration Tests
Test Pyramid
Test Size
48http://techlife.cookpad.com/entry/2016/08/13/test-size-for-mobile

https://testing.googleblog.com/2010/12/test-sizes.html
feature Small Medium Large Enormous
network no localhost localhost/yes yes
system access no partial/yes yes yes
OS(APIs) no yes yes yes
View no partial yes yes
external system no no no yes
time per a test < 100ms < 2s < 120s < 500s
Scope Phase Level sIze Type
50
Type
What type do you test?
Agile Testing Quadrants
51
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Agile Testing Quadrants
52
Unit Tests
Component Tests (code level)
Testing Connectivity
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Agile Testing Quadrants
53
Example
A/B Tests
Story Tests (Written First)
UX (User Experience) Testing
Prototypes (paper/wireframes)
Simulations
Unit Tests
Component Tests (code level)
Testing Connectivity
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Agile Testing Quadrants
54
Example
A/B Tests
Story Tests (Written First)
UX (User Experience) Testing
Prototypes (paper/wireframes)
Simulations
Unit Tests
Component Tests (code level)
Testing Connectivity
Exploratory Testing
Workflows
System Integration
(business oriented)
Usability Testing
User Acceptance Testing
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Agile Testing Quadrants
55
Example
A/B Tests
Story Tests (Written First)
UX (User Experience) Testing
Prototypes (paper/wireframes)
Simulations
Unit Tests
Component Tests (code level)
Testing Connectivity
Exploratory Testing
Workflows
System Integration
(business oriented)
Usability Testing
User Acceptance Testing
Performance Testing
Load Testing
Security Testing
Quality Attributes (…ilities)
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Agile Testing Quadrants
56
Example
A/B Tests
Story Tests (Written First)
UX (User Experience) Testing
Prototypes (paper/wireframes)
Simulations
Unit Tests
Component Tests (code level)
Testing Connectivity
Exploratory Testing
Workflows
System Integration
(business oriented)
Usability Testing
User Acceptance Testing
Performance Testing
Load Testing
Security Testing
Quality Attributes (…ilities)
Outside-in
Barrier-free
Collaborative
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Scope Phase Level sIze Type
Adapt the design to
real products
58
Cookpad Android
for Global
59
Before stepping into concrete design…
60
Define your ideal product line
• What is your team’s ideal product line?
• To achieve the line, what kind of activities would you automate?
• Planning/Designing test automation as well
Apply SPLIT
61
Scope Phase Level sIze Type
Apply SPLIT
62
Scope Phase Level sIze Type
Android provides concept
for “Test Size” officially
Split entire system to some parts
63
Scope
64
Scope 1 / 4
65
Scope 2 / 4
66
Scope 3 / 4
67
Scope 4 / 4
68
Phase
69
In Development
In Production
Phase
70
In Development
Size
71
UI Tests
Integration Tests
Unit Tests
Size
72
UI Tests
Integration Tests
Unit Tests
Size
73
UI Tests
Integration Tests
Unit Tests
New
New
Size
74
Size
75
L: UI Component based
M: Integration Tests
S: Unit Tests
E: User Scenario based
Size
76
L: UI Component based
M: Integration Tests
S: Unit Tests
E: User Scenario based
Size
77
L: UI Component based
M: Integration Tests
S: Unit Tests
E: User Scenario based
Size
78
L: UI Component based
M: Integration Tests
S: Unit Tests
E: User Scenario based
Size
79
L: UI Component based
M: Integration Tests
S: Unit Tests
E: User Scenario based
Type
80
Example
A/B Tests
Story Tests (Written First)
UX (User Experience) Testing
Prototypes (paper/wireframes)
Simulations
Unit Tests
Component Tests (code level)
Testing Connectivity
Exploratory Testing
Workflows
System Integration
(business oriented)
Usability Testing
User Acceptance Testing
Performance Testing
Load Testing
Security Testing
Quality Attributes (…ilities)
Outside-in
Barrier-free
Collaborative
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Type
81
Example
Story Tests (Written First)
Unit Tests
Component Tests (code level)
Testing Connectivity
User Acceptance Testing
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Convince other members with SPLIT
82
In the real world…
83
Current status ( Jan, 2018 ~ Feb, 2018)
84
L: UI Component based
M: Integration Tests
S: Unit Tests
E: User Scenario based
Scope Phase Level sIze Type
Cookpad Android/iOS
for Japan
86
History
87
Cookpad Android / iOS run long history
following with Android / iOS platforms evolution
History
88
Cookpad Android / iOS run long history
following with Android / iOS platforms evolution
https://academy.realm.io/posts/tasting-tests-at-cookpad-try-swift-2017/
Current status ( Sep?, 2014~ Feb, 2018)
89http://techlife.cookpad.com/entry/2016/08/13/test-size-for-mobile
L: UI Component based
M: Integration Tests
S: Unit Tests
E: User Scenario based
90
L: UI Component based
M: Integration Tests
S: Unit Tests
E: User Scenario based
http://techlife.cookpad.com/entry/2016/08/13/test-size-for-mobile
some of manual test

for regressions
Current status ( Sep?, 2014~ Feb, 2018)
91
Cookpad iOS
for Global
Any plan or design?
92
No particular entire plan / design
• but, one interesting automaton
Type
93
Example
A/B Tests
Story Tests (Written First)
UX (User Experience) Testing
Prototypes (paper/wireframes)
Simulations
Unit Tests
Component Tests (code level)
Testing Connectivity
Exploratory Testing
Workflows
System Integration
(business oriented)
Usability Testing
User Acceptance Testing
Performance Testing
Load Testing
Security Testing
Quality Attributes (…ilities)
Outside-in
Barrier-free
Collaborative
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Type for Android
94
Example
Story Tests (Written First)
Unit Tests
Component Tests (code level)
Testing Connectivity
User Acceptance Testing
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Automate performance testing
95
Performance Testing
Business Facing
Technology Facing
GuideDevelopment
CritiquetheProduct
http://www.informit.com/articles/article.aspx?p=2253544&ranMID=24808
Challenge to integrate performance testing in CI
96
before after
Measure performance for particular scenarios
Challenge to integrate performance testing in CI
97
before after
Measure performance for particular scenarios
Challenge to integrate performance testing in CI
98
before after
Measure performance for particular scenarios
resources/tools
99
Tools
100
• Common

• Appium, appium_lib

• fastlane, RSpec, Turnip, turnip_formatter

• KazuCocoa/http_proxy, tomakehurst/wiremock, Kobold

• Android

• JUnit 4, AssertJ, Truth, Espresso, FindBugs(SpotBugs), Composer

• Robolectric, Powermock, Mockito

• KazuCocoa/droid-monitor, KazuCocoa/droid_adbs, KazuCocoa/DroidTestHelper

• iOS

• XCTest(XCUITest), EarlGrey, wix/AppleSimulatorUtils

• OCMock, OHHTTPStubs
Scope Phase Level sIze Type
kazuaki-matsuo@cookpad.com
@Kazu_cocoa
Thank you
102

CookpadTechConf2018-(Mobile)TestAutomation