Course - YesM - Testing Mobile Software - Final
Course - YesM - Testing Mobile Software - Final
com
A Course in
Mobile Applications Testing
Presented by: Shailesh Joshi
Agenda
>> Complexity of Mobile domain
>> Traditional vs. Mobile testing
>> Strategies for testing mobile software
>> Types of Mobile Apps
>> Baseline Testing
>> Mobile Platforms
>> Platform specific testing tips
>> Testing on Emulators
>> Testing Automation
The Complexity
Diversity of Platforms: Today's mobile devices differ not just at the firmware level, but
also at the operating system, browser and the application runtime layer (like Java or
BREW) levels. Testing for compatibility between these layers, as well as with the
network interface, is important to deploying trouble-free mobile services.
Multiple interface and rendering standards: Handset manufacturers are moving toward
dual- or tri-mode phones capable of supporting multiple network standards. Also
applications rendered in HDML, WML, WAP, cHTML, xHTML, CSS, AJAX will continue
to require focused testing at the presentation level.
With the advent of highly functional smart-phones and handsets that have rich client
execution environments, persistent data store and high speed network connectivity,
testing becomes much more complex.
Security issues: With the ability to download apps and execute code on the device
comes the risk associated with user authentication, enterprise data and transactional
security as well as viruses and other malicious code. The newfound power of the mobile
desktop increases the need for testing and verification of security mechanisms, both in
the devices themselves and in the network infrastructure.
Browser compatibility
Carrier compatibility (Verizon, AT&T, Sprint, etc.)
Device/hardware compatibility
Phone models
Must pay more attention to usability and form factors than with traditional
desktop applications. Smaller screens, slower processors, limited memory and network
bandwidth all require different testing methods. Testers must be aware of specific
methods developers use to compensate for these factors and develop testing methods
accordingly.
Continued …
Testing Mobile Devices
Strategies
Utilize established test beds to test under known network service quality conditions, e.g.
testing application survivability during network crossovers, drop back to slower/older
networks, roaming, etc. The technology and network implementations are not mature
enough to rely solely on lab testing of mobile applications. Testing on a target device,
rather than a prototype or emulator, will enable proper testing of security schemes and
performance under realistic loads (web, client/server, background loads, incremental
wireless traffic, variations in message size).
Continued …
Testing Mobile Devices
Strategies
Testing conducted through emulators or simulators cannot accomplish the same level
of quality verification of the user experience as field-based testing will. Emulators and
simulators are useful for validating functionality and compatibility under controlled
conditions, particularly during the development cycle and for white-box testing.
However, field verification is necessary to ensure proper validation of services in a real-
world environment. Each unique configuration instance of a mobile application should
be field tested as a separate solution (device, browser, data, network, carrier, gateway
and enterprise components).
Mobile Apps
Web apps Native Apps
- accessed via - Pre-installed
Browser - Downloadable
Web Apps
Web sites/apps built for mobile browsers.
Accessed by entering a specific URL in mobile browser.
Optimized for viewing on mobile phone.
No download/installation required.
Web-apps expect internet connectivity
Internet speed and coverage become an
CDMA
EDGE
3G
Wi-Fi/Wi-Max
Monitor app performance for above conditions when the mobile phone’s
free memory is
low
high
Baseline Testing
Interruptions/Interactions
Activities that occur simultaneously in the mobile device while the app is
installing/launching/running/closing/updating/uninstalling. Interruptions
can happen in the form of
Incoming call/message/notifications from calendars, alarms, clocks
Receiving incoming call/message/notifications
Losing wireless connection/device switched off
Removing battery
Activating camera
Daylight time changes
Device Settings
Look for configurable device settings on the phone and determine which
may affect the application. Also explore ways in which
you can force error messages in the apps.
Input Modes
Ways to interact with and control the mobile device
Keyboard/Keypad
Touch screen
Virtual keypad
Trackball/Trackwheel
Peripherals that can be plugged in to the device
For a touch device, test with single touch and multi-touch inputs. Try different
combinations with multiple fingers, like keeping thumb on the edge of the screen while
typing, or tapping fingers on the device while using it.
Test in portrait and landscape modes when the app is running in background.
Even the way devices are held can impact their connectivity and how well they
respond to inputs. Case in point, i-Phone 4 antenna issue. Does holding the device
in a certain way and interacting with it causes the app to crash or freeze up?
Usability Testing
Should occur as soon as a stable build is available.
Consider various input/scrolling/clicking/navigation
modes on multiple devices.
Data intensive apps may feel better on devices with
physical keyboards.
Touch screens may feel better for some apps than
non-touch screen.
Report back issues to developers, who may consider
tweaking the UI to reduce severity of problem.
Testing Tips
iPhone
Human Interface Guidelines from Apple need to be
followed.
Backward OS compatibility
4 major releases of iOS so far.
Possible to debug via USB connection
Utilities
Screenshots: Home + Lock keys
Memory sweep app: Check memory status or free up
memory
Testing Tips
iPhone
Test under low/very low memory conditions
Background apps: Safari, Mail, “interrupts”
Memory sweep app
Attach crash logs and screenshots when reporting
bugs
Retrieve .crash file from iPhone
Built-in screen capture
Debug via console using iPhone config tool
Check warnings/errors
Boundary conditions for text input
Special/localized/Unicode characters
Testing Tips
Android
Allows multiple apps to run in background
During certain changes to device configurations
(screen orientation, language, keyboard availability),
running apps may be automatically reloaded. Test if
app is able to handle shutdown/restart gracefully
without loss of user data or state.
Possible to debug via USB connection
Utilities
Monkey: runs on emulator or device and generates
pseudo-random streams of user events such as clicks,
touches, or gestures. Useful for stress testing apps.
Android:
What to Test
From Android Documentation
http://developer.android.com/guide/topics/testing/testing_android.html
In addition to the functional areas you would normally test, here are some areas of
Android application testing that you should consider:
Activity lifecycle events: You should test that your activities handle lifecycle events
correctly. For example an activity should respond to pause or destroy events by
saving its state. Remember that even a change in screen orientation causes the
current activity to be destroyed, so you should test that accidental device movements
don't accidentally lose the application state.
Database operations: You should ensure that database operations correctly handle
changes to the application's state. To do this, use mock objects from the package
android.test.mock.
Screen sizes and resolutions: Before you publish your application, make sure to test
it on all of the screen sizes and densities on which you want it to run. You can test
the application on multiple sizes and densities using AVDs, or you can test your
application directly on the devices that you are targeting. For more information, see
the topic Supporting Multiple Screens.
When possible, you should run these tests on an actual device. If this is not possible,
you can use the Android Emulator with Android Virtual Devices configured for the
hardware, screens, and versions you want to test.
Testing Web Apps
Before testing mobile website to determine how it looks on
handsets, make sure the functionality of the site is as expected. At
some point, web site must be tested on a physical device, however
physical testing is expensive and time consuming. So ensure that
time spent on handsets is used to identify device-specific
problems;
functional issues should be handled before device testing begins.
Most mobile web sites look for HTTP header called “x-wap-
profile” to identify a mobile device. Below is a User Agent Profile
(UAProf) for Nokia N97 phone.
http://nds1.nds.nokia.com/uaprof/NN97r100-2G.xml
Add a new header using Modify Headers add on.
Mobile Web Testing
with Firefox
Pick a device from www.uaprof.com as shown below
Type UAProf URL (ending with .xml) in Text Box 2 of Modify Headers
window. Type “x-wap-profile” in the Text Box 1. Type a suitable device
description in the Text Box 3. Click Add button on the right.
Mobile Web Testing
with Firefox
The new device will be displayed in the list. The green dot at the end
indicates that it is enabled. Disable all other devices by double clicking.
Keep only one entry in the list enabled.
Mobile Web Testing
with Firefox
Open User Agent Switcher add on
Mobile Web Testing
with Firefox
Click New >> New User Agent
Mobile Web Testing
with Firefox
Paste the user agent String into User Agent
field. Also enter a suitable Description. Then
click OK in two windows.
Mobile Web Testing
with Firefox
Set the newly created User Agent as Default
User Agent.
Mobile Web Testing
with Firefox
Test by browsing to
www.bbc.co.uk
The browser will be
automatically redirected
to bbc’s mobile web
site.
Testing with
Emulators
Traditional web apps testing is relatively easy – test for
compatibility issues in four or five browsers, and the job’s done.
http://developer.samsung.com/sa/signUp.do
Verify email and then sign into the account
http://developer.samsung.com/sa/signIn.do
After login, Click Test Lab at the top of the page
PerfectoMobile.com
Paid-for online device provider
What is
Calabash-Android
Open Source Automated Testing Tool for Android and iOS
native apps.
Uses Cucumber Framework
Cucumber is a BDD (Behavior Driven Development) tool to write
acceptance tests in a language like plain English.
Acceptance tests describe behaviour of the application from end
user's point of view.
Feature: It describes a single feature of the system.
Scenario: A concrete example that illustrates a business rule. It
consists of a list of steps.
Step: A step typically starts with Given, When or Then
– Given steps describe the initial context
– When steps describe an event, or an action
– Then steps describe an expected outcome, or result.
Run Calabash-Android
Testcases
Signup for free Basic Plan at http://testmunk.com/signup
Run Calabash-Android
Testcases
Login to your account at http://testmunk.com/login
Click on New Testrun
Click Next.
Click Next.
Click Start Testrun.
Run Calabash-Android
Testcases
Allow some time (5 min) for the testcase to complete.