SlideShare a Scribd company logo
TESTING
SUCKSFITZROY-DALE
 NICHOLAS



   NOVEMBER 2011
TESTING IS LIKE
FLOSSING
54%                        WON’T INSTALL



                                                       61%
  ©	
  2011	
  -­‐	
                                            ©	
  2011	
  -­‐	
             ©	
  2011	
  -­‐	
  
CONFIDENTIAL	
                                                CONFIDENTIAL	
                 CONFIDENTIA




                                                                                         CRASHES
                       3   ©2011 Apkudo Inc. www.apkudo.com

    ©	
  2011	
  -­‐	
                                            ©	
  2011	
  -­‐	
             ©	
  2011	
  -­‐	
  
“I TEST MY APP!”


                                       99%
4   ©2011 Apkudo Inc. www.apkudo.com
“I TEST MY APP!”

                                       99%
                                        O RLY?

                                        85%
                                          MANUAL	
  




5   ©2011 Apkudo Inc. www.apkudo.com
OH NOES




6   ©2011 apkudo, inc. Confidential www.apkudo.com
AD HOC TESTING
        Sucks
        Keeping up with device versions
        Testing across various devices

        AUTOMATED TESTING
        Tedious
        JUnit, Robotium
        Test plan
7   ©2011 apkudo, inc. Confidential www.apkudo.com
MONKEY!
        A good start.
        Simulates inputs.
        Completely automated.

8   ©2011 apkudo, inc. Confidential www.apkudo.com
MONKEY OVERVIEW
	
  	
  Package	
  Manager	
  
	
  	
  Install	
  and	
  uninstall	
  packages	
  
	
  	
  Get	
  list	
  of	
  package	
  ac:vi:es	
  


                                                	
  	
  Ac$vity	
  Manager	
  
                                                	
  	
  Start	
  /	
  stop	
  ac:vi:es	
  
                                                	
  	
  Get	
  list	
  of	
  running	
  ac:vi:es	
  



                                                                                                   	
  	
  Window	
  Manager	
  
                                                                                                   	
  	
  Send	
  touch	
  and	
  key	
  events	
  	
  
                                                                                                   	
  	
  to	
  foreground	
  app	
  


       9   ©2011 apkudo, inc. Confidential www.apkudo.com
MONKEY OVERVIEW
	
  	
  Package	
  Manager	
  
 queryIntentActivities()




                                           	
  	
  Ac$vity	
  Manager	
  
                                           	
  	
  setActivityController()




                                                                         	
  	
  Window	
  Manager	
  
                                                                         	
  	
  inject*Event()



       10   ©2011 apkudo, inc. Confidential www.apkudo.com
MONKEY SEE
MONKEY DO
•  Monkey injects “events” - what is an event?
       –  KeyEvent: Hardware buttons and keyboard
       –  MotionEvent: X, Y, and touches
       –  FlipEvent, NetworkEvent, PowerEvent (mostly
          legacy)



11   ©2011 apkudo, inc. Confidential www.apkudo.com
Security	
  
     SECURITY
             •  Monkey uses standard Android
                permissions... that no user apps
                can use!
public static final String SET_ACTIVITY_WATCHER
Since: API Level 1
Allows an application to watch and control how activities are started globally in the system. Only for is in
debugging (usually the monkey command).

public static final String INJECT_EVENTS
Since: API Level 1
Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them
to ANY window. Without this permission, you can only deliver events to windows in your own process. Very
few applications should need to use this permission.

     12   ©2011 apkudo, inc. Confidential www.apkudo.com
MONKEYvVS onkey	
  Runner	
  
 Monkey	
   s	
  M
MONKEY RUNNER
•  Monkey is for randomized testing, and runs on
   the device
•  Monkey Runner is for scripting your own tests,
   and runs on a laptop / desktop
•  In fact, Monkey Runner uses Monkey internally
Monkey	
  on	
  Angry	
  Birds	
  
       THE BIRDS, THEY ARE ANGRY!




