Master's Degree in Computer Engineering


Figure 30: Device registration of the Google Cloud Messaging service token



Download 1.14 Mb.
Page5/23
Date30.06.2017
Size1.14 Mb.
#22137
1   2   3   4   5   6   7   8   9   ...   23

Figure 30: Device registration of the Google Cloud Messaging service token

When a user opens the application after logging in through the JOL Table Me server, the Dashboard activity is displayed, at the beginning on the creation of this layout the device registers to the Google Cloud Messaging service obtaining a token that is sent to the server with the id of the user.

4.2.3.1. Send challenge notification





Figure 31: Sequence diagram for sending a challenge notification to a player

The match creator from the Table 1:Actors is the actor in charge of creating a match with the mobile device, after starting the Game Activity, the data of the teams is collected through the Communication Manager and after the selection a request notification is sent to the server with the key string “send_not” and the server send a message with the game id and the participants to the Google Cloud Messaging with the tokens of the players.

4.2.3.2. Receive Challenge Notification





Figure 32: Sequence diagram for receiving a challenge notification from Google Cloud Messaging and showing it in the phone and the smartwatch

When a notification arrives from the Google Cloud Messaging, the service My GCM Listener Service start and show a brief notification in the phone and send the message through the Data API using Send to Data Layer Thread, to the smartwatch to raise a more detailed notification in the watch. After the player from the Table 1:Actors, sees the notification and accepts the challenge the Game Service start, then it proceeds to register the web socket to the server and after that the player begins to receive updates from the server.

4.2.3.3. In Game





Figure 33: Sequence diagram for adding goals, auto goals and dismissing a goal during a match intthe smartwatch

This phase is based in the interaction of the player with the smartwatch in the Game Activity, tapping in the different options (add a goal, add an auto goal or dismiss a goal). After a player tap on a button the smartwatch communicates with the phone to send a command to the server to update the score. When a team wins the result is sent to the server so every player is notified of a victory with the list of players that won the match. In the case of dismissing a goal, the Match object take care of decrease properly the score and as before the score is sent to be updated.

4.2.3.4. Show profile information





Figure 34: Sequence diagram for showing the profile information in the smartwatch

When a player opens the application in the smart watch and select the profile option, the phone is notified with a remote call using the Message API. After receiving the request, the phone start the Game Service and send the current information of the player registered in the device. All the relevant information (photo, name, elo and position) is sent through the Data API to the smartwatch, finally is displayed to the user.

4.2.3.5. Show match history





Figure 35: Sequence diagram to show the match history in the smartwatch of the player of the device

When a player opens the application in the smart watch and select the match history option, the phone with the Message API as before. The application uses the Communication Manager to retrieve the list of last ten games of the player. Then the score is selected and sent through Data API to the smartwatch. After that, if the player wants to see the detail of a match, the watch notifies with a remote call to the phone and the Game Service will receive the request of the information of a specific match. With that, the service searches the information of the player’s participant on the match and all the relevant information of the four players (photo, name, elo and position) is sent to the smartwatch.

4.2.3.6. Show leader board





Figure 36: Sequence diagram for showing the leader board in the smartwatch

When a player opens the application and selects the leader board, the application is notified via Message API with a remote call and the Game Service start and retrieve the list of players organizing them by the position and selecting the first ten players. The all the relevant information (photo, name, elo and position) is sent to the smartwatch and displayed in a list with the photo, the name and the position in a badge with a distinctive color for the first three players. Moreover, if the player wants to see the profile information in detail of a player on the leaderboard, after clicking it on the list, the profile layout is displayed with the information of the specific player.

4.3. Wear Client



4.3.1. Class diagram



Figure 37: Table Me Wear Domain Diagram

The wear application for the smart watches was design to only deal with communication management and a light processing load of work that will be done by the mobile application. The application is directed by the Wear Lobby Activity that is the activity that manages the home layout of the application, and the Listener Service that receive the remote calls and information from the phone. Moreover, the communication relays only on the Wearable API through the Bluetooth connection between the devices. To see the complete class diagram, Annex: Class Diagram.

The next activities to be explain send a remote call through the Message API to invoke the Game Service in the phone so it can send the requested data in a data map through the Data API. Each activity creates an individual connection with the phone and receive the information.

The following elements are the structure of the Wear client.

  • Listener Service, a service that start when receive a data map through the Data API, the service is dedicated to start the Game Activity when a match start or a player accept a challenge and to rise a notification sent from the phone.

  • Wear Lobby Activity, the home layout when the user opens the application with a list with the options profile, match history, leaderboard, achievements and exit. The user can select the options and it will be redirected to the activity with the required information.

  • Win Activity, activity that control a layout that shows when a team win or lose a match with the final score.

  • Profile Activity, activity that control a layout that shows the relevant information (photo, name, elo and position) of a player. This activity is reused to show the detail of any other player in the leader board or in the match history.

  • Leader board Activity, activity that controls a layout that shows in a list the ten first positions in the leaderboard with a photo, the name of the players and the position in a badge. If the user clicks on any of the players in the list, a detail of the selected player’s profile is shown.

  • History Activity, activity that controls a layout that shows a list of the ten last games played by the user. The list shows the score and an indicator if the user won or lose the game

  • Detail History Activity, If the player clicks to see the detailed score, an activity will rise with the photos and positions of the teams and the score. Additionally, if the user clicks the photo of any participant player it displays the profile information of the selected player.

