sweng500-carpool-presentation - Assembla

judgedrunkshipΔιακομιστές

17 Νοε 2013 (πριν από 3 χρόνια και 6 μήνες)

120 εμφανίσεις

Carpool Application

Eric Borisow

Geoff Scholl

Ty Huynh

2

Agenda


Our Project Idea


Requirements


Our Development Approach


Live Demo


Testing Results


Metrics


Summary

3

Project Description


Create an application that could be used by an
organization (such as a company or institution) that
allows people to organize carpools.


Blackberry application for carpooling services.





4

Requirements (main points)


Users can register
themselves


Users must login to use the
system


Search function to review
existing trips


Create a carpool trip


find existing matching trips


find similar trips


Select preferred start/end
points


uc Web Application System Use Case

Carpool Web Appl i cati on
Find Places
Find Places
Near Location
Find Similar
Trips
Login
Get User
Manage Trip
Update Saved
Address

Authenti cati on Servi ce
User
Application Manager
uses
«fl ow»
5

Components Used


Blackberry API


Blackberry Java
Development Environment
(JDE)


Hibernate Persistence


Apache Tomcat


Subversion (SVN)


Another Neat Tool (ANT)


Build script tool


Eclipse


Blackberry Plugin for
Eclipse


Structure 101


Spring Framework


Apache Axis 2


MySQL


MGMaps map API


Apache HTTP

6

Components Used


Blackberry API


Blackberry Java
Development Environment
(JDE)


Hibernate Persistence


Apache Tomcat


Subversion (SVN)


Another Neat Tool (ANT)


Build script tool


Eclipse


Blackberry
Plugin

for
Eclipse


Structure 101


Spring Framework


Apache Axis 2


MySQL


MGMaps

map API


Apache HTTP

Development Approach


“Bottom
-
up”


Define the requirement


Define the data model


Create Interfaces and Tests


Create simple implementation


Define WSDL/Create Web Service


Create Test for Web Service


Build user interface for Blackberry


Fill
-
in database implementation to get real data

8

Hibernate


Object to Relational Tool

Java
Class
Database Table
Hibernate
Cfg File
9

Hibernate Object
-
to
-
Table Mapping


class sweng
500
-
1
USERS
«col umn»
*PK
ID: NVARCHAR(40)

USER_NAME: NVARCHAR(50)

PASSWORD: NVARCHAR(50)

GIVEN_NAME: NVARCHAR(150)

SURNAME: NVARCHAR(150)
FK
ORGANIZATION_ID: NVARCHAR(40)
«FK»
+
FK_USERS_ORGANIZATIONS(NVARCHAR)
«uni que»
+
UQ_USERS_USER_NAME(NVARCHAR)
«PK»
+
PK_USERS(NVARCHAR)
ORGANIZATIONS
«col umn»
*PK
ID: NVARCHAR(40)

NAME: NVARCHAR(75)
«PK»
+
PK_ORGANIZATIONS(NVARCHAR)
«uni que»
+
UQ_ORGANIZATIONS_NAME(NVARCHAR)
+FK_USERS_ORGANIZATIONS
0..*
(ORGANIZATION_ID = ID)
«FK»
+PK_ORGANIZATIONS
1
public

class
User
{
private
String id
;
private
String userName
;
private
String password
;
private
String givenName
;
private
String surName
;
private
Organization organization
;
}
10

Hibernate Config File

11

Hibernate Sample Code

12

Axis2 for Web Services

