2. Key topics / learning outcomes
of this lecture
• Testing principles;
• Packaging an Android App.
2
3. Testing an application
Scenario: You’ve designed your App, and now
want to test it.
Question: What are you testing?
• Unit testing?
• Integration testing?
• System Testing?
• Regression Testing?
• Acceptance Testing?
B4004A L1 3
4. Unit Testing
This relates to a particular section of the source
code, for example:
– a particular module of source code;
– testing a single class;
– testing a single component;
– testing a single module in isolation;
An example may be a button that activates a piece of
code that ‘does something’ or a Java Class.
B4004A L1 4
5. Integration Testing
• This is testing of:
– the aggregation of all of the individual unit testing
items, for:
• functionality;
• user interface quality;
• usability;
• security;
• performance;
B4004A L1 5
6. System Testing
• System testing is performed on the actual
device to identify:
– any defects;
– functionality issues;
– usability issues;
– security;
– installs correctly;
– performance;
B4004A L1 6
7. Regression Testing
When new functionality or changes are added
to an application, regression testing is used for
all testing types, for example:
– installation;
– user interface;
– usability;
– performance;
– security;
B4004A L1 7
8. Acceptance Testing
• Acceptance testing is to verify that the
application meets:
– the original specification;
– any amendments agreed during the design and
build period;
Provided the designed product meets the
specification:
• the design is signed off as ‘Accepted’ by the client;
• the invoice for the work may be submitted;
B4004A L1 8
9. Testing Terminology
• Black box testing
– the test engineer has no knowledge of internal
workings;
– tests are based on requirements and functionality;
• White box testing
– the test engineer has knowledge of internal design
and code;
B4004A L1 9
10. Testing Choices
• Use an emulator;
• Use a device;
• Use several emulators;
• Use several devices;
• Use a software version;
• Use many software versions;
• Use many software versions and many
devices;
B4004A L1 10
11. Other Testing Areas to Consider
• Performance:
– ie response times, battery life, memory, CPU;
• interruptions:
– ie phone call, unplugged cable;
• network testing:
– ie 2G, 3G, 4G, Wi-Fi;
• localization:
– translation working?
• synchronization:
– ie data transfer between devices;
B4004A L1 11
12. Write a Test Plan to Manage the Task
• List what is being tested:
– the device;
– software version;
• List elements to test:
– ie button;
– fault injection – ie create a fault and test what happens;
• List expected response:
– ie button ‘sends’ information to database;
• List whether it is a “Pass” or a “Fail”;
• List comments:
– ie the button text is too small to see;
– ie the data did not arrive at the database;
B4004A L1 12
13. Example Test Plan
B4004A L1 13
Test
Number
Element
Description
Test
Functionality
Expected
Action
Test
Result
Comments Action
1 Button Click Sends
data to
database
PASS Button
text is too
small
Increase button
text size
2 Image of
building
Mouse over image
changes
to image
of lecture
room;
FAIL image
stays the
same
Check code;
Check lecture
room image
exists;
Android
Version
Device Test Engineer Date
4.2.2 Emulator A. N. Other 28/9/2014
14. A Good Test Plan will …
• find software bugs;
• find requirement gaps;
• determine whether the App. meets the design
requirements;
• determine whether the device responds correctly;
• establish whether it functions within an acceptable time;
• confirm whether the device is fully useable;
• confirm whether it meets Accessibility requirements;
• whether the App. can be installed and run;
• overall, whether the build achieves the general results
desired;
B4004A L1 14
15. Software Tools
Some testing may be carried out using Open Source
software tools available:
• Robotium
– Tests are written in Java;
– Tests can be run only on the emulator – not devices;
• Appthwack
– load application to the resource;
– it then installs to the real devices;
– it is researched by:
• running the application;
• taking measurements of memory and CPU usage;
• identifying errors.
B4004A L1 15
16. … the end of Testing…
… turning to packaging your App …
B4004A L1 16
22. … and the App package is now
generated …
B4004A L1 22
23. … and here it is in my local computer
files …
B4004A L1 23
24. About installing the APK file to your
actual Android Device
• The APK (Application Package Files) are a
compressed single-file package of your
Android App.
• The APK must be executed once by tapping
the file for the application to install and run on
your Android device.
B4004A L1 24
25. Getting the APK file on to your device
• Some options:
– obtain a ‘File Manager’ to collect the APK file;
– upload the file to the internet, and download it to your Android
device;
– send the APK file by email from your computer, to your Android
device;
– use Dropbox;
– transfer from your pc to your Android device.
• Let your phone know that you want to allow installs from
‘unknown sources’
– Settings>>Applications, then tick ‘unknown sources’;
– If you have this option, then tick ‘Verify Apps’
B4004A L1 25
26. For the Seminar
• For the seminar after this lecture, you will
– package one of the Apps. built during this module;
– start preparing a test plan for the selected App;
– read:
https://developer.android.com/tools/building/ind
ex.html
B4004A L1 26
27. For the Workshop
• For the workshop after this lecture and
seminar, you will:
– complete the preparation of the test plan on the
selected App;
– actually test the App. against the test plan and
record the results.
B4004A L1 27
28. Essential work for next week
• Please consult the OLE for details of:
– Essential readings*
– Seminar/workshop preparation work*
– Recommended further readings
– Any additional learning
* Essential readings and preparation work must always be completed in time
for the next session
28