adb shell monkey –v -p com.rovio.angrybirds -s 39 --throttle 10 --pct-touch 100 5000	
       14   ©2011 apkudo, inc. Confidential www.apkudo.com
adb shell monkey -p com.rovio.angrybirds 5000
What	
  can	
  Monkey	
  find?	
  
  MONKEY RESULTS
   •  Key and motion events
   •  Crash information if applicable, as traceback
:AllowPackage:	
  com.rovio.angrybirds	
  
:IncludeCategory:	
  android.intent.category.LAUNCHER	
  
:IncludeCategory:	
  android.intent.category.MONKEY	
  
:Switch:	
  
#Intent;ac:on=android.intent.ac:on.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10000000;compo
nent=com.rovio.angrybirds/com.rovio.ka3d.App;end	
  
	
  	
  	
  //	
  Allowing	
  start	
  of	
  Intent	
  {	
  act=android.intent.ac:on.MAIN	
  cat=[android.intent.category.LAUNCHER]	
  
cmp=com.rovio.angrybirds/com.rovio.ka3d.App	
  }	
  in	
  package	
  com.rovio.angrybirds	
  
:Sending	
  Pointer	
  ACTION_DOWN	
  x=554.0	
  y=357.0	
  
:Sending	
  Pointer	
  ACTION_UP	
  x=558.0	
  y=350.0	
  
	
  	
  	
  //	
  Rejec:ng	
  start	
  of	
  Intent	
  {	
  act=android.intent.ac:on.CALL_BUTTON	
  cmp=com.android.contacts/.DialtactsAc:vity	
  }	
  in	
  
package	
  com.android.contacts	
  
:Sending	
  Pointer	
  ACTION_DOWN	
  x=696.0	
  y=280.0	
  
:Sending	
  Pointer	
  ACTION_UP	
  x=709.0	
  y=271.0	
  
:Sending	
  Pointer	
  ACTION_MOVE	
  x=-­‐1.0	
  y=1.0	
  
:Sending	
  Pointer	
  ACTION_DOWN	
  x=348.0	
  y=10.0	
  

  15   ©2011 apkudo, inc. Confidential www.apkudo.com
WHAT CAN Monkey	
  find?	
  
  What	
  can	
  
MONKEY FIND?
•  Weird UI sequences
       –  Press button 2 before button 1
•  Unexpected inputs
       –  E.G. keyboard input during a Toast
•  User-interface race conditions
•  Activity life-cycle errors

16   ©2011 apkudo, inc. Confidential www.apkudo.com
Weird	
  UI	
  sequences	
  
WEIRD
UI SEQUENCES
•  Monkey presses UI controls in an unexpected
   way
•  Example: Comic Rack: selecting “Options”
   immediately after application start
•  Resolution: Always check preconditions in UI
   callback functions


17   ©2011 apkudo, inc. Confidential www.apkudo.com
UNEXPECTED inputs	
  
    Unexpected	
  
INPUTS
•  Monkey simulates keypresses that the
   application doesn’t expect
•  Example: multiple keypresses on the same
   button
•  Resolution: Again, be paranoid when entering
   UI callback functions

18   ©2011 apkudo, inc. Confidential www.apkudo.com
RACE Race	
  condi:ons	
  
CONDITIONS
•  Monkey can press UI elements very quickly,
   triggering race conditions
•  Example: I Heart Radio: PlayerController
   not initialized
•  Resolution: limit use of threads. When they
   are necessary, perform appropriate locking.
•  Same applies to networking.
19   ©2011 apkudo, inc. Confidential www.apkudo.com
Ac:vity	
  life-­‐cycle	
  errors	
  
ACTIVITY LIFE CYCLE
ERRORS
•  Monkey performs unexpected activity life-
   cycle actions
•  Example: Shazam: Unable to pause activity
•  Resolution: Become tiresomely familiar
   with the Android activity life cycle.
