Top Banner
Best Practices for Mobile CI April 28, 2015
36
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: Best Practices in Mobile CI (webinar)

Best Practices for Mobile CI

April 28, 2015

Page 2: Best Practices in Mobile CI (webinar)

© Sauce Labs, Inc.

Presenters

Kevin Rohling

Co-founder / VP of Product at Emberlight

Founder/CEO of cisimple now [email protected]

Kristian Meier

Sales Engineer at Sauce Labs

Page 3: Best Practices in Mobile CI (webinar)

WHAT IS CONTINUOUS INTEGRATION FOR MOBILE?

AUTOMATICALLY…

Build Test Deploy

EVERY COMMIT.

Page 4: Best Practices in Mobile CI (webinar)

CONTINUOUS INTEGRATION

HOW DOES IT WORK

1. Developer commits code

Page 5: Best Practices in Mobile CI (webinar)

CONTINUOUS INTEGRATION

HOW DOES IT WORK

2. CI Server picks up the change.

Page 6: Best Practices in Mobile CI (webinar)

CONTINUOUS INTEGRATION

HOW DOES IT WORK

3. Code is automatically compiled

Page 7: Best Practices in Mobile CI (webinar)

CONTINUOUS INTEGRATION

HOW DOES IT WORK4. Tests are run

Page 8: Best Practices in Mobile CI (webinar)

CONTINUOUS INTEGRATION

HOW DOES IT WORK

5. Application is deployed

Page 9: Best Practices in Mobile CI (webinar)

CONTINUOUS INTEGRATION

WHY?

• Reduce the need for human-based testing

• Faster Feedback

• Automate EVERYTHING

Page 10: Best Practices in Mobile CI (webinar)

WHY DO I USE CI?

• No Touch Configuration

Page 11: Best Practices in Mobile CI (webinar)

WHY DO I USE CI?

• No Touch Configuration

• Automated OTA Distribution

Page 12: Best Practices in Mobile CI (webinar)

WHY DO I USE CI?

• No Touch Configuration

• Automated OTA Distribution

• Code Validation: Automated Builds and Tests

Page 13: Best Practices in Mobile CI (webinar)

ONE SIZE DOES NOT FIT ALL

Business Drivers Engineering Challenges

Early StartupInitial Traction,

FundingStability, UX

Consulting FirmClient Status Updates,

DeadlinesAd Hoc Distribution, Unit Testing

Large Product TeamRetention, Growth,

RevenueAutomation, Communication

PR

OC

ES

S

Page 14: Best Practices in Mobile CI (webinar)

MOBILE IS HARDER

• Infrastructure

Page 15: Best Practices in Mobile CI (webinar)

MOBILE IS HARDER

• Infrastructure

• Compilation/Code Signing

Page 16: Best Practices in Mobile CI (webinar)

MOBILE IS HARDER

• Infrastructure

• Compilation/Code Signing

• Testing

Page 17: Best Practices in Mobile CI (webinar)

MOBILE IS HARDER

• Infrastructure

• Compilation/Code Signing

• Testing

• Deployment

Page 18: Best Practices in Mobile CI (webinar)

SIMULATORS/EMULATORS vs DEVICES

SIMULATORS:

• Used by iOS, included w/ Xcode

• Execute i386 instruction set, not ARM

• Very fast compared to Emulators

• Do not have access to certain hardware functions

• (GPS, Bluetooth Radio, Accelerometers, etc)

Page 19: Best Practices in Mobile CI (webinar)

SIMULATORS/EMULATORS vs DEVICES

EMULATORS:

• Used by Android, included w/ Android SDKs

• Execute ARM (or native device instruction set)

• Very slow compared to Simulators

• Do not have access to certain hardware functions

• (GPS, Bluetooth Radio, Accelerometers, etc)

Page 20: Best Practices in Mobile CI (webinar)

SIMULATORS/EMULATORS vs DEVICES

DEVICES:

• Reproduces the actual performance experienced by your users

• The only way to catch manufacturer/OEM bugs

