Post on 09-Jan-2017
Tips of Mobile Continuous Delivery
Anistar Sung
Anistar sung 宋志峰 APAC Yahoo Engineer Manger
Introduction
MOPCON 2013 tech talk deck http://www.slideshare.net/anistarsung/mopcon-share
What I Done in MOPCON 2013
MOPCON 2014 tech talk deck http://www.slideshare.net/anistarsung/mopcon-2014-best-software-architecture-in-app-development
What I Done in MOPCON 2014
Why we should do testingIs that wasting our time?
The following story is inspired by actual events
SOFTWARE TESTING IS NOT OPTIONAL
but it doesn’t have to be a burden
High Quality
Fast Delivery
Low Maintenance Cost
Continuous Delivery PipelineHow it works with CD pipeline
Continuous Delivery (CD) is a software engineering approach in which teams keep producing valuable software in short cycles and ensure that the software can be reliably released at any time.
Continuous Delivery
Wikipedia
“”
Automatic execute tasks to deliver production
Continuous Delivery Pipeline
Task A Task B Task C Release
Commit Automation ProductionCandidate
Continuous deliver productions with version control
Continuous Delivery Pipeline
Task A Task B Task C
Commit Automation ProductionCandidates
Commit A Candidate A
Continuous Delivery Pipeline
Task A Task B Task C
Commit Automation ProductionCandidates
Task A Task B Task C
Commit A Candidate A
Commit B Candidate B
Continuous Delivery Pipeline
Task A Task B Task C
Commit Automation ProductionCandidates
Commit A Candidate A
Each change should trigger next task
Continuous Delivery Pipeline
Task A Task B Task C
Commit Automation ProductionCandidates
Commit A Candidate A
Each change should trigger next task
Continuous Delivery Pipeline
Task A Task B Task C
Commit Automation ProductionCandidates
Commit A Candidate A
Each change should trigger next task
Continuous Delivery Pipeline
Task A Task B Task C
Commit Automation ProductionCandidates
Commit A Candidate A
Each change should trigger next task
Continuous Delivery Pipeline
Task A Task B Task C
Commit Automation ProductionCandidates
Task A Task B Task C
Commit A Candidate A
Commit B Candidate B
Continuous Delivery Pipeline
Task A Task B Task C
Commit Automation ProductionCandidates
Task A Task B Task C
Commit A Candidate A
Commit B Candidate B
Continuous Delivery Pipeline
Task A Task B Task C
Commit Automation ProductionCandidates
Task A Task B Task C
Commit A Candidate A
Commit B Candidate B
Continuous Delivery Pipeline
Commit Automation ProductionCandidates
Task A Task B Task CCommit B Candidate B
Someone should be notified if any part of pipeline fail
DemoUsing physical device to be the whistle
TVBS News Visits Yahoo Office
Quality Control
Everyone is responsible for the development
Everyone is responsible for the quality
Everyone is responsible for the delivery process
Quality Control
Mobile Continuous Delivery PipelineThe strategy of Mobile CD pipeline
Continuous Delivery Pipeline
Task A Task B Task C Release
Commit Testing ProductionCandidate
Mobile Continuous Delivery Pipeline
Commit Testing ProductionCandidate
CommitStage
AcceptanceTesting
Non-functionalTesting
Build and Test locally
Commit code after passing necessary testing
Creating a pull request for your code change
Pre Commit of CD pipeline
Pull request should be reviewed by senior developers
DON’T merge it without code review
Pre Commit of CD pipeline
Merge if PR can be built successfully and passing test
Pre Commit of CD pipeline
Mobile Continuous Delivery Pipeline
Commit Testing ProductionCandidate
CommitStage
AcceptanceTesting
Non-functionalTesting
Build and run Unit Test remotely
Commit Stage should be short and fast
Compile source code to build an App
Commit Stage of CD pipeline
Writing Unit Test but not like this one
Commit Stage of CD pipeline
Using Arrange-Act-Assert pattern to write Unit Test
Commit Stage of CD pipeline
Useless unit test sample
Commit Stage of CD pipeline
Unit test’s code coverage is important as well
Commit Stage of CD pipeline
Mobile Continuous Delivery Pipeline
Commit Testing ProductionCandidate
CommitStage
AcceptanceTesting
Non-functionalTesting
Asserting feature delivery is user expected
Implement Smoke Test and Function Test
Smoke Test - Checking foundational function is workable
Acceptance Test of CD pipeline
Functional Test - Checking major features is expected
Separated Test Case by priority - P0, P1, P2
Acceptance Test of CD pipeline
Writing Test Case for functional test
Acceptance Test of CD pipeline
TC13
Favorite store add
Given User launch the store app When User add a store on store page Then User can view store in favorite store
ID:
Subject:
Description:
Writing Test Case for functional test
Acceptance Test of CD pipeline
TC13
Favorite store add
Given User launch the store app When User add a store on store page Then User can view store in favorite store
ID:
Subject:
Description:1
23
Acceptance Test of CD pipeline
Given User launch the store app When User add a store on store page Then User can view store in favorite store
Description:1
23
Make functional test stable
iOS: AccessibilityAndroid: id
Acceptance Test of CD pipeline
storeBannerstoreTitleitemNum
Mobile Continuous Delivery Pipeline
Commit Testing ProductionCandidate
CommitStage
AcceptanceTesting
Non-functionalTesting
Assert App works at non-functional level
Performance Test and Stability Test
Performance test - Checking for App’s performance
Cold start time
Refresh time
CPU, Memory, Battery usage
Security
etc
Non-functional Test of CD pipeline
Stability test - Checking for App’s stability
Using Monkey Test to probe it
Non-functional Test of CD pipeline
Non-functional Test of CD pipeline
Making App alive in hard condition:
1. No crash in 5 hours
2. Trigger touch per 100 ms
3. Multiple touchs
4. Keep crazy
5. Avoid dead loop
Non-functional Test of CD pipeline
DemoMonkey test in dead loop
Permission
Jump out
Block
Key Success Factor for CDBuilding a high quality delivery team
Culture is the key factor to success or fail CD
Everyone is responsible for the quality
Plan stories with feature and testing
No accusing, trust members
Inspire innovation in your team
Building success team
DemoXingZhe - Testing script generator
在沒有很久的很久很久以前, 撰寫功能測試是⼀一件痛苦的事情。
當介⾯面設計有所改變時, 必須重新撰寫功能測試。
為此,我們從花果⼭山請來了 傳說中的猴⼦子⺩王孫⾏行者
透過撰寫Markdown 跟猴⼦子說⼈人話 就可以輕鬆產⽣生測試程式
因為寫的是⼈人話 使⽤用版本控制也能輕鬆追蹤修訂
簡單⼀一個 $ make
就像孫⾏行者拔⽑毛⼀一吹⼀一樣 測試程式就通通產⽣生出來啦!
XingZhe - The Monkey King
SOFTWARE TESTING IS NOT OPTIONAL
but it can be a good helper for quality
Anistar Sung APAC Yahoo Engineer Manger
http://www.facebook.com/anistarsung http://blog.riaproject.com
anistarsung@gmail.com cfsung@yahoo-inc.com
More information
Yahoo Related Sessions
Anistar R1/R2/R3 SAT 13:00
Harry R2 SAT 14:00
Howard R1 SUN 10:15
Roger R3 SUN 11:15
Tips of Mobile Continuous Deliver
Unleash The Power of Design
Apple Watch 開發
如何建⽴立⾏行動⽣生態圈
請到 104 搜尋 “Yahoo奇摩”MOPCON Yahoo 現場攤位 4F
Welcome join us
Q + A