MULTI-DEVICE Monkey	
  
   Mul:-­‐device	
  
MONKEY
•  Monkey is really good at testing across
   multiple devices:
•  Correct Market permissions
  –  appropriate-architecture native code, eg armv7
•  Unexpected hardware properties
•  “Weird” hardware failures
Mul:-­‐device	
  Monkey	
  
CORRECT MARKET
FILTERS
•  OpenGL ES version and features
•  Dependencies on system libraries
•  Incorrect or missing minSdkVersion
Unexpected	
  hardware	
  proper:es	
  
UNEXPECTED HARDWARE
PROPERTIES
•  The device has an unexpected hardware
   feature (e.g. a strange screen resolution)
•  Examples: RDefense Free, Zombie Killer
•  Best resolution: Test on multiple devices
Weird	
  hardware	
  failures	
  
WEIRD HARDWRE
FAILURES
•  Not all devices “just work”
•  Example: PaperCamera doesn’t handle
   RuntimeError from takePicture()
•  Resolution: Test on multiple devices. Be
   wary of Java unchecked errors.



24   ©2011 apkudo, inc. Confidential www.apkudo.com
MONKEYLimita:ons	
  
LIMITATIONS
•  False positives
       –  “Impossible” sequences of actions / speeds
•  Very limited testing strategy
       –  What if most of your app is hidden behind a login
          screen?
•  Some Android pain points not covered
       –  E.G. screen rotation, layout issues

25   ©2011 apkudo, inc. Confidential www.apkudo.com
AND                                            Apkudo	
  
APKUDO
•  “See your app run on every Android
   device”
       –  Monkey test on 289 phones and tablets
       –  Free
       –  Private beta right now: email
          sayhi@apkudo.com if interested


26   ©2011 apkudo, inc. Confidential www.apkudo.com
Thank you.
     NFD@    .COM

More Related Content

What's hot

Getting startedtitanium mac (1)
Getting startedtitanium mac (1)Getting startedtitanium mac (1)
Getting startedtitanium mac (1)
Johnny Vietnam
 
Appium workshop technopark trivandrum
Appium workshop technopark trivandrumAppium workshop technopark trivandrum
Appium workshop technopark trivandrum
Syam Sasi
 
techSocAndroid1
techSocAndroid1techSocAndroid1
techSocAndroid1
Vladyslav Kolesnyk
 
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
jeromevdl
 
Monkey Talk
Monkey TalkMonkey Talk
Monkey Talk
Jignesh Bhadani
 
Best Camera Drones in 2021
Best Camera Drones in 2021Best Camera Drones in 2021
Best Camera Drones in 2021
Mehedihasan1368
 
Mobile Test Automation - Appium
Mobile Test Automation - AppiumMobile Test Automation - Appium
Mobile Test Automation - Appium
Maria Machlowska
 
MonkeyTalk Documentation
MonkeyTalk DocumentationMonkeyTalk Documentation
MonkeyTalk Documentation
Vivek Pansara
 
Android testing
Android testingAndroid testing
Android testing
Bitbar
 
Google App Inventor
Google App InventorGoogle App Inventor
Google App Inventor
Michael Trest
 
My Android is not an iPhone like any others (Mdevcon 2014)
My Android is not an iPhone like any others (Mdevcon 2014)My Android is not an iPhone like any others (Mdevcon 2014)
My Android is not an iPhone like any others (Mdevcon 2014)
jeromevdl
 
Android testing
Android testingAndroid testing
Android testing
JinaTm
 
Android Wear Development
Android Wear DevelopmentAndroid Wear Development
Android Wear Development
Johnny Sung
 
Parrot anafi work-manual-completo_v6.7.0.1_en
Parrot anafi work-manual-completo_v6.7.0.1_enParrot anafi work-manual-completo_v6.7.0.1_en
Parrot anafi work-manual-completo_v6.7.0.1_en
RandyMuchaV
 