4.4. Tests

The applications were tested in every iteration of the development to assure the fulfillment of the use cases and main objectives of the project. When the functionalities of the application were finished, they were tested multiple times and the test were done incrementally (every item developed was always re tested together with the previous items to verify their behavior).

The following are the tests done during the development to ensure the completion of the objectives.

4.4.1. Use case testing



Functionality

Use Cases tested

Description of tests

Show profile information

UC-001, UC-024, UC-038

The tests performed were done by recovering the profile information from the Table Me server, and the communication with the smartwatch using the data layer, when the application is open and closed in the phone.

Show leader board

UC-001, UC-025, UC-039, UC-024, UC-038

The tests performed were done by recovering the list of players from the Table Me server and organizing them by the position. Additionally, the communication with the smartwatch using the data layer, when the application is open and closed in the phone.

Show match history

UC-040, UC-026, UC-001, UC-024, UC-038

The tests performed were done by recovering the list of matches of the player from the Table Me server. Additionally, the communication with the smartwatch using the data layer, when the application is open and closed in the phone.

Challenge players

UC-003, UC-005, UC-006, UC-007, UC-002, UC-004, UC-008, UC-009

The tests performed were done in the Multiplayer server sending multiple notifications to the challenged players by a host, when the application is open and closed in the phone.

Start multiplayer game

UC-010, UC-011, UC-018, UC-019, UC-031, UC-027, UC-028, UC-011, UC-032

The tests performed were done in the Multiplayer server and the application accepting and creating a match with none active players up to four active players, when the application is open and closed in the phone.

Manage a multiplayer game

UC-015, UC-018, UC-019, UC-020

The tests performed were done in the Multiplayer server sending multiple commands from different games at the same time.

Show final results

UC-018, UC-019, UC-021, UC-026

The tests performed were done in the Multiplayer server processing the final results of a match and in the application sending the results to the Table Me server.

Android Wear Connection

UC-001, UC-010, UC-011, UC-015, UC-035

The tests were performed connecting and disconnecting the smartwatch during a match and in idle state when the user is in the menu.

Server Connection

UC-036, UC-031, UC-032, UC-028, UC-030, UC-018, UC-002

The tests were performed connecting and disconnecting the phone from internet during a match and in idle state when de user is not using the application or is in the dashboard.

Table 4: List of Use case testing performed.

4.4.2. User Interface Testing



The user interface in the smartwatch was validated via the lineaments given by Android [21], following the rules described by them. With this the following metrics were applied to verify each feature and screen to validate the usability.

  • Design for big gestures [21]: in list menus as the home screen must display at maximum 3 items big enough to cover the screen to be easily touched.

  • Stream Cards [21]: for the notifications, they were prioritized to be queued when a challenge arrives. If the player does not attend the notification the next one will replace it. The notification can be reused for multiple games without dismissing it.

  • Do one thing, really fast [21]: Each feature of the application has followed the maximum amount of four touches and swipes to performed the functionality.

    • Profile: Open application, touch profile, dismiss card.

    • Leader board: Open application, touch leader board, dismiss card.

    • Game history: Open application, touch game history, touch summary, dismiss.

    • Game: In game interaction, dismiss result card.

  • Design for the corner of the eye [21]: The application has summarized information on each card to not keep the player too long in the application, so it was decided to check at maximum to have five items per screen that fill the interface that are easy to read.

    • Profile: Photo, name, elo, classification.

    • Leader board: List with photo and classification.

    • Game history: List with indicator of victory or loss, score, text of victory or loss.

      • Game summary: Four photos and score.

    • Game: Add goal button, add auto goal, remove goal, score.

      • End game: result badge and text of victory or loss.

  • Don’t be a constant shoulder tapper [21]: The application only will notify when the user is challenged vibrating just once per notification.

5. Conclusions

  • The objective of creating a multiplayer version of the Table Me application was totally fulfilled developing and adapting the main features of the Table Me application, following the design lineaments of Android and the user’s requirements.

  • The implementation of the Peer to Peer server with lockstep without simulation using Socket IO to improve the communication allow to the application an easy to use interface in real time to communicate the application with the server allowing to not increment significantly the delay the communication between the items that have a small traffic interaction.

  • The communication performance given by the application using Android Wear technology in the testing environment gave excellent results with a maximum delay of 1 to 2 seconds to deliver the information to the smartwatch, this delay due to the Bluetooth connection range and obstacles that can be between the devices.

  • The APIs from the Wearable package used in the project to develop the communication with the application were the Message API due to the easy usage and the functionalities that provide to send appropriately remote procedure call with the games commands (goals, dismiss goals, auto goals) adapting the Peer to Peer server’s structure Finally, the Data API to synchronize large amounts data (profile, leader board, match history) using Assets and supporting basic data types.

  • The Android Wear application was design to not consume large amounts of energy of the smartwatch during the operation during the game or when the user is consulting information. For this reason, the application does not keep the screen on until the user actively focusses the screen to use it, and the heavy load operations are provided by the service in the phone that runs only when the user request information through an interaction.

  • The design of the application for the smartwatch was based on sketches previously done by the group in the laboratory, and the last version fulfilled the final user’s expectation giving enhanced and easy to use interfaces during the gameplay and consulting the player information following the design lineaments of Android [21].

  • The methodology used for the development of the project allowed to create an organize and schedule to deliver the application and deliverables items to fulfill the items to be developed with the approval of the final user on time.

  • The Android wear technology is advancing faster, allowing different functionalities to be used with the phone or a direct connection with internet, and the basic channels of communications between the devices, offer the basic data exchange and easy to use. It allows an easy and fast development of android wear applications. However, the management of large amount of data to be exchanged via Bluetooth can take too long and present inconsistent data. With the time when the technology migrates to the usage of Wi-Fi or better connection with the smartwatch allow a better network performance.

