Upload
vikram-kumar
View
227
Download
0
Embed Size (px)
Citation preview
8/7/2019 Chapter 5 Test Automation for Mobile Phone Applications Client Applications (10 Apr 2011)
http://slidepdf.com/reader/full/chapter-5-test-automation-for-mobile-phone-applications-client-applications 1/10
1
Test (Automation) for Mobile Phone Applications
for StarEast 2011
Julian Harty
10 Apr 2011
2
Client Applications
8/7/2019 Chapter 5 Test Automation for Mobile Phone Applications Client Applications (10 Apr 2011)
http://slidepdf.com/reader/full/chapter-5-test-automation-for-mobile-phone-applications-client-applications 2/10
8/7/2019 Chapter 5 Test Automation for Mobile Phone Applications Client Applications (10 Apr 2011)
http://slidepdf.com/reader/full/chapter-5-test-automation-for-mobile-phone-applications-client-applications 3/10
5
Building Client applications
Client applications are difficult to build & test
Unit test tools generally less mature
UI code hard to automatically test
Tested on emulators and on devices
Sometimes entirely different executables e.g.
Symbian applications
6
Test strategy for client applications
Unit testing
System testing when practical
Manual testing on devices
Use emulators with network analyzers
Custom clients help:
Diagnose client capabilities
Identify and isolate the cause of problems
Model-based testing helps drive the client
8/7/2019 Chapter 5 Test Automation for Mobile Phone Applications Client Applications (10 Apr 2011)
http://slidepdf.com/reader/full/chapter-5-test-automation-for-mobile-phone-applications-client-applications 4/10
7
Unit testing frameworks
Exists for the key mobile platforms:
Platform Framework Intrinsic
iOS Unnamed[0] Yes
Android JUnit 3.x Yes
BlackBerry J2MEUnit[1] No - opensource
J2ME J2MEUnit[2] No - opensource
[0] Older versions of iOS relied on opensource frameworks such as OCUnit
[1] Customised versions used e.g.http://www.logicmail.org/browser/trunk/J2MEUnit Other options are alsoavailable e.g. btest[2] Some manufacturers provide other options e.g. Sony Ericsson, and other opensource options are available.
8
System testing
Android:
l Instrumentation
l Robotium
l TEMA http://tema.cs.tut.fi/
iPhone: UIAutomation for IOS 4
J2ME: http://code.google.com/p/jinjector/
Breaking news:
Google engineers demonstrated proof-of-concept code @Selenium Conference on 6 th April 2011, which implements theWebDriver protocol to test native client applications for Android,
iOS and other mobile platforms. Cross-platform opensourcemobile test automation!
8/7/2019 Chapter 5 Test Automation for Mobile Phone Applications Client Applications (10 Apr 2011)
http://slidepdf.com/reader/full/chapter-5-test-automation-for-mobile-phone-applications-client-applications 5/10
9
Robotium
It's like Selenium, but for Android™
Open Source http://code.google.com/p/robotium/
Based on Android's Test Instrumentation Framework
Simplifies and reduces the amount of test automation code whileincreasing the capabilities of the automation
10
Example Robotium Code
private Solo solo;
protected void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity())
}
public void testOpenHelp(){
solo.clickOnButton("Help");boolean lableIsShown = solo.searchText("Instructions for the DAISY player");
//The // is to state that ( should not be treated as a special reg ex symbol
boolean scrolledTextIsShown = solo.searchText(
"and sections \\(where the depth might be level 2\\)");
solo.clickOnButton("Close Instructions")
assertTrue("Lable is not shown", lableIsShown);
assertTrue("Last part of text is not shown", scrolledTextIsShown);
}
From: DaisyReaderTest.java
8/7/2019 Chapter 5 Test Automation for Mobile Phone Applications Client Applications (10 Apr 2011)
http://slidepdf.com/reader/full/chapter-5-test-automation-for-mobile-phone-applications-client-applications 6/10
8/7/2019 Chapter 5 Test Automation for Mobile Phone Applications Client Applications (10 Apr 2011)
http://slidepdf.com/reader/full/chapter-5-test-automation-for-mobile-phone-applications-client-applications 7/10
13
Using emulators Over-the-air (OTA)
We can combine the emulator with OTA
Disable non-essential network traffic
emulator
program
Host operatingsystem
GPRSmodem
Wirelessnetwork
Carriernetwork
Internetnetwork
Webserver
14
Simplifying the Problem
8/7/2019 Chapter 5 Test Automation for Mobile Phone Applications Client Applications (10 Apr 2011)
http://slidepdf.com/reader/full/chapter-5-test-automation-for-mobile-phone-applications-client-applications 8/10
15
Probes
A good way to discover the capabilities and quirks of theclient device
Rough and Ready applications that explore thecapabilities (and limitations) of devices, platforms, etc.
Design them to report information back faithfully
Take advantage of network connectivity to report results
to a central server
16
Examples of Prober clients
Examples of tests:JSR support
Effect of signing
Size of application
RMS accessMemory management
Performance characteristics
8/7/2019 Chapter 5 Test Automation for Mobile Phone Applications Client Applications (10 Apr 2011)
http://slidepdf.com/reader/full/chapter-5-test-automation-for-mobile-phone-applications-client-applications 9/10
17
'Headless' Clients
A variation on Prober Clients
Headless applications don't include a pretty UI
Consists of:
core application logic
networking stack
a minimal UIShould be a thin wrapper around core code
Helps test carrier, and some device & platform bugse.g. the network communications
18
Signature testing
Signature testing is a way to simplify the diagnosis of problems, for instance by creating a desktop application thatemulates the network characteristics of the mobile applicationthat's encountered problems.
Signature testing can:
Help identify and isolate network, carrier and server issues
Reuse the non-UI client code
We can vary the signature, ideally with minimal effort, toascertain how the behavior varies, and to find a sweet-spot of reliable behavior for the mobile application.
c.f.: The 'Turing Test' and emulation for fresh ideas