Android Flash Development
Android Flash DevelopmentAndroid Flash Development
Android Flash Development
Stephen Chin
 
Mobile SDKs: Use with Caution - Ori Lentzitzky
Mobile SDKs: Use with Caution - Ori LentzitzkyMobile SDKs: Use with Caution - Ori Lentzitzky
Mobile SDKs: Use with Caution - Ori Lentzitzky
DroidConTLV
 
Mobile WebDriver Selendroid
Mobile WebDriver SelendroidMobile WebDriver Selendroid
Mobile WebDriver Selendroid
Dominik Dary
 
Appium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation IntroductionAppium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation Introduction
snevesbarros
 
#Fame case study
#Fame case study#Fame case study
#Fame case study
Keshav Kashyap
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded Applications
VIA Embedded
 

What's hot (20)

Getting startedtitanium mac (1)
Getting startedtitanium mac (1)Getting startedtitanium mac (1)
Getting startedtitanium mac (1)
 
Appium workshop technopark trivandrum
Appium workshop technopark trivandrumAppium workshop technopark trivandrum
Appium workshop technopark trivandrum
 
techSocAndroid1
techSocAndroid1techSocAndroid1
techSocAndroid1
 
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
Droidcon Paris 2013 - Musclez vos applications Android avec les outils du mon...
 
Monkey Talk
Monkey TalkMonkey Talk
Monkey Talk
 
Best Camera Drones in 2021
Best Camera Drones in 2021Best Camera Drones in 2021
Best Camera Drones in 2021
 
Mobile Test Automation - Appium
Mobile Test Automation - AppiumMobile Test Automation - Appium
Mobile Test Automation - Appium
 
MonkeyTalk Documentation
MonkeyTalk DocumentationMonkeyTalk Documentation
MonkeyTalk Documentation
 
Android testing
Android testingAndroid testing
Android testing
 
Google App Inventor
Google App InventorGoogle App Inventor
Google App Inventor
 
My Android is not an iPhone like any others (Mdevcon 2014)
My Android is not an iPhone like any others (Mdevcon 2014)My Android is not an iPhone like any others (Mdevcon 2014)
My Android is not an iPhone like any others (Mdevcon 2014)
 
Android testing
Android testingAndroid testing
Android testing
 
Android Wear Development
Android Wear DevelopmentAndroid Wear Development
Android Wear Development
 
Parrot anafi work-manual-completo_v6.7.0.1_en
Parrot anafi work-manual-completo_v6.7.0.1_enParrot anafi work-manual-completo_v6.7.0.1_en
Parrot anafi work-manual-completo_v6.7.0.1_en
 
Android Flash Development
Android Flash DevelopmentAndroid Flash Development
Android Flash Development
 
Mobile SDKs: Use with Caution - Ori Lentzitzky
Mobile SDKs: Use with Caution - Ori LentzitzkyMobile SDKs: Use with Caution - Ori Lentzitzky
Mobile SDKs: Use with Caution - Ori Lentzitzky
 
Mobile WebDriver Selendroid
Mobile WebDriver SelendroidMobile WebDriver Selendroid
Mobile WebDriver Selendroid
 
Appium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation IntroductionAppium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation Introduction
 
#Fame case study
#Fame case study#Fame case study
#Fame case study
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded Applications
 

Viewers also liked

World Pulse 2009
World Pulse 2009World Pulse 2009
World Pulse 2009
JensineLarsen
 
Maladie De Whipple
Maladie De WhippleMaladie De Whipple
Maladie De Whipple
Mede Space
 
Korean ICT Teachers Delegation Visit to ICT Center
Korean ICT Teachers Delegation Visit to ICT CenterKorean ICT Teachers Delegation Visit to ICT Center
Korean ICT Teachers Delegation Visit to ICT Center
Gordon F Snyder Jr
 