6. Bibliography

[1] “The Spiral Model > UltimateSDLC.com,” The Ultimate Guide to the SDLC, 13-Aug-2011.

[2] Enrico Catalano, “Table Me - table soccer app on Behance.” [Online]. Available: https://www.behance.net/gallery/31215047/TableMe-table-soccer-app. [Accessed: 10-Apr-2016].

[3] “2359 Media: Mobile Application Development | Android for wearables: Opportunities and Limitations of Watch Apps.” [Online]. Available: http://2359media.com/2014/09/26/android-for-wearables-opportunities-and-limitations-of-watch-apps/. [Accessed: 25-Apr-2016].

[4] “Sending and Syncing Data | Android Developers.” [Online]. Available: http://developer.android.com/intl/es/training/wearables/data-layer/index.html. [Accessed: 11-Apr-2016].

[5] “Wearable,” Google Developers. [Online]. Available: https://developers.google.com/android/reference/com/google/android/gms/wearable/Wearable. [Accessed: 11-Apr-2016].

[6] “Google Cloud Messaging: Overview,” Google Developers. [Online]. Available: https://developers.google.com/cloud-messaging/gcm. [Accessed: 10-Apr-2016].

[7] Dan Adrei, “How To Create a Server to Send Push Notifications with GCM to Android Devices Using Python,” DigitalOcean. [Online]. Available: https://www.digitalocean.com/community/tutorials/how-to-create-a-server-to-send-push-notifications-with-gcm-to-android-devices-using-python. [Accessed: 10-Apr-2016].

[8] “Creating a Notification for Wearables | Android Developers.” [Online]. Available: http://developer.android.com/intl/es/training/wearables/notifications/creating.html. [Accessed: 10-Apr-2016].

[9] “MessageApi,” Google Developers. [Online]. Available: https://developers.google.com/android/reference/com/google/android/gms/wearable/MessageApi. [Accessed: 10-Apr-2016].

[10] “WearableListenerService,” Google Developers. [Online]. Available: https://developers.google.com/android/reference/com/google/android/gms/wearable/WearableListenerService. [Accessed: 11-Apr-2016].

[11] “Accessing Google APIs,” Google Developers. [Online]. Available: https://developers.google.com/android/guides/api-client. [Accessed: 11-Apr-2016].

[12] Michael Hahn, “Data Layer Messages — Android Wear Docs 1.2 documentation.” [Online]. Available: http://android-wear-docs.readthedocs.org/en/latest/sync.html. [Accessed: 10-Apr-2016].

[13] “DataApi,” Google Developers. [Online]. Available: https://developers.google.com/android/reference/com/google/android/gms/wearable/DataApi. [Accessed: 10-Apr-2016].

[14] “Asset,” Google Developers. [Online]. Available: https://developers.google.com/android/reference/com/google/android/gms/wearable/Asset. [Accessed: 11-Apr-2016].

[15] Michael Hahn, “Data Layer DataMap Objects — Android Wear Docs 1.2 documentation.” [Online]. Available: http://android-wear-docs.readthedocs.org/en/latest/data.html. [Accessed: 10-Apr-2016].

[16] “P2P.” [Online]. Available: http://ww2.cs.fsu.edu/~jungkkim/P2P.html. [Accessed: 28-Apr-2016].

[17] “A Distributed Architecture for Interactive Multiplayer Games, Ashwin R. Bharambe Jeff Pang Srinivasan Seshan.” .

[19] “php - What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet? - Stack Overflow.” [Online]. Available: http://stackoverflow.com/questions/11077857/what-are-long-polling-websockets-server-sent-events-sse-and-comet. [Accessed: 28-Apr-2016].

[20] “drewww/socket.io-benchmarking @ GitHub.” [Online]. Available: http://drewww.github.io/socket.io-benchmarking/. [Accessed: 25-Apr-2016].

[21] “Design Principles for Android Wear | Android Developers.” [Online]. Available: http://developer.android.com/intl/es/design/wear/principles.html. [Accessed: 25-Apr-2016].

[22] “FURPS - Ingeniería Software.” [Online]. Available: http://clases3gingsof.wikifoundry.com/page/FURPS. [Accessed: 28-Apr-2016].

[23] Dan Adrei, “How To Create a Server to Send Push Notifications with GCM to Android Devices Using Python.”

[24] “Android Wear Book: Create an Advanced Wearable List View,” Home. .

[25] Dejan Đurovski, “Android Wear - Wearable Message Api.” [Online]. Available: http://dejan.djurovski.net/2015/01/15/android-wear-wearable-message-api/. [Accessed: 10-Apr-2016].

[26] Paresh Mayani, “Android Wear - Part 4 - Simple notifications.” [Online]. Available: http://www.technotalkative.com/android-wear-part-4-simple-notifications/. [Accessed: 10-Apr-2016].

