Project The Watson Game

Document Sample
Project The Watson Game Powered By Docstoc
					                          Project: The Watson Game
                               Function: Client
                     Subsystem: Chat Feature – networking
                             Author: Erik Miller
                                Date: 5/7/2005




Class: CS-495 Spring 2005                                   Author: Erik Miller
Project: The Watson Game                                       Date:05/07/2004
Function: Client
Subsystem: Chat Feature – networking portion
1      Introduction ................................................................................................................. 3
    1.1      Goals and objectives ........................................................................................... 3
    1.2      Statement of scope .............................................................................................. 3
    1.3      Software context ................................................................................................. 3
    1.4      Major constraints ................................................................................................ 3
2      Data design.................................................................................................................. 4
    2.1      Internal software data structure ........................................................................... 4
    2.2      Global data structure ........................................................................................... 4
    2.3      Temporary data structure .................................................................................... 4
    2.4      Database descriptio ............................................................................................. 4
3      Architectural and component-level design ................................................................. 4
    3.1      Program Structure ............................................................................................... 4
       3.1.1      Architecture diagram .................................................................................. 4
       3.1.2      Alternatives ................................................................................................. 5
    3.2      Description for Component n.............................................................................. 5
       3.2.1      Processing narrative (PSPEC) for component n ......................................... 5
       3.2.2      Component n interface description. ............................................................ 5
       3.2.3      Component n processing detail ................................................................... 5
    3.3      Software Interface Description ........................................................................... 7
       3.3.1      External machine interfaces ........................................................................ 7
       3.3.2      External system interfaces .......................................................................... 7
       3.3.3      Human interface .......................................................................................... 7
4      User interface design................................................................................................... 7
    4.1      Description of the user interface ......................................................................... 7
       4.1.1      Screen images ............................................................................................. 7
       4.1.2      Objects and actions ..................................................................................... 7
    4.2      Interface design rules .......................................................................................... 8
    4.3      Components available ......................................................................................... 8
    4.4      UIDS description ................................................................................................ 8
5      Restrictions, limitations, and constraints .................................................................... 8
6      Testing Issues .............................................................................................................. 8
    6.1      Classes of tests .................................................................................................... 8
    6.2      Expected software response ................................................................................ 8
    6.3      Performance bounds............................................................................................ 8
    6.4      Identification of critical components .................................................................. 8
7      Appendices .................................................................................................................. 9
    7.1      Requirements traceability matrix ........................................................................ 9
    7.2      Packaging and installation issues ........................................................................ 9
    7.3      Design metrics to be used ................................................................................... 9
    7.4      Supplementary information (as required) ........................................................... 9



Class: CS-495 Spring 2005                                                                                    Author: Erik Miller
Project: The Watson Game                                                                                        Date:05/07/2004
Function: Client
Subsystem: Chat Feature – networking portion
SOFTWARE DESIGN SPECIFICATION



1                 Introduction
1.1                 Goals and objectives
      To implement the networking protocol for a chat feature that is to
      be included in the Watson Game.


1.2                Statement of scope
         A description of the software is presented. Major inputs,
         processing functionality, and outputs are described without
regard
         to implementation detail.

      The implemented software will consist of 2 major function/method
calls. One, the listener, will be initialized during game startup, and
will start a separate thread in which to listen for incoming messages.
The other, the chat message sender, will send a message to a listener
object, either in the same game, or in another player’s game.


1.3                 Software context
         The software is placed in a business or product line context.
         Strategic issues relevant to context are discussed. The intent is
         for the reader to understand the 'big picture'.

      The chat feature, will be used to enable a global chat method
between multiple players that are playing the Watson Game
simultaneously, so that players can converse with one another while
playing. All messages that are sent using the chat feature will be
sent to all players in the game allowing communication through the
game.


1.4                Major constraints
         Any business or product line constraints that will impact he
         manner in which the software is to be specified, designed,
         implemented or tested are noted here.

      Major constraints include a lack of background in programming
sockets and threads, as well as well defined libraries that are to be
used in the production of the software.


Class: CS-495 Spring 2005                                    Author: Erik Miller
Project: The Watson Game                                        Date:05/07/2004
Function: Client
Subsystem: Chat Feature – networking portion
2                Data design

2.1                Internal software data structure

      None used



2.2                Global data structure
      None used


2.3                Temporary data structure
      An array of characters is used in sending a string message across a
      Socket interface.

2.4                 Database description
      None used



3                 Architectural and component-level design
A description of the program architecture is presented.


3.1                Program Structure
      Both functions are located in the CWatsonGamePlay files,
ListenerThread is declared as a friend function to CWatsonGamePlay,
because new threads cannot be created as member function of classes
using the method I have chosen. The definition of ListenerThread is
located in CWatsonGamePlay.cpp, and the decleration is in
CWatsonGamePlay.h. SendChatMsg is declared as a member function of the
CwatsonGamePlay class.


3.1.1                    Architecture diagram
                A pictorial representation of the architecture is
presented.


Class: CS-495 Spring 2005                                     Author: Erik Miller
Project: The Watson Game                                         Date:05/07/2004
Function: Client
Subsystem: Chat Feature – networking portion
3.1.2                    Alternatives
                None


3.2                Description for Component n
        ListenerThread component


3.2.1                  Processing narrative (PSPEC) for component n
      When the CWatsonGamePlay classes Init() method is called a new
