2012 mobile testingsummit-moet

19
1 MOET https://github.com/eing/moet Mobile End-to-End Testing Mobile Exploratory Testing Eing Ong Intuit, Inc. @eingong|[email protected] 1

description

 

Transcript of 2012 mobile testingsummit-moet

Page 1: 2012 mobile testingsummit-moet

1

MOET

https://github.com/eing/moet Mobile End-to-End Testing Mobile Exploratory Testing

Eing Ong

Intuit, Inc. @eingong|[email protected]

1

Page 2: 2012 mobile testingsummit-moet

2

Mobile  automation  technologies

•  Two categories •  Instrumented technique •  Non-instrumented technique

•  What is instrumentation? •  Tests are compiled with the app •  Tests are installed & launched with the app •  Source code is required and may need to be modified •  Only one app can be executed at a time •  White box approach

Page 3: 2012 mobile testingsummit-moet

3

Advantages  of  both  techniques

Non-­‐‑instrumentation Instrumentation

•  Device  platform  agnostic •  Test  code  reuse •  Test  language  &  test  harness  

autonomy •  Support  for

Multi-­‐‑applications  testing Custom  composite  UI  elements Database/server  API  assertions Use  of  external  libraries  (e.g.  hardware/image  libraries)

•  Elements  can  be  accessed •  Debugging  ease •  Test  verification  ease •  Reduce  tools  dependencies •  Support  for

Installing  application Launching  application Cleanup  (kill  application) Test  execution  on  device Code  coverage

Page 4: 2012 mobile testingsummit-moet

4

Which  technique  should  I  use  ?

Text-­‐‑based  features

Image  based  features

Hardware  interaction

External  interaction

Instrumentation Non-instrumentation

Page 5: 2012 mobile testingsummit-moet

5

Mobile  automation  tools

Mobile   OS

Non-­‐‑instrumentation

Instrumentation

Android eggPlant,  Sikuli,  MOET,  MonkeyRunner

Robotium,  Calabash,  MonkeyTalk

iOS eggPlant,  Sikuli,  MOET UIAutomation,  KIF,  iCuke,  Frank,  UISpec,  Zucchini,  Bwoken,  Calabash,  MonkeyTalk,  Applecart,  iOS-­‐‑driver

Page 6: 2012 mobile testingsummit-moet

6

touch(100,100)

enter(username) touch(100,200)

enter(password)

touch(150, 300)

void enter()

void touch(x,y)

Login(“user1”,”passwd1”) Test

iPhone Sikuli library

iPhone implementation

MOET

•  Think design o  Interfaces o  Creational pattern

•  Think reuse o  Device independent tests

•  Think One o  IDE o  Test harness and language

Page 7: 2012 mobile testingsummit-moet

7

Anatomy  of    MOET

iPhone  application  implementation

Android  MonkeyRunner  Library

Device  Independent  Tests

Simulator/Device libraries

Mobile  Application  Interface

Runtime binding

iPhone  Sikuli  Library

Android  application  implementation

Page 8: 2012 mobile testingsummit-moet

8

Top Ten Wish List

a.k.a.

Mobile test automation

Wall of Pain

8

Page 9: 2012 mobile testingsummit-moet

9

Android  Wall  of  Pain

10.  There’s more to test execution o  Command with report file generation :

adb shell am instrument -w -e reportFile junit-report.xml com.intuit.test/com.zutubi.android.junitreport.JUnitReportTestRunner

o  Date-time fix if using device snapshots : adb shell date -s `date +"%Y%m%d.%H%M%S”`

9.  Where are the test results ? o  Pulling results from device :

adb pull /data/data/com.intuit.test/files/junit-report.xml junit-report.xml

Page 10: 2012 mobile testingsummit-moet

10

Android  Wall  of  Pain

10.  There’s more to test execution o  Command with report file generation :

adb shell am instrument -w -e reportFile junit-report.xml com.intuit.test/com.zutubi.android.junitreport.JUnitReportTestRunner

o  Date-time fix if using device snapshots : adb shell date -s `date +"%Y%m%d.%H%M%S”`

9.  Where are the test results ? o  Pulling results from device :

adb pull /data/data/com.intuit.test/files/junit-report.xml junit-report.xml

Page 11: 2012 mobile testingsummit-moet

11

iOS  Wall  of  Pain

8.  iOS simulator…the singleton pattern o  Multiple instances of simulator o  Headless execution

7.  What test harness ? o  Test grouping, test assertions, base test class o  Results needs to be displayable in browser

6.  How about a CI plugin o  Test execution o  Code coverage

Page 12: 2012 mobile testingsummit-moet

12

iOS  Wall  of  Pain

8.  iOS simulator…the singleton pattern o  Multiple instances of simulator o  Headless execution

7.  What test harness ? o  Test grouping, test assertions, base test class o  Results needs to be displayable in browser

6.  How about a CI plugin o  Test execution o  Code coverage

Page 13: 2012 mobile testingsummit-moet

13

iOS  Wall  of  Pain

8.  iOS simulator…the singleton pattern o  Headless execution o  Multiple instances of simulator

7.  What test harness ? o  Test grouping, test assertions, base test class o  Results needs to be displayable in browser

6.  How about a CI plugin o  Test execution o  Test results o  Code coverage

Page 14: 2012 mobile testingsummit-moet

14

iOS  Wall  of  Pain

5.  Where’s the IDE plugin ? o  Code formatting o  API completion o  Breakpoints, debugger o  “javadoc” help o  One click test execution of test method/testsuite

Page 15: 2012 mobile testingsummit-moet

15

All  mobile  platforms

4.  Problem ? Search ? o  Blogs, stackoverflow, developer groups for devices, etc. o  Mobile testing one-stop tips & tricks (not questions) o  Community driven effort

Tip – Remove authorization prompt

Administrative rights Update /etc/authorization

<key>system.privilege.taskport</key> <dict> <key>allow-root</key> <!-- previous value <false/> --> <true/>

Tip – Clean cache, preferences, SQLite ~/Library/Application Support/iPhone Simulator/{SDK}/Applications/<uuid>

Library: Preferences, Caches Documents: sqlite3 <app>.sqlitedb

Page 16: 2012 mobile testingsummit-moet

16

All  mobile  platforms

3.  How about a mobile test report ?

o  Mobile test report standard e.g. mobile-test-report.xml •  Screenshots and video recording of failed tests •  Device logs •  Device detection

2.  Wireless?

o  OTA app installation o  Testing via wifi and carrier networks o  Selenium grid-like test infrastructure

Page 17: 2012 mobile testingsummit-moet

17

All  mobile  platforms

3.  How about a mobile test report?

o  Mobile test report standard e.g. mobile-test-report.xml •  Screenshots and video recording of failed tests •  Device logs •  Device detection

2.  Mobile testing is anything but mobile

o  OTA app installation and execution o  Testing via wifi and carrier networks o  Test tool independent component o  Selenium grid-like test infrastructure

Page 18: 2012 mobile testingsummit-moet

18

All  mobile  platforms

1.  Yet another proprietary language?

o Open sourced test harness & language for •  Instrumented tests •  Non-instrumented tests •  Hybrid apps tests

Page 19: 2012 mobile testingsummit-moet

19

Next  steps

Monkey-­‐‑Runner

Device  Independent  Tests

Simulator/Device libraries

Mobile  Application  Interface

Runtime binding

Sikuli

Non-­‐‑instrumented  application  implementation

Instrumented  application  implementation

?Android? ?iOS?  

Eclipse mobile testing plugin

Test development

Test execution

Test reporting

Continuous integration