[27] “Developer Guidelines,” Google Developers. [Online]. Available: https://developers.google.com/nearby/developer-guidelines. [Accessed: 10-Apr-2016].

[28] E. Terpstra, “Building Multiplayer Games with Node.js and Socket.IO,” Modern Web, 30-Sep-2013.

[29] “Android Wear Docs, michael Hahn.”

[30] “Ingenieria de requerimientos, Herramienta para Implementar LEL y Escenarios.” .

[31] S. Okamoto, M. Kamada, M. Kohana, and T. Yonekura, “Rapid Authoring of Web-based Multiplayer Online Games,” in Proceedings of International Conference on Information Integration and Web-based Applications & Services, New York, NY, USA, 2013, pp. 639:639–639:643.

[32] “ChannelApi,” Google Developers. [Online]. Available: https://developers.google.com/android/reference/com/google/android/gms/wearable/ChannelApi. [Accessed: 11-Apr-2016].

[33] R. D. Richard K. Lomotey, “Efficient mobile services consumption in mHealth.” [Online]. Available: http://dl.acm.org/citation.cfm?id=2500279&CFID=599129620&CFTOKEN=16880902. [Accessed: 10-Apr-2016].

[34] arungupta, “REST vs WebSocket Comparison and Benchmarks,” Miles to go 3.0 ..., 24-Feb-2014.

[35] Lorie Pisicchio, “SSE vs Websockets,” Streamdata.io, 21-Apr-2015. .

[36] cjihrig, “Server-Sent Events in Node.js,” Colin J. Ihrig’s Blog, 08-Aug-2012. .

[37] Nodejs Hispano, “Introducción a Socket.io #nodejs | Node.js Hispano.” .

[38] “Sending and Receiving Messages | Android Developers.” [Online]. Available: http://developer.android.com/intl/es/training/wearables/data-layer/messages.html. [Accessed: 10-Apr-2016].

[39] “Gcm http://developer.android.com/intl/es/training/wearables/data-layer/index.html Service,” Google Developers. [Online]. Available: https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmListenerService. [Accessed: 11-Apr-2016].

[40] “Il modello di comunicazione long-polling,” HTML.it. [Online]. Available: http://www.html.it/pag/33600/il-modello-di-comunicazione-long-polling/. [Accessed: 11-Apr-2016].

[41] “Simple Long Polling Example with JavaScript and jQuery.” [Online]. Available: http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery. [Accessed: 11-Apr-2016].

[42] “Research of Web Real-Time Communication Based on Web Socket, by Qigang Liu, Xiangyang Sun.” .

[43] “The Web Sockets API.” [Online]. Available: https://www.w3.org/TR/2009/WD-websockets-20091222/. [Accessed: 11-Apr-2016].

[44] “WebSocket,” Wikipedia, the free encyclopedia. 01-Apr-2016.

[45] “Tecnología Push,” Wikipedia, la enciclopedia libre. 26-Nov-2015.

[46] “Socket.IO JavaScript framework ready for real-time apps | InfoWorld.” [Online]. Available: http://www.infoworld.com/article/2607757/javascript/socket-io-javascript-framework-ready-for-real-time-apps.html. [Accessed: 12-Apr-2016].

[47] “Real-Time Systems.” [Online]. Available: https://users.ece.cmu.edu/~koopman/des_s99/real_time/. [Accessed: 25-Apr-2016].

[48] “Socket.IO — Introducing Socket.IO 1.0.” .

[49] “A Node.js speed dilemma: AJAX or Socket.IO? | CUBRID Blog.” [Online]. Available: http://www.cubrid.org/blog/cubrid-appstools/nodejs-speed-dilemma-ajax-or-socket-io/. [Accessed: 25-Apr-2016].

[50] “Android Wear,” Wikipedia, the free encyclopedia. 20-Apr-2016.

[51] “About | Node.js.” [Online]. Available: https://nodejs.org/en/about/. [Accessed: 28-Apr-2016].

[52] “El Libro para Principiantes en Node.js» Un tutorial completo de node.js.” [Online]. Available: http://www.nodebeginner.org/index-es.html. [Accessed: 28-Apr-2016].

[53] “Understanding the Node.js Event Loop,” NodeSource, 21-Jan-2015. [Online]. Available: http://nodesource.com/blog/understanding-the-nodejs-event-loop/. [Accessed: 28-Apr-2016].

[54] “What is Spiral model- advantages, disadvantages and when to use it?” [Online]. Available: http://istqbexamcertification.com/what-is-spiral-model-advantages-disadvantages-and-when-to-use-it/. [Accessed: 28-Apr-2016].

[55] “Android Wear | Android Developers.” [Online]. Available: https://developer.android.com/design/wear/index.html#Other. [Accessed: 05-Oct-2016]

[56] “Gaffer on Games | Deterministic Lockstep.” Available: http://gafferongames.com/networked-physics/deterministic-lockstep/ [Accessed: 05-Oct-2016].

[57] “Introduction | Understanding Model-View-Controller.” [Online]. Available: https://stefanoborini.gitbooks.io/modelviewcontroller/content/. [Accessed: 05-Oct-2016].

[58] “WebSockets vs Server-Sent Events vs Long-polling.” [Online]. Available: http://dsheiko.com/weblog/websockets-vs-sse-vs-long-polling/. [Accessed: 05-Oct-2016].