thread is created, that will listen on port 2323 for any incoming tcp
Connections. When on one is detected it connects and receives any
incoming data on that socket connection. It remains running until the
game is quit.


3.2.2                   Component n interface description.
      The interface of this component           is the socket connection that is
created to listen and accept messages           from. It will output any message
that is received to CWatsonGamePlay’s           DisplayMessage(string) method
call which places the incoming string           into the chat box.


3.2.3                Component n processing detail
3.2.3.1         Interface description
     This components interface to clients, is through the
socket 2323. The component continually tries to accept new
connections, when one is detected it accepts the
connection. It will then receive any data that is sent
over the connection.

3.2.3.2         Algorithmic model (e.g., PDL)
          Set up connection
          while no connection
          {
                wait for a connection to be accepted
                once connection is established, retrieve a sent message
                parse the message, to create a string
                send the message string to the chat menu, message display
          }
          exit



Class: CS-495 Spring 2005                                          Author: Erik Miller
Project: The Watson Game                                              Date:05/07/2004
Function: Client
Subsystem: Chat Feature – networking portion
3.2.3.3          Restrictions/limitations
        This is a very basic implementation, there are more efficient methods to send and
retrieve messages.

3.2.3.4          Local data structures
          An array of characters is used in sending the data, and is later parsed to create a
string

3.2.3.5          Performance issues3.2.3.6 Design constraints



3.3                 Description for Component n
         sendChatMsg component


3.3.1                   Processing narrative (PSPEC) for component n
      When a message is sent from the chat display this component is
called to initialize an outgoing socket connection to another computer
(tested using the local machine) it then sends the message to socket
2323 of the target machine, and then exits


3.3.2                   Component n interface description.
      The interface to this component is the method call which takes in
a string message, and then outputs it to the socket connection that has
already been established, by sending an array of characters that make
up the string.


3.3.3                Component n processing detail
3.3.3.1          Interface description
      The interface consists of the method call, which takes in a
string, and the socket connection, which is created in the same way as
the listener thread connection, but instead of being set to accept it
only sends messages.

3.3.3.2          Algorithmic model (e.g., PDL)
          Set up connection
          Create a buffer of characters
          Set all the buffer memory to zero
          Place the string message into the character buffer
          Send the buffer to the listening socket
          exit

Class: CS-495 Spring 2005                                                     Author: Erik Miller
Project: The Watson Game                                                         Date:05/07/2004
Function: Client
Subsystem: Chat Feature – networking portion
3.3.3.3          Restrictions/limitations
        This is a very basic implementation, there are more efficient methods to send and
retrieve messages.

3.3.3.4          Local data structures
          An array of characters is used in sending the data, and is later parsed to create a
string

3.3.3.5          Performance issues3.2.3.6 Design constraints
          None


3.4                      Software Interface Description
          The software's interface(s) to the outside world are described.


3.4.1                   External machine interfaces
      The machine will eventually have the ability to connect to other
machines via the socket connection. It is currently implemented to
only connect to the local machine.


3.4.2                   External system interfaces
          None

3.4.3                   Human interface
          None

4                 User interface design
      None, all user processing is handled by menu objects, that call
sendChatMsg.

4.1                 Description of the user interface
          None

4.1.1                Screen images
          None

4.1.2                Objects and actions
          None


Class: CS-495 Spring 2005                                                     Author: Erik Miller
Project: The Watson Game                                                         Date:05/07/2004
Function: Client
Subsystem: Chat Feature – networking portion
4.2                 Interface design rules
        N/A

4.3                Components available
        N/A

4.4                      UIDS description
        N/A



5                Restrictions, limitations, and constraints
      Without the ability to connect two games together testing the
chat feature in a real world situation is impossible. Also limited
knowledge by developers leads to ad hoc implementations, where there is
little or no experience in the tasks at hand.




6                Testing Issues
      First testing methods were based on creating a standalone chat
program that could be started, and connected to another chat program
with the same implementation that was already running. This was done
on one machine using 2 different sockets. Integrating this into the
Watson game was then done, and tested using one of the standalone chat
programs running, listening on the target socket to make a connection.

6.1                Classes of tests
        Black-Box testing was the primary method for testing these components.
Integration testing, and unit testing were also done when errors were located or when it
was being integrated


6.2                Expected software response
      Expected results from testing were originally to see statements
typed into one program show up in the other, later tests expectations
were to see a message that is sent in the game appear twice in the
games display message box, once when the message is entered to be sent,
and once when it is received by the listener object.

6.3                Performance bounds
        None

6.4                Identification of critical components
      All components of ListenerThread and SendChatMsg are critical in
sending and receiving messages.

Class: CS-495 Spring 2005                                                Author: Erik Miller
Project: The Watson Game                                                    Date:05/07/2004
Function: Client
Subsystem: Chat Feature – networking portion
7                Appendices
7.1                Requirements traceability matrix
Requirement #         Chat Networking Requirement      Parse #
CNR1                  The User shall be able to send
                      message to other players
CNR2                  The User shall be able to
                      receive message from other
                      players


7.2                Packaging and installation issues

7.3                Design metrics to be used
7.4                 Supplementary information (as required)




Class: CS-495 Spring 2005                                        Author: Erik Miller
Project: The Watson Game                                            Date:05/07/2004
Function: Client
Subsystem: Chat Feature – networking portion

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:8
posted:7/3/2010
language:English
pages:9