README.MD for building the first purely digital mobile bank in Indonesia
2010 bb dev con
1. Automated
Tes,ng
for
Mobile
Applica,ons
An
experimental
technique
Eing
Ong,
Intuit
Inc.
Louis
daRosa,
Intuit
Inc.
2. Session
outline
•
Introduc,on
•
Simulator
basics
•
Simulator
library
•
Building
your
mobile
app
library
•
Wri,ng
reusable
test
cases
•
Mobile
test
automa,on
framework
•
Advantages
and
limita,ons
•
Q
&
A
2
3. Introduc,on
What
are
we
solving
for
?
•
Various
BB
OS
and
devices
•
End-‐to-‐end
mobile
tests
•
Low
cost
solu,on
•
Mul,ple
mobile
plaLorms
3
4. Simulator
Basics
BlackBerry®
JDE
tool
kit
• Mobile
data
service
(MDS)
• Simulators
suite
• App
installa,on
• Image
capture
4
13. Case
study
–
Address
Book
Demo
• Devices
– Pearl
– Storm
• Simulator
library
• Address
book
– Add
contact
– Find
contact
– Delete
contact
• Automated
tests
13
14. Test
Automa,on
Overview
1. Define
applica<on
interface
This
interface
is
device-‐agnos,c.
2. Implement
the
interface
Implement
interface
in
BlackBerry®
U,lize
Python™
mobile
libraries
e.g.
bblib.py.
3. Write
your
tests
Tests
are
device
independent
and
reusable.
4. Run
14
16. Test
Automa,on
Overview
1. Define
applica<on
interface
This
interface
is
device-‐agnos,c.
2. Implement
the
interface
Implement
interface
in
BlackBerry®
U,lize
Python™
mobile
libraries
e.g.
bblib.py.
3. Write
your
tests
Tests
are
device
independent
and
reusable.
4. Run
16
24. Test
Automa,on
Overview
1. Define
applica<on
interface
This
interface
is
device-‐agnos,c.
2. Implement
the
interface
Implement
interface
in
BlackBerry®
U,lize
Python™
mobile
libraries
e.g.
bblib.py.
3. Write
your
tests
Tests
are
device
independent
and
reusable.
4. Run
24
26. Step
3
:
Run,me
device
binding
def getDeviceClass(self):
""" Returns the device to test """
mobileDevice = self.getMobileDevice()
if mobileDevice == 'pearl':
import pearl
deviceClass = pearl.PearlImpl()
elif mobileDevice == 'storm':
import storm
deviceClass = storm.StormImpl()
else:
import bb
deviceClass = bb.BlackBerry()
return deviceClass
26
27. More
device-‐independent
tests
Addi<onal
tests
are
easy
to
write
def
addContactWithEmailTest(self):
def
addContactWithAddressesTest(self):
def
addContactWithAllDetailsTest(self):
def
addContactWithLongDetailsTest(self):
def
addContactAddressWithStateZip(self):
def
addContactAddressWithCityStateZip(self):
def
addContactAddressWithNoDataNega,veTest(self):
27
28. Step
4
:
Run
• Basic
run
command
– python
<test.py>
• Python™
test
frameworks
– uniqest
– PyUnit
– python-‐nose
28
29. Test
Verifica,on
• Server
hosted
apps
– API
asser,ons
– Database
asser,ons
• Image
asser,ons
self.assertTrue(imagelib.compare(self.device,
testname,
'100%x90%‘))
imagelib.py
:
def
compare(device,
imageName,
crop=None,
tolerance=500)
29
30. Logging
• Ini,aliza,on
self.log
=
self.device.initLogger(self._testMethodName,
self.__class__.__name__)
• Usage
self.log.info('Star,ng
test:
'
+
self._testMethodName)
self.log.debug(self.contact)
self.log.error(‘Missing
image
to
compare’)
• Logs
AddressTest.log
:
2010-‐06-‐10
15:19:46,773
-‐
testCreateAddressMethod
-‐
INFO
-‐
[Address1]
200
Villa
St
Mountain
View
CA
94040
BUSINESS
ADDRESS
30
31. Login
example
on
BlackBerry®
Pearl
Interface
def
login(username,
passwd)
Test (logintest.py)
login(‘user100’,’helloworld’)
enter(username)
def
enter(str)
scroll(‘down’)
def
scroll(ac<on)
enter(password)
def
enter()
enter()
pearlapp.py bblib.py
31
32. Login
example
on
BlackBerry®
Storm
Interface
def
login(username,
passwd)
Test (logintest.py)
login(‘user100’,’helloworld’)
touch(100,100)
enter(username)
def
enter()
touch(100,200)
def
touch(x,y)
enter(password)
touch(150,
300)
stormapp.py bblib.py
32
33. Mobile
Tes,ng
Framework
Mobile
Applica<on
Interface
Python™ Test Framework
Device
Independent
Tests
Runtime device binding
Simulator libraries
BB
app
library
Mobile
app
library
BB
device
library
Device
library
33
34. Advantages
• Zero
cost
to
use
• No
device
sharing/scheduling
• Bigger
device
pool
• Reduce
manual
tes,ng
,me
• Run
on
developers
machines
• Debugging
capabili,es
34
35. Limita,ons
• Requires
ethernet
or
internet
connec,vity
• Does
not
simulate
network
performance
• Does
not
support
hardware
controls
tes,ng
• Dependent
on
simulator
reliability
• Limited
peer-‐to-‐peer
applica,ons
tes,ng
35
37. Acknowledgments
• Desiree
Gosby,
Mobile
Architect
• Paul
Hau,
QA
Manager
• Jaron
Jones,
QA
Manager
• Jason
Pugh,
Architect
(definitely
not
least)
37