7. Appendixes



7.1. Software Requirement Specification

POLYTECHNIC OF TURIN

Faculty of Engineering

Master's Degree

in Computer Engineering

Software Requirement Specification





Andres Camilo Jimenez Vargas

October 2016

Index

1. Introduction 1

1.1. Description of the problematic 3

1.1.1. Formulation of the problem 3

1.1.2. Justification of the project 3

1.1.3. Expected Impact 4

1.2. Description of the project 4

1.2.1. General Objective 4

1.2.2. Specific Objectives 4

1.3. Expected deliverables 4

1.4. Methodology 5

2. Theoretical frame 7

2.1. Basis concepts about Table Me application 7

2.1.1. Profile features 7

2.1.2. In game features 9

2.2. Conceptual frame 11

2.2.1. Android Wear 11

2.3.1. Communication between devices 12

2.3.1.1. Notifications using Google Cloud Messaging 13

2.3.1.2. Message API 14

2.3.1.3. Data API 15

2.3.1.4. Channel API 16

2.3.2. Architecture for a multiplayer game 17

2.3.2.1. Peer to Peer 17

2.3.2.1. Client/Server 18

2.3.3. Communication technologies 19

2.3.3.1. Long Polling 19

2.3.3.1.1. AJAX Long polling 20

2.3.3.2. Web sockets 21

2.3.3.2.1 Socket IO 22

2.3.3.3. Technology benchmark 23

2.3.4. Graphic User Interface Design for Android Wear 24

3. Analysis 26

3.1. Proposed model 26

3.1.1. Distributed gameplay 26

3.1.2. User information management 27

3.2. Software prototype 27

3.2.1. Use cases 27

3.2.1.1. Actors 28

3.2.1.2. Use case description 28

3.2.2. Requirements description 29

3.2.3. Data model 30

3.2.4. Programming language for the server side 30

3.2.5. Architecture 31

3.2.6. Features and technical aspects 32

3.2.6.1. Profile information on the smartwatch 32

3.2.6.2. Gameplay on the smartwatch 33

3.2.6.3. Match history on the smartwatch 34

3.2.6.4. Leader board on the smartwatch 35

4. Development of the Solutions 36

4.1. Server 36

4.1.1. Class diagram 36

4.1.2. Server event behavior 37

4.2.1. Class diagram 38

4.2.2. Mobile event behavior 39

4.2.3. Sequence diagram of the behavior of the Game Service 40

4.2.3.1. User registration with the GCM token 40

4.2.3.1. Send challenge notification 41

4.2.3.2. Receive Challenge Notification 41

4.2.3.3. In Game 42

4.2.3.4. Show profile information 43

4.2.3.5. Show match history 44

4.2.3.6. Show leader board 45

4.3. Wear Client 46

4.3.1. Class diagram 46

4.4. Tests 47

4.4.1. Use case testing 47

4.4.2. User Interface Testing 48

5. Conclusions 50

6. Bibliography 51

7. Appendixes 54

7.1. Software Requirement Specification 54

1.Introduction 63

2.Process of development of requirements 64

2.1. Obtaining the use cases and requirements 64

2.2. Refinement of the use cases 64

2.3. Functional requirements 64

2.4. Nonfunctional requirements 64

2.5. Requirement identification 64

2.6. Requirement specification 65

2.7. Requirement prioritization 65

2.8. Verification and validation 66

2.9. Requirement traceability 66

2.9.1 General traceability 66

2.9.2. Individual traceability 67

3.Global Description 67

3.1. External interfaces 67

3.1.1. User Graphic Interface 67

3.1.1.1 Profile information on the smartwatch 67

3.1.1.2. Gameplay on the smartwatch 67

3.1.1.3. Match history on the smartwatch 68

3.1.1.4. Leader board on the smartwatch 69

3.1.2. Software and Hardware interface 69

3.2. Application characterization 70

3.3. User characterization 70

3.4. Restrictions 70

3.5. Assumptions and dependencies 71

3.6. Domain Model 72

3.7. Requirement distribution. 72

7.2 Use Case Specification 75

October 2016 75

Index 76

UC-035 Reconnect Wear Device 81

UC-036 Reconnect Player 81

UC-038 Request user information 82

UC-039 Request match history 82

UC-040 Request leader board 83

UC-001 Synchronize wear data 83

UC-002 Register device to the server 84

UC-003 Create a match 84

UC-004 Send notification to a device 85

UC-005 Select read team 86

UC-006 Select blue team 86

UC-007 Use GCM service for a token 87

UC-008 Receive challenge notification 87

UC-009 Show challenge notification 88

UC-010 Accept challenge 88

UC-011 Start Match 89

UC-015 Manage Score 90

UC-018 Update score 90

UC-019 Display score 91

UC-020 Select winner 92

UC-021 Display winner or loser 92

UC-024 Show profile data 93

UC-025 Show leaderboard 93

UC-026 Show matches history 94

UC-027 Notify player ready 94

UC-028 Register player ready 95

UC-030 Register player decline 96

UC-031 Create match 96

UC-032 Cancel match 97

7.3 Functional Requirement Document 98

October 2016 98

Index 99

7.4. Non Functional Requirement Documents 123

October 2016 123

7.5. Requirement priorization 133

7.6. Installation Manual 135

2.1. Profile information on the smartwatch 136