`
`
`
Internet
Client Application
2
.
Application marshalls
message
4
.
Application
unmarshalls response
1
.
Client sends request
5
.
Client receives
response
3
.
Application
invokes Web
Service
Users
13

Axis2 Server
-
side process

Server Application
4
.
Perform database
operations
Internet
1
.
Web Service invoked
by client
2
.
Server Application
receives message
7
.
Send message back
through service
3
.
Unmarshall request
6
.
Marshall response message
Web
Service
Service to
object
mapping
3
.
Map Service to
object
5
.
Map object to
Service
14

WSDL Bindings


class CarPoolService
«WSDLservi ce»
CarPoolService
«WSDLbi ndi ng»
Bindings::CarPoolServiceSOAP11Binding
+
fi ndPl aces(Fi ndPl acesRequest, Fi ndPl acesResponse*, CarPool Servi ceExcepti on*)
+
fi ndPl acesNearLocati on(Fi ndPl acesNearLocati onRequest, Fi ndPl acesNearLocati onResponse*, CarPool Servi ceExcepti on*)
+
fi ndSi mi l arTri ps(Fi ndSi mi l arTri psRequest, GetTri psByUserResponse*, CarPool Servi ceExcepti on*)
+
fi ndTri ps(SearchTri psRequest, GetTri psByUserResponse*, CarPool Servi ceExcepti on*)
+
getTri p(GetTri pRequest, GetTri pResponse*, CarPool Servi ceExcepti on*)
+
getTri psByUser(GetTri psByUserRequest, GetTri psByUserResponse*, CarPool Servi ceExcepti on*)
+
getUser(GetUserRequest, GetUserResponse*, CarPool Servi ceExcepti on*)
+
updateSavedAddresses(UpdateSavedAddressesRequest, Si mpl eMessageResponse*, CarPool Servi ceExcepti on*)
+
updateTri p(UpdateTri pRequest, UpdateTri pResponse*, CarPool Servi ceExcepti on*)
+
updateTri pUser(UpdateTri pUserRequest, Si mpl eMessageResponse*, CarPool Servi ceExcepti on*)
CarPool Servi ceSOAP11port_http
15

Web Service Update Process


act WSDL File Generation
Devel oper
Axi s2
System
Create Java
Interface
Execute
Java
2
WSDL

Java
2
WSDL generates a

basi c WSDL from a Java

i nterface
Updated
generated WSDL
WSDL
Execute
WSDL
2
Java
Java2WSDL
utility
Generated Stub
Classes
Implement Interface
generated from Axis
Service
Implementation
16

Web Service Demo

17

Blackberry Development

Blackberry Simulator
MDS
Developer
Internet
Eclipse IDE
Local Development
Environment
Tomcat Server
5
.
5
MySQL Database
deploy war
deploy cod
18

Mobile Data Services (MDS)


Required for accessing the web services


Needed when running the simulator


Required for the device to work for normal usage
(data provider must enable)


It’s basically just a proxy server for the device

19

Blackberry API


The Blackberry API is a combination of the J2ME
libraries and the Blackberry APIs


We wanted to use this library because there is better
support for the features that are only available on
Blackberry


The J2ME libraries lack some of the functionality
that is available in the basic Java API

20

Mapping Technologies


The choices that we had to investigate:


Google Maps


Yahoo Maps


Microsoft Maps


Blackberry Map


These APIs only have basic features available from
a custom program


Even the Blackberry API only displays an image
rather than something interactive


We found two APIs that seemed to do what we
wanted and were
FREE


J2MEMaps and MGMaps

21

Decision: J2MEMaps vs. MGMaps


J2MEMaps


Works with J2ME devices


Provided place mapping and
selection


Supports KML for location
images


MGMaps


Works with J2ME and
Blackberry API


Provided place mapping and
selection


Supports KML for location
images


Plugs into
CloudMade

for
turn
-
by
-
turn directions


Winner: After three weeks… MGMaps!

22

MGMaps


Map can be centered on a
latitude/longitude point


Places are added using
lat/long


Map can be navigated using
keys mapped in program


Places are selected by
selecting the trackball


Events are sent back to
your code via listeners

Live Demo

Testing


JUnit

24

Method name

Assertion

Description

Expected Result

testLoginSuccess

Logon response value is
not equal to 6000.

Test to ensure logon and
password is correct.

Not 6000

testLoginFailure

Logon response is 6000.

Test to ensure the password is
incorrect. The value 6000
represents an error.

6000

testGetUser

User is not null.

Retrieve user
eborisow

from the
database.

Not Null

testGetBadUser

User is null.

Retrieve user
badUser

from the
database.

Null

testGetNoUser

User is null.

Retrieve user “” (empty string)
f牯r t桥h摡d慢慳a.

k畬u

t敳t䝥drse牂rfd

rs敲efa 楳 湯n 湵汬n

o整物敶攠畳敲e楤i1111ㄠw桩h栠
灯楮瑳 t漠畳敲e敢潲楳潷

k潴 k畬u

t敳t䝥d䉡Brs敲䉹fd

rs敲efa 楳 湵汬n

o整物敶攠畳敲e楤i㈳㐳㈠w桩h栠
灯楮瑳 湯n畳敲

k畬u

t敳t䝥dk潕se牂rfd

rs敲efa 楳 湵汬n

Retrieve user id “” which points
湯n畳敲.

k畬u

Testing


JUnit

(sample code)

25

Testing


JUnit

26

Testing


Results

Test Case

Name

Result

TC
-
01

Logon

PASS

TC
-
02

Search trips

PASS

TC
-
03

Create default location

PASS

TC
-
04

Create trip

PASS


Testing were based on Scenario testing.


Single scenario verifies multiples requirements.


Fours scenarios to verify all requirements.

27

Testing


Traceability matrix

28

Test Cases
/
Req

ID

TC
-
01

TC
-
02

TC
-
03

TC
-
04

3.2.2.1

x

3.2.2.2

x

x

x

x

3.2.2.3

x

3.2.2.4

x

3.2.2.5

x

3.2.2.6

x

3.2.2.7

x

3.2.2.8

x

3.2.2.9

x

3.2.2.10

x

3.2.2.11

x

3.2.2.12

x

3.2.2.13

x

3.3.2.1

x

3.3.2.2

x

3.3.2.3

x

x

3.3.2.4

x

3.3.2.5

x

3.3.2.6

x

3.3.2.7

x

3.3.2.8

x

Metrics


Carpool Web Project

29

Metrics


Carpool Blackberry
Project

30

Summary


Blackberry Development is somewhat mature but
there are some things missing


It’s very dependent on graphical rendering


our
screens were relatively simple


Using Web Services was required, but is also nice
when using multiple views (i.e. web applications)


Project Home


https://www.assembla.com/spaces/psu
-
edu
-
sweng500

Questions?