Brochure, enhancing scholarship, revised, 25 may2011
Brochure, enhancing scholarship, revised, 25 may2011Brochure, enhancing scholarship, revised, 25 may2011
Brochure, enhancing scholarship, revised, 25 may2011
Nick Jankowski
 
Letter to CORE workshop participants, jankowski, 11sept2010
Letter to CORE workshop participants, jankowski, 11sept2010Letter to CORE workshop participants, jankowski, 11sept2010
Letter to CORE workshop participants, jankowski, 11sept2010
Nick Jankowski
 
Syllabaus, ljubljana practicum, digital tools and scholarship, jankowski, dra...
Syllabaus, ljubljana practicum, digital tools and scholarship, jankowski, dra...Syllabaus, ljubljana practicum, digital tools and scholarship, jankowski, dra...
Syllabaus, ljubljana practicum, digital tools and scholarship, jankowski, dra...
Nick Jankowski
 
Jankowski & van selm, promise and practice of public debate, 2000
Jankowski & van selm, promise and practice of public debate, 2000Jankowski & van selm, promise and practice of public debate, 2000
Jankowski & van selm, promise and practice of public debate, 2000
Nick Jankowski
 

Viewers also liked (7)

World Pulse 2009
World Pulse 2009World Pulse 2009
World Pulse 2009
 
Maladie De Whipple
Maladie De WhippleMaladie De Whipple
Maladie De Whipple
 
Korean ICT Teachers Delegation Visit to ICT Center
Korean ICT Teachers Delegation Visit to ICT CenterKorean ICT Teachers Delegation Visit to ICT Center
Korean ICT Teachers Delegation Visit to ICT Center
 
Brochure, enhancing scholarship, revised, 25 may2011
Brochure, enhancing scholarship, revised, 25 may2011Brochure, enhancing scholarship, revised, 25 may2011
Brochure, enhancing scholarship, revised, 25 may2011
 
Letter to CORE workshop participants, jankowski, 11sept2010
Letter to CORE workshop participants, jankowski, 11sept2010Letter to CORE workshop participants, jankowski, 11sept2010
Letter to CORE workshop participants, jankowski, 11sept2010
 
Syllabaus, ljubljana practicum, digital tools and scholarship, jankowski, dra...
Syllabaus, ljubljana practicum, digital tools and scholarship, jankowski, dra...Syllabaus, ljubljana practicum, digital tools and scholarship, jankowski, dra...
Syllabaus, ljubljana practicum, digital tools and scholarship, jankowski, dra...
 
Jankowski & van selm, promise and practice of public debate, 2000
Jankowski & van selm, promise and practice of public debate, 2000Jankowski & van selm, promise and practice of public debate, 2000
Jankowski & van selm, promise and practice of public debate, 2000
 

Similar to Testing Sucks, But It Doesn't Have To

2012 java one-con3648
2012 java one-con36482012 java one-con3648
2012 java one-con3648
Eing Ong
 
Haptics for android
Haptics for androidHaptics for android
Haptics for android
Droidcon Berlin
 
MOET: Mobile End-to-End Testing
MOET: Mobile End-to-End TestingMOET: Mobile End-to-End Testing
MOET: Mobile End-to-End Testing
mobiletestsummit
 
Android mobile app security offensive security workshop
Android mobile app security   offensive security workshopAndroid mobile app security   offensive security workshop
Android mobile app security offensive security workshop
Abhinav Sejpal
 
Are You Ready for iOS 8?
Are You Ready for iOS 8?Are You Ready for iOS 8?
Are You Ready for iOS 8?
Keynote Mobile Testing
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testing
Adam Siton
 
Mobile QA Metrics Risks and Automation Presentation By Yuval Golan
Mobile QA Metrics Risks and Automation Presentation  By Yuval GolanMobile QA Metrics Risks and Automation Presentation  By Yuval Golan
Mobile QA Metrics Risks and Automation Presentation By Yuval Golan
Yuval Golan
 