2.2. Gameplay on the smartwatch 136

2.3. Match history on the smartwatch 137

2.4. Leader board on the smartwatch 137

7.7. Relational Matrix of Functional Requirements 139

7.7. Domain Model 140

7.8. Use Case Diagram 141

7.9. Class Diagram Table Me 142

7.10. Authorization Letter 143

8. Acknowledgments 148

Figure table

Figure 1: Spiral model from Barry W. Boehm [1] 5

Figure 2: Profile screens of Table Me 8

Figure 3: Singular Match History Table Me 8

Figure 4: Main leader Board Table Me 9

Figure 5: Player Selection Table Me. 9

Figure 6: In Game Screen Table Me 10

Figure 7: End Game Table Me 10

Figure 8: Android Wear Context Stream[3] 11

Figure 9: Physical Architecture of multiple devices[4]. 12

Figure 10: GCM Architecture[7] 13

Figure 11: Message API Architecture of the implementation[12] 15

Figure 12: Data API Architecture of the implementation[15] 16

Figure 13: Peer to Peer architecture from Napster[16] 17

Figure 14: Architecture of components of Colyseus, () 18

Figure 15: Long Polling [58] 20

Figure 16: AJAX Long Polling behavior[19] 21

Figure 17: Web Socket Architecture [58] 21

Figure 18: Speed Benchmark for AJAX persistent server, Socket IO server and Socket IO persistent server [49] 23

Figure 19: Concurrent Benchmark on Socket IO server, number of messages sent by roundtrip time in different concurrent rates[20] 24

Figure 20: Proposed Model 26

Figure 21: Data Model 30

Figure 22: Physical Architecture 31

Figure 23: Showa player profile in the smartwatch screens 33

Figure 24: Notification displayed in the smartwatch for the players. 33

Figure 25: In game screens for the blue team and the read team, and the screens for victory and lose. 34

Figure 26: Showa player’s match history in the smartwatch screens 34

Figure 27: Showa player leader board in the smartwatch screens 35

Figure 28: Multiplayer Server Class Diagram 36

Figure 29: Table Me Domain Diagram 38

Figure 30: Device registration of the Google Cloud Messaging service token 41

Figure 31: Sequence diagram for sending a challenge notification to a player 41

Figure 32: Sequence diagram for receiving a challenge notification from Google Cloud Messaging and showing it in the phone and the smartwatch 42

Figure 33: Sequence diagram for adding goals, auto goals and dismissing a goal during a match intthe smartwatch 43

Figure 34: Sequence diagram for showing the profile information in the smartwatch 44

Figure 35: Sequence diagram to show the match history in the smartwatch of the player of the device 44

Figure 36: Sequence diagram for showing the leader board in the smartwatch 45

Figure 37: Table Me Wear Domain Diagram 46

Figure 38: Original Karl Wiegers formula for requirement prioritization 65

Figure 39: Profile information 67

Figure 40: Notification on the smartwatch 68

Figure 41: In Game screens with victory and lose screens 68

Figure 42: Leader board screen 69

Figure 43: Requirement classification 73

Table index

Table 1:Actors 28

Table 2: Phases of the Table Me application 29

Table 3: Use cases 29

Table 4: List of Use case testing performed. 48

Table 5: User characterization table 70

Table 6: Requirement classification specification 74

  1. Introduction

The Joint Open Lab (JOL), a research group of Telecom Italia (TIM), developed an application named Table Me for Android and IOS mobile devices, to manage a game of table foosball. This document is done to describe the process of recollection and analysis of the requirements for a distributed game version of the Table Me application using smart watches, the application will be developed for Android mobile devices and Android Wear devices.

For the correct way to structure and implement this solution is necessary to control the requirements that the system needs based on the user’s necessities and the previous scope of the Table Me application done before. The requirements are the base of the development process of the system, for this reason these must be analyzed in an adequate way to identify correctly the features of the application and the restrictions that this and the projects are attach.

Therefore, this can be used as a manual for the development of the project, this will allow to do the appropriate evaluation of the punctual functionalities that must be in the application, develop a prioritization to know the order of the implementation of the features, and finally trace all the dependencies of the system.

The present will have a scope of the following characteristics:

  • Description of the process followed for the requirement recollection and analysis.

  • Description of the prioritization process of the requirements to determine the functionalities to implement.

  • Description of the process for obtaining the use cases.

  • The domain model of the Server, the Android and the Android Wear applications.



  1. Process of development of requirements

2.1. Obtaining the use cases and requirements

The recollection of the use cases and the requirements was done based on the description of the game given by Marco Marengo, Cecchi Gian Luca and Alessandro Izzo knowledgeable people that through a series of reunions had explain application functionality and the desired features to be implemented with the Android Wear technology. Additionally, the usage of the actual working application in the testing version on the Google Play Store. From this was developed a description of the main features and their principal elements.

2.2. Refinement of the use cases



For the refinement of the use cases, every time a set of use cases were developed, the application was presented to Marco Marengo and from that, all the feedback was implemented in the application and corrected in the use case and requirement specification. Additionally, with the guidance Marco Marengo, Cecchi Gian Luca and Alessandro Izzo and the usage of the Table Me application, it is possible to concrete the scenarios when and where the application will be in use.

2.3. Functional requirements



