Lecture 9 testing_packaging_app

30
Application Engineering and Development Topic: Testing and Packaging your App Topic Number: 9

description

L9

Transcript of Lecture 9 testing_packaging_app

Page 1: Lecture 9 testing_packaging_app

Application Engineering and Development

Topic: Testing and Packaging your App

Topic Number: 9

Page 2: Lecture 9 testing_packaging_app

2

Key topics / learning outcomes of this lecture

• Testing principles;• Packaging an Android App.

Page 3: Lecture 9 testing_packaging_app

B4004A L1 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?

Page 4: Lecture 9 testing_packaging_app

B4004A L1 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.

Page 5: Lecture 9 testing_packaging_app

B4004A L1 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;

Page 6: Lecture 9 testing_packaging_app

B4004A L1 6

System Testing

• System testing is performed on the actual device to identify:– any defects;– functionality issues;– usability issues;– security;– installs correctly;– performance;

Page 7: Lecture 9 testing_packaging_app

B4004A L1 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;

Page 8: Lecture 9 testing_packaging_app

B4004A L1 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;

Page 9: Lecture 9 testing_packaging_app

B4004A L1 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;

Page 10: Lecture 9 testing_packaging_app

B4004A L1 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;

Page 11: Lecture 9 testing_packaging_app

B4004A L1 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;

Page 12: Lecture 9 testing_packaging_app

B4004A L1 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;

Page 13: Lecture 9 testing_packaging_app

B4004A L1 13

Example Test PlanTest 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

Page 14: Lecture 9 testing_packaging_app

B4004A L1 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;

Page 15: Lecture 9 testing_packaging_app

B4004A L1 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.

Page 16: Lecture 9 testing_packaging_app

B4004A L1 16

… the end of Testing…

… turning to packaging your App …

Page 17: Lecture 9 testing_packaging_app

B4004A L1 17

The App. in the Emulator

Page 18: Lecture 9 testing_packaging_app

B4004A L1 18

IntelliJ has the tools to package Apps.

Page 19: Lecture 9 testing_packaging_app

B4004A L1 19

Select ‘Generate Signed APK’

Page 20: Lecture 9 testing_packaging_app

B4004A L1 20

Choose ‘Create new …’• To create a ‘key store path’, create a new Folder, and a new filename:

Page 21: Lecture 9 testing_packaging_app

B4004A L1 21

Complete all the fields …

Page 22: Lecture 9 testing_packaging_app

B4004A L1 22

… and the App package is now generated …

Page 23: Lecture 9 testing_packaging_app

B4004A L1 23

… and here it is in my local computer files …

Page 24: Lecture 9 testing_packaging_app

B4004A L1 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.

Page 25: Lecture 9 testing_packaging_app

B4004A L1 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’

Page 26: Lecture 9 testing_packaging_app

B4004A L1 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/index.html

Page 27: Lecture 9 testing_packaging_app

B4004A L1 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.

Page 28: Lecture 9 testing_packaging_app

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

Page 29: Lecture 9 testing_packaging_app

End of presentation

© Pearson College 2013

Page 30: Lecture 9 testing_packaging_app

B4004A L1 30