Intro to Google TV
Intro to Google TVIntro to Google TV
Intro to Google TV
GauntFace
 
Dependency Injection in .NET applications
Dependency Injection in .NET applicationsDependency Injection in .NET applications
Dependency Injection in .NET applications
Babak Naffas
 
2012 mobile testingsummit-moet
2012 mobile testingsummit-moet2012 mobile testingsummit-moet
2012 mobile testingsummit-moet
Eing Ong
 
Mobile testing
Mobile testingMobile testing
Mobile testing
Hrushikesh Wakhle
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)
danielputerman
 
Dev101
Dev101Dev101
Dev101
konnis
 
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
Srijan Technologies
 
UI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms AppsUI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms Apps
Codrina Merigo
 
Jailbreak 101 4
Jailbreak 101 4Jailbreak 101 4
Jailbreak 101 4
Peter Kupfer
 
Everything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable PhonesEverything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable Phones
Perfecto by Perforce
 
Background Fetch - the most powerful API you've never heard of
Background Fetch - the most powerful API you've never heard ofBackground Fetch - the most powerful API you've never heard of
Background Fetch - the most powerful API you've never heard of
moliver816
 
Automated UI Testing for Web and Native Apps on iOS and Android
Automated UI Testing for  Web and Native Apps on iOS and AndroidAutomated UI Testing for  Web and Native Apps on iOS and Android
Automated UI Testing for Web and Native Apps on iOS and Android
Operation Mobile
 
J. Daniel Martínez - IoP: The Internet of Planes / Hacking millionaires jet c...
J. Daniel Martínez - IoP: The Internet of Planes / Hacking millionaires jet c...J. Daniel Martínez - IoP: The Internet of Planes / Hacking millionaires jet c...
J. Daniel Martínez - IoP: The Internet of Planes / Hacking millionaires jet c...
RootedCON
 

Similar to Testing Sucks, But It Doesn't Have To (20)

2012 java one-con3648
2012 java one-con36482012 java one-con3648
2012 java one-con3648
 
Haptics for android
Haptics for androidHaptics for android
Haptics for android
 
MOET: Mobile End-to-End Testing
MOET: Mobile End-to-End TestingMOET: Mobile End-to-End Testing
MOET: Mobile End-to-End Testing
 
Android mobile app security offensive security workshop
Android mobile app security   offensive security workshopAndroid mobile app security   offensive security workshop
Android mobile app security offensive security workshop
 
Are You Ready for iOS 8?
Are You Ready for iOS 8?Are You Ready for iOS 8?
Are You Ready for iOS 8?
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testing
 
Mobile QA Metrics Risks and Automation Presentation By Yuval Golan
Mobile QA Metrics Risks and Automation Presentation  By Yuval GolanMobile QA Metrics Risks and Automation Presentation  By Yuval Golan
Mobile QA Metrics Risks and Automation Presentation By Yuval Golan
 
Intro to Google TV
Intro to Google TVIntro to Google TV
Intro to Google TV
 
Dependency Injection in .NET applications
Dependency Injection in .NET applicationsDependency Injection in .NET applications
Dependency Injection in .NET applications
 
2012 mobile testingsummit-moet
2012 mobile testingsummit-moet2012 mobile testingsummit-moet
2012 mobile testingsummit-moet
 
Mobile testing
Mobile testingMobile testing
Mobile testing
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)
 
Dev101
Dev101Dev101
Dev101
 
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
 
UI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms AppsUI Testing for Your Xamarin.Forms Apps
UI Testing for Your Xamarin.Forms Apps
 
Jailbreak 101 4
Jailbreak 101 4Jailbreak 101 4
Jailbreak 101 4
 
Everything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable PhonesEverything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable Phones
 
Background Fetch - the most powerful API you've never heard of
Background Fetch - the most powerful API you've never heard ofBackground Fetch - the most powerful API you've never heard of
Background Fetch - the most powerful API you've never heard of
 