Based on the description of the application’s features, the experience acquires form the presentations and the use cases that have been developed the functional requirements of the system. Where are specified the characteristics that the project must include for the completion.

2.4. Nonfunctional requirements



Based on the presentations of the application and the design decision taken, it has been developed the nonfunctional requirements of the system. These describe the attributes and restriction that the project must achieve to be accepted by the client.

2.5. Requirement identification



The identification was done through the use cases based on the description of the application. Based on these, the application’s flow was described in the assert or failure situations and from that the requirements were identified contemplating the lineaments of the previous Table Me application. Thanks to this process it was able to classify the requirements adequately easing the requirement specification.

2.6. Requirement specification



The attributes used for the specification of the requirement were:

  • ID: Unique deification of the requirement.

  • Description: Definition of the requirement.

  • State: Shows the phase of progress of the requirement in the following classification: Proposed, Validated, Implemented.

  • Priority: priority of each requirement that is based on the modified formula of Karl Wiegers, that give a score that if is greater than 1 has more priority.

  • Type: Functional or Nonfunctional.

  • Relations: Show the relation of the requirement with the other requirements and the use cases, these can be of dependence or realization.

2.7. Requirement prioritization

The prioritization of the requirements was estimated based on the formula of Karl Wiegers. The method is described in the following way (All the measures are done from 1 to 9):

  • Benefit: relative benefit of the implementation of the requirement.

  • Penalization: relative penalization if the requirement is not implemented.

  • Cost: calculation of the relative cost, based in the following factors: complexity, design and code reuse, and documentation needed.

  • Risk: relative risk based on the technic complexity and the feasibility needed.

It is necessary to remember that these indicators are subjective to the person involved in the development and implementation of the project.

The formula of Wiegers is the following:



Figure 38: Original Karl Wiegers formula for requirement prioritization

Where the value is the sum of the benefit and the penalization in percentage. The cost weight and the magnitude assigned to each item, in this case there has been assigned the same magnitude to both for this their value is 1.

In conclusion, it has been decided for the project’s requirement prioritization to use this measurement where the higher calcification shows the most complex and costly requirements to implement.

2.8. Verification and validation



The verification of the requirements was done through the reunions with Marco Marengo, Cecchi Gian Luca and Alessandro Izzo and the presentations of the application refining the requirements.

The validation of the requirements was done using a checklist by the Construx Software Builders that verify the following attributes.

  • Is unique?

  • Is explanatory?

  • Is consistent?

  • Is feasible?

  • Has correct references?

  • Is precise and not ambiguous?

  • Us atomic?

  • Is traceable?

  • Is a declaration of a necessity and not a solution?

  • Is it necessary?

  • Show how to execute it?

2.9. Requirement traceability

2.9.1 General traceability



The traceability of the requirements is developed through different tools that were used to perform the follow up, identification of requirements and the dependencies to help the development of the application and the integration with the previous Table Me application.

The tools used to manage the traceability of the requirements are the following:

  • Use cases: the use cases are used for the identification of the requirements, moreover are necessary to establish the information flow in the different scenarios.

  • Prioritization table: The table of requirements prioritization to identify easily the order of implementation of which requirements must be implemented in the correct way achieving the essential functionalities of the system. (Annex: Prioritization Table)

  • Realization Matrix: This matrix is used to identify the relations between the requirements and use cases, so in the same way in a graphic way identify the dependencies between requirements and how to find the prerequisites between them.

    • Annex: Realization Matrix for functional requirements.

2.9.2. Individual traceability

The individual traceability of the requirements is done by the attributes that allow to identify the relations of dependency and implementation through the system.

The attributes of each requirement to be traced are the following:

  • Use case relations: the use case where the requirement was obtaining, and has a relation that implements it.

  • Requirement relations: The requirements that are associated and dependent to the requirement.

  1. Global Description

3.1. External interfaces

3.1.1. User Graphic Interface

3.1.1.1 Profile information on the smartwatch

After opening the application, the user can use a list of option to select about the user’s profile information and the game. The profile option shows in a similar way as in the Table Me application the basic information of the user. Firstly, the photo, the position in the leader board inside a badge, two bars that indicate proportionally the number of victories (green bar) and number of lost games (red bar). The at the end the name of the user and his/her ELO score.



Figure 39: Profile information

3.1.1.2. Gameplay on the smartwatch



After a user that will host a game organize and create the team, a notification is issued to the participants of the match will receive a notification in their phones and to their smartwatches if they have one. At the watch the following notification is displayed.



Figure 40: Notification on the smartwatch

Then, when the user start playing the game, the screen with the buttons where the player can interact with the score is provided, with a button to add a goal in the center, a dismiss goal button at the left bottom and an auto goal button at the right bottom. The user can interact with them and the score is displayed in the results displayed in top of the screen with its respective colors of the team.



Figure 41: In Game screens with victory and lose screens

Finally, in each case the users of a team win or lose a match the following screens are displayed in the smartwatches using a base badge with their goals scored.

3.1.1.3. Match history on the smartwatch



When the match history option is selected, the user is provided with a brief list of the last ten matches that he/she was part of. Each match is signaled with a cross and the message “Lost!” if the player lost that game, or a check and the message “Won!” if the player won the game. If the player wants to know a more detailed information of the match, it is possible to click an item on the list and will provide a screen with the background color of the victorious team, the score, and the photo of the participants. If the user wants to see the players profile information, he/she can click on the image and the profile information will be displayed.

