Testing on Mobile

Automating the Pain Away

Fil Maj / @filmaj

Agenda

  1. The Why (~5 mins)
    • Bugs and Regressions
    • Safety Net
    • Next Step: Continuous Integration
  2. The How (~10 mins)
    • Different Testing Approaches
    • Selenium as a Specification
    • Appium
  3. hacktimenao
    1. A few demos from me (~5-10 mins)
    2. Prerequisites
      • Mobile SDKs / Environments
      • Appium
    3. Identify what you want to test
    4. Let's write tests!

Ohai! I'm Fil

Ohai! who r u?

Designer? Developer? QA?

Why Test?

Audience Poll: Who does it?

Dedicated QA department?

Developers?

Unclear?

Why Test?

Audience Poll: What kind of testing?

Manual?

Unit?

Integration / End-to-End / Selenium?

Quality is everyone's responsibility.

Bugs

They suck. We have to fix them.

There's something worse than just a bug, though...

Regressions

A bug that, at one point, was identified and fixed, but at a later date, crept back into the product.

One of the biggest embarassments as a team delivering a product.

Preventing Regressions

  • You release version 1 of your product. Yay!
  • You realize there's a bug in it. Boo...
  • You fix the bug, but then you also write a little program to verify that the bug doesn't exist.
    This little program is a test!
  • You release version 2 of your product, which includes your bug fix. Yay!
  • Now every time you make a change, you run your test, effectively preventing you from ever releasing that same bug again.

LMAO, RIP, Bug

The Power of Testing

Testing is a safety net.

You are future-proofing your product.

Testing is a discipline and is everyone's responsibility.

Continuous Integration

Next-Level Testing Power Up: The Holy Grail

It is Two Things:

Your tests being automated - fire and forget

Your automated test suite running on every commit.

How to Test

So many ways to approach testing your product - as many ways as there are to building it.

Testing Approaches

Different ways of experiencing and slicing your product up:

  • Manual. Slow, error prone, human required.
  • Unit. Testing code at the granular unit/module/class level.
  • Visual. Does it look like what it's supposed to look like?
  • Integration. Once you put all the pieces together, does it work?

We will be focussing on Integration testing, a.k.a. End-to-End testing.

Selenium For The Win

(aka WebDriver)

Selenium is a tool that enables automation. It tells other software to do things for you.

What is WebDriver?

It is commonly referred to as Selenium (for maximum confusion)

It is a specification.

The spec is for an HTTP API.

This HTTP API serves as an abstraction over proprietary, closed and/or differing automation APIs.

Free and open-source.

How Selenium Works

Where Does It Work?

Desktop browsers (the initial Selenium target)

Today, thanks to Appium, all kinds of mobile goodness, too!

What is Appium?

An implementation (+extension) of the WebDriver specification...

... designed specifically for mobile (Android, iOS, FirefoxOS) platforms...

... allowing automation of native, hybrid and web applications.

srsly, mix-and-matching native/web automation is an amazingly powerful tool for all kinds of mobile products

Let's Get Hacking!

A few demos from me

Let's get SDKs set up: developer.apple.com, developer.android.com

Get Appium set up!

appium.io

npm install -g appium

or, if you're hardcore, github.com/appium/appium

Let's get everyone to writing a test!

My own set of tests as a starting point: github.com/filmaj/appium-test

Image Attribution

Quality sign

Software Bug

Safety Net

Hudson Icon

Hacking Tents