Automated UI Testing for Web and Native Apps on iOS and Android
Automated UI Testing for  Web and Native Apps on iOS and AndroidAutomated UI Testing for  Web and Native Apps on iOS and Android
Automated UI Testing for Web and Native Apps on iOS and Android
 
J. Daniel Martínez - IoP: The Internet of Planes / Hacking millionaires jet c...
J. Daniel Martínez - IoP: The Internet of Planes / Hacking millionaires jet c...J. Daniel Martínez - IoP: The Internet of Planes / Hacking millionaires jet c...
J. Daniel Martínez - IoP: The Internet of Planes / Hacking millionaires jet c...
 

Recently uploaded

Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 

Recently uploaded (20)

Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 

Testing Sucks, But It Doesn't Have To

  • 3. 54% WON’T INSTALL 61% ©  2011  -­‐   ©  2011  -­‐   ©  2011  -­‐   CONFIDENTIAL   CONFIDENTIAL   CONFIDENTIA CRASHES 3 ©2011 Apkudo Inc. www.apkudo.com ©  2011  -­‐   ©  2011  -­‐   ©  2011  -­‐  
  • 4. “I TEST MY APP!” 99% 4 ©2011 Apkudo Inc. www.apkudo.com
  • 5. “I TEST MY APP!” 99% O RLY? 85% MANUAL   5 ©2011 Apkudo Inc. www.apkudo.com
  • 6. OH NOES 6 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 7. AD HOC TESTING Sucks Keeping up with device versions Testing across various devices AUTOMATED TESTING Tedious JUnit, Robotium Test plan 7 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 8. MONKEY! A good start. Simulates inputs. Completely automated. 8 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 9. MONKEY OVERVIEW    Package  Manager      Install  and  uninstall  packages      Get  list  of  package  ac:vi:es      Ac$vity  Manager      Start  /  stop  ac:vi:es      Get  list  of  running  ac:vi:es      Window  Manager      Send  touch  and  key  events        to  foreground  app   9 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 10. MONKEY OVERVIEW    Package  Manager   queryIntentActivities()    Ac$vity  Manager      setActivityController()    Window  Manager      inject*Event() 10 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 11. MONKEY SEE MONKEY DO •  Monkey injects “events” - what is an event? –  KeyEvent: Hardware buttons and keyboard –  MotionEvent: X, Y, and touches –  FlipEvent, NetworkEvent, PowerEvent (mostly legacy) 11 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 12. Security   SECURITY •  Monkey uses standard Android permissions... that no user apps can use! public static final String SET_ACTIVITY_WATCHER Since: API Level 1 Allows an application to watch and control how activities are started globally in the system. Only for is in debugging (usually the monkey command). public static final String INJECT_EVENTS Since: API Level 1 Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them to ANY window. Without this permission, you can only deliver events to windows in your own process. Very few applications should need to use this permission. 12 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 13. MONKEYvVS onkey  Runner   Monkey   s  M MONKEY RUNNER •  Monkey is for randomized testing, and runs on the device •  Monkey Runner is for scripting your own tests, and runs on a laptop / desktop •  In fact, Monkey Runner uses Monkey internally
  • 14. Monkey  on  Angry  Birds   THE BIRDS, THEY ARE ANGRY! adb shell monkey –v -p com.rovio.angrybirds -s 39 --throttle 10 --pct-touch 100 5000 14 ©2011 apkudo, inc. Confidential www.apkudo.com adb shell monkey -p com.rovio.angrybirds 5000
  • 15. What  can  Monkey  find?   MONKEY RESULTS •  Key and motion events •  Crash information if applicable, as traceback :AllowPackage:  com.rovio.angrybirds   :IncludeCategory:  android.intent.category.LAUNCHER   :IncludeCategory:  android.intent.category.MONKEY   :Switch:   #Intent;ac:on=android.intent.ac:on.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10000000;compo nent=com.rovio.angrybirds/com.rovio.ka3d.App;end        //  Allowing  start  of  Intent  {  act=android.intent.ac:on.MAIN  cat=[android.intent.category.LAUNCHER]   cmp=com.rovio.angrybirds/com.rovio.ka3d.App  }  in  package  com.rovio.angrybirds   :Sending  Pointer  ACTION_DOWN  x=554.0  y=357.0   :Sending  Pointer  ACTION_UP  x=558.0  y=350.0        //  Rejec:ng  start  of  Intent  {  act=android.intent.ac:on.CALL_BUTTON  cmp=com.android.contacts/.DialtactsAc:vity  }  in   package  com.android.contacts   :Sending  Pointer  ACTION_DOWN  x=696.0  y=280.0   :Sending  Pointer  ACTION_UP  x=709.0  y=271.0   :Sending  Pointer  ACTION_MOVE  x=-­‐1.0  y=1.0   :Sending  Pointer  ACTION_DOWN  x=348.0  y=10.0   15 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 16. WHAT CAN Monkey  find?   What  can   MONKEY FIND? •  Weird UI sequences –  Press button 2 before button 1 •  Unexpected inputs –  E.G. keyboard input during a Toast •  User-interface race conditions •  Activity life-cycle errors 16 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 17. Weird  UI  sequences   WEIRD UI SEQUENCES •  Monkey presses UI controls in an unexpected way •  Example: Comic Rack: selecting “Options” immediately after application start •  Resolution: Always check preconditions in UI callback functions 17 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 18. UNEXPECTED inputs   Unexpected   INPUTS •  Monkey simulates keypresses that the application doesn’t expect •  Example: multiple keypresses on the same button •  Resolution: Again, be paranoid when entering UI callback functions 18 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 19. RACE Race  condi:ons   CONDITIONS •  Monkey can press UI elements very quickly, triggering race conditions •  Example: I Heart Radio: PlayerController not initialized •  Resolution: limit use of threads. When they are necessary, perform appropriate locking. •  Same applies to networking. 19 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 20. Ac:vity  life-­‐cycle  errors   ACTIVITY LIFE CYCLE ERRORS •  Monkey performs unexpected activity life- cycle actions •  Example: Shazam: Unable to pause activity •  Resolution: Become tiresomely familiar with the Android activity life cycle.
  • 21. MULTI-DEVICE Monkey   Mul:-­‐device   MONKEY •  Monkey is really good at testing across multiple devices: •  Correct Market permissions –  appropriate-architecture native code, eg armv7 •  Unexpected hardware properties •  “Weird” hardware failures
  • 22. Mul:-­‐device  Monkey   CORRECT MARKET FILTERS •  OpenGL ES version and features •  Dependencies on system libraries •  Incorrect or missing minSdkVersion
  • 23. Unexpected  hardware  proper:es   UNEXPECTED HARDWARE PROPERTIES •  The device has an unexpected hardware feature (e.g. a strange screen resolution) •  Examples: RDefense Free, Zombie Killer •  Best resolution: Test on multiple devices
  • 24. Weird  hardware  failures   WEIRD HARDWRE FAILURES •  Not all devices “just work” •  Example: PaperCamera doesn’t handle RuntimeError from takePicture() •  Resolution: Test on multiple devices. Be wary of Java unchecked errors. 24 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 25. MONKEYLimita:ons   LIMITATIONS •  False positives –  “Impossible” sequences of actions / speeds •  Very limited testing strategy –  What if most of your app is hidden behind a login screen? •  Some Android pain points not covered –  E.G. screen rotation, layout issues 25 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 26. AND Apkudo   APKUDO •  “See your app run on every Android device” –  Monkey test on 289 phones and tablets –  Free –  Private beta right now: email sayhi@apkudo.com if interested 26 ©2011 apkudo, inc. Confidential www.apkudo.com
  • 27. Thank you. NFD@ .COM