3.1.1.4. Leader board on the smartwatch



When the leader board is selected a list of the ten first places in the leaderboard is loaded and take between 3 to 4 seconds. After waiting, the list displays the basic information of the player in the displayed position with his photo, name and position in a badge. If the user wants to see the profile of the player in a certain position, he/she can select a player in the list and it will show the basic profile information of the player.



Figure 42: Leader board screen

3.1.2. Software and Hardware interface



The Android mobile application is able to deploy on mobile devices that have a distribution from Android 5.0 (Lollipop) to Android 4.1 (Jelly bean). And for the Android Wear application that have a distribution from Android 4.4 (KitKat) to Android 5.0 (Lollipop). The application can be used in smart watches with round screen or rectangular screen. Finally, the server can be deployed in a computer that has installed Node JS and had installed Socket IO, and Google Cloud Messaging plugins for Node JS.

3.2. Application characterization



The final system must allow the following characteristics:

  • The server application must support multiple client connections in multiple matches.

  • The server application must allow to create multiple matches.

  • A client through the TableMe application can create a game notifying the server and the involved players allowing them to use their smartwatches if they have any.

  • The match host and the players can help to manage a game’s score.

  • Every player with a smartwatch can score a goal, dismiss a goal or score an auto goal.

  • All the players and the host will be notified in real time from the server.

  • The host of the game will see the progress of the game in the user graphic interface of a match from the previous TableMe application.

3.3. User characterization

User type

Description

Privileges

Previous knowledge

Player

A player can enter to a game is has a smartwatch, the notification is displayed on the watch and can be opened from it.

  • Connect to a match.

  • Score goals, dismiss goals and score auto goals.

  • Win a match.




The user must have the application in the mobile device, in the smartwatch. Additionally, know how to play table foosball.

Host

The host is a user that creates a game from the TableMe application inviting to play other players.

  • Control all the scores of all the players.

  • Create a match.

  • Finish a match.

The user must have the application in the mobile device. Additionally, know how to play table foosball.

Table 5: User characterization table

3.4. Restrictions



For the development of the project are the following restrictions:

  • Language restriction:

    • The clients must be implemented in Android for the Android mobile and Android Wear devices.

    • The server must be implemented in Java Script using the platform Node JS.

  • Programming restriction: The project will be implemented using the Object Oriented paradigm for software development.

  • Connection restriction:

    • The server must admit multiple user connection simultaneously for multiple matches.

    • The mobile client must connect to a single server that host the matches.

    • The match will be alive until the match host finish the game or it gets disconnected.

  • Game restriction:

    • The system must implement a table foosball match rules with four players, following the lineaments stipulated by the previous TableMe application.

  • Architecture restriction:

    • The system must develop following the Client/Server architecture for the communication for between the server and the mobile devices.

    • The system must use the Colyseus multiplayer game architecture for the implementation of the game instances in the clients and the server.

  • Persistent restrictions:

    • The server application must persist the devices registered with a new Google Cloud Messaging token.

    • The server will not use a data base for the persistency.

    • The persistency will be done through normal files.

  • User interface restrictions:

    • The interfaces of the system will be in English.

3.5. Assumptions and dependencies

The following dependencies are considerate for the development and execution of the system:

  • The server used in the previous TableMe application will provide information of the user’s profile, and match history. Additionally, the leaderboard of the players.

  • The mobile devices used must be connected to internet.

  • The mobile devices may or not have a smartwatch paired.

  • The requirements of the system are formulated by Marco Marengo though presentations of the application and the guideline of the previous Table Me application.

The following assumptions are considered for the development and execution of the system:

  • The mobile and smartwatch devices where the application is installed can execute the application.

3.6. Domain Model

The domain model of the application is represented in the following diagram: and specified in the following document: Annex: Domain Model

3.7. Requirement distribution.



Based on the process of identification of requirements, it has been stipulated that the following classification of requirements must be divided in different functionalities and phases of the game and the application. The following diagram shows the classification of the requirements:



Figure 43: Requirement classification

The following table shows a brief explanation of the different categories of requirements defined above.

Type

Classification

Description

Functional

Menu options

Requirements about displaying the profile information, match history and leader board.

Game preparation

Requirements about the process to prepare a game and notify the players that will be involved in the game.

Connection

Requirements about the connection between the server and the mobile client, and the mobile client and the smartwatch.

In game

Requirements about a current match with or without multiple players, hosted by a user of the TableMe application.

Game end

Requirements about the finishing phases of a game.

Non-functional

Interface

Requirements that allow the flow between the application information and the user.

Usability

Requirements that provide the system’s way to use for the users.

Performance

Requirements of the performance expected from the applications.

Compatibility

Requirements of the compatibility dependencies needed to deploy and execute the system.

Reliability

Requirements that allow support in failure cases.

Scalability

Requirements that guide the system on how must grow as the user grow too.

Implementation

Requirements of the system implementation.

Table 6: Requirement classification specification

7.2 Use Case Specification



POLYTECHNIC OF TURIN

Faculty of Engineering

Master's Degree

in Computer Engineering

Use case Specification



Andres Camilo Jimenez Vargas


Download 1.14 Mb.

Share with your friends:
1   2   3   4   5   6   7   8   9   ...   23




The database is protected by copyright ©ininet.org 2024
send message

    Main page