• Very expensive to configure and maintain compared

• Full access to hardware functions:

• (GPS, Bluetooth Radio, Accelerometers, etc)

Page 21: Best Practices in Mobile CI (webinar)

WHEN TO USE DEVICES vs SIMULATORS/EMULATORS?

• Simulators and Emulators are an excellent solution for running automated tests

during development. They are inexpensive and will reliably catch most problems.

• Physical Devices can be used on a lower frequency (i.e. pre-release, weekly,

daily, etc.). They are the only way to catch performance problems, test certain

hardware features and find OEM issues. In the least, devices should be used

before every release.

Page 22: Best Practices in Mobile CI (webinar)

UNIT TESTING

According to a recent survey:

-77% of developers said app quality is “very important or mission critical”

-80% of mobile developers test their apps manually

-Only 13% of mobile developers use automated testing

Page 23: Best Practices in Mobile CI (webinar)

UNIT vs FUNCTIONAL TESTING

• Unit Testing - testing small pieces of code

• Functional Testing - testing button clicks and UI interaction

Page 24: Best Practices in Mobile CI (webinar)

UNIT/FUNCTIONAL TESTING

BENEFITS:

• Instant Gratification (GREEN is good!)

• Repeatable

• Can automatically test every commit

Page 25: Best Practices in Mobile CI (webinar)

UNIT/FUNCTIONAL TESTING

CHALLENGES:

• Unit Tests are not users

• LOTs of work to write and maintain them

• Which framework to use?

Page 26: Best Practices in Mobile CI (webinar)

• What language/framework do your developers know?

• Open Source/Community Support

• 3rd Party Framework requirements

UNIT/FUNCTIONAL TESTING FRAMEWORKS

WHICH ONE TO USE?

Page 27: Best Practices in Mobile CI (webinar)

CI TOOLS/SERVICES FOR MOBILE

Good: Open Source, Lots of plugins

Bad: Self-Hosted, DIY solution

Jenkins

Page 28: Best Practices in Mobile CI (webinar)

CI TOOLS/SERVICES FOR MOBILE

Good: Hosted solution, OS X support, Lots of plugins

Bad: Tedious setup process

Travis CI

Page 29: Best Practices in Mobile CI (webinar)

CI TOOLS/SERVICES FOR MOBILE

Good: Hosted solution, Designed specifically for mobile, Easy setup

Bad: Less flexible than other solutions

Ship.io

Page 30: Best Practices in Mobile CI (webinar)

CI TOOLS/SERVICES FOR MOBILE

Good: Integrated w/ Xcode, Apple-Supported

Bad: Self-Hosted, iOS Only

Xcode CI

Page 31: Best Practices in Mobile CI (webinar)

Using the Sauce Labs Cloud with CI

Page 32: Best Practices in Mobile CI (webinar)

Sauce is the ideal Automated Testing Platform for CI

Page 33: Best Practices in Mobile CI (webinar)

© Sauce Labs, Inc.

Appium

• “Selenium for mobile apps” - uses the

WebDriver spec to simulate user actions on

iOS and Android

• Leverage your existing Selenium test

architecture to help speed apps to market

• Maximize test code reuse across platforms

makes developers more productive

• Development led by Sauce Labs

Appium is an open

source framework

that automates

testing of native,

hybrid and mobile

web apps.

Page 34: Best Practices in Mobile CI (webinar)

© Sauce Labs, Inc.

The Sauce Labs Platform

• Point your existing test

scripts to Sauce Labs

• We spin up a new,

pristine VM every time

• Run tests in parallel to

reduce test time

• Capture videos, logs and

test metadata

• Choose from over 500

browsers / OS

combinations

Page 35: Best Practices in Mobile CI (webinar)

Demo

Page 36: Best Practices in Mobile CI (webinar)

© Sauce Labs, Inc.

Learn more about Sauce Labs

• Sign up for a free trial of Sauce

Labshttps://saucelabs.com/signup/trial

• Watch a video

https://www.youtube.com/user/saucelabs