Testing In A Hybrid World

Fil Maj, Master Exploder, Adobe

What I Do

  • Work on Apache Cordova
  • Drink beer
  • Watch hockey
  • Drink beer

Quick Recap: wtf is PhoneGap?

  • Framework that helps you build native applications
  • You write your app with HTML, CSS and JavaScript
  • "wrap" it up with PhoneGap
  • Boom: native app based on web tech
  • Bonus: you can access device APIs through JavaScript


Who works on a web and/or native application?

Who has a test suite for their app?

Who runs tests for their app?

Bonus: how often are tests run?

Testing, cont.

Who cares?

Biggest embarassment as a programmer: regressions

Be disciplined at your craft: write a test for each bug

Run your tests after each change. This will prevent regressions.

Testing Desktop

(and native mobile apps)

Established testing methods already in place.

  • Selenium for desktop web apps
  • Proprietary instrumentation for native mobile apps
  • Automation available

Testing Mobile Web

Not so easy.

  • "Rent" time from a device testing service
  • No automation
  • So: not much different from a monkey or robot

Testing Hybrid Apps (PhoneGap)

You get the worst of both worlds!

Introducing: medic

A distributed continuous integration testing system built for the mobile web


Continuous Integration

CI automates the testing process. You get continuous feedback as your codebase evolves - in real-time


Medic takes JavaScript test suites and deploys it to real mobile devices

Currently supports Android, iOS and BlackBerry 10


Uses adapter(s) built on top of popular JavaScript testing frameworks to report results

Currently supports Jasmine BDD


---> <---
  • Each medic is a CI machine with connected mobile devices
  • Each medic runs tests
  • Each medic sends test results to single CouchDB server that aggregates test results
  • Test results are displayed on a CI Dashboard

How PhoneGap Uses It

We run our HTML test suite (mobile-spec) with it

This makes sure the PhoneGap JavaScript API is working properly across a slew of devices after every commit

The medic Vision

A portable device testing lab! Clients have issues? No problem, have them install medic, send your configuration to them, and get back results.



Next: Canucks vs. Flames at The Pint

Come Join Us!