SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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 trivandrumSyam Sasi
 
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
 
Best Camera Drones in 2021
Best Camera Drones in 2021Best Camera Drones in 2021
Best Camera Drones in 2021Mehedihasan1368
 
Mobile Test Automation - Appium
Mobile Test Automation - AppiumMobile Test Automation - Appium
Mobile Test Automation - AppiumMaria Machlowska
 
MonkeyTalk Documentation
MonkeyTalk DocumentationMonkeyTalk Documentation
MonkeyTalk DocumentationVivek Pansara
 
Android testing
Android testingAndroid testing
Android testingBitbar
 
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 testingJinaTm
 
Android Wear Development
Android Wear DevelopmentAndroid Wear Development
Android Wear DevelopmentJohnny 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_enRandyMuchaV
 
Android Flash Development
Android Flash DevelopmentAndroid Flash Development
Android Flash DevelopmentStephen 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 LentzitzkyDroidConTLV
 
Mobile WebDriver Selendroid
Mobile WebDriver SelendroidMobile WebDriver Selendroid
Mobile WebDriver SelendroidDominik 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 Introductionsnevesbarros
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsVIA Embedded
 

Was ist angesagt? (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
 

Andere mochten auch

Maladie De Whipple
Maladie De WhippleMaladie De Whipple
Maladie De WhippleMede 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 CenterGordon 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 may2011Nick 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, 11sept2010Nick 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, 2000Nick Jankowski
 

Andere mochten auch (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
 

Ähnlich wie Testing Sucks, But It Doesn't Have To

2012 java one-con3648
2012 java one-con36482012 java one-con3648
2012 java one-con3648Eing Ong
 
MOET: Mobile End-to-End Testing
MOET: Mobile End-to-End TestingMOET: Mobile End-to-End Testing
MOET: Mobile End-to-End Testingmobiletestsummit
 
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 workshopAbhinav Sejpal
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testingAdam 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 GolanYuval Golan
 
Intro to Google TV
Intro to Google TVIntro to Google TV
Intro to Google TVGauntFace
 
Dependency Injection in .NET applications
Dependency Injection in .NET applicationsDependency Injection in .NET applications
Dependency Injection in .NET applicationsBabak Naffas
 
2012 mobile testingsummit-moet
2012 mobile testingsummit-moet2012 mobile testingsummit-moet
2012 mobile testingsummit-moetEing Ong
 
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
Dev101konnis
 
[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 AppiumSrijan 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 AppsCodrina Merigo
 
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 PhonesPerfecto 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 ofmoliver816
 
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 AndroidOperation 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
 

Ähnlich wie 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...
 

Kürzlich hochgeladen

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 

Kürzlich hochgeladen (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 

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