Programming Capstone Unit test suite (and code skeleton)
14
Juliet Mercado
COP 2939
Computer Programming Capstone
Project Objective
Chatting or Teleconferencing is a process of using technology to bring human beings and their ideas together in spite of the geographical obstacles. A broadcast Chat server has two types of broadcasting and the first one is Public and for this case the message is broadcast to all connected users and the other one is Private and this means the broadcasting will be limited between two clients. Through the help of this chat server, the users can easily communicate and also keep in touch with each other. The end users have the capability to share all kinds of information with other users also such as sending of various files, records and emails. The Broadcasting Chat Server Project that is required to run this project is JRE or the Java Run time Environment software and the users interact with the server through a Graphical User Interface.
Proposed System
The proposed system is a chat application that works in two forms and the first one is the List form. In this form, all the names of the systems connected to a network are drafted. These names can later be utilized for communication with the assistance of mouse event, or in simple language such as a click or a double click. Secondly, there is the Chat form and it is called only when an element is selected from the List form. In this form, a connection is created between the host system and the selected system with the help of a socket. Additionally, all the end users will see other logged in user’s details very efficiently including their logged in time, time spent online and also their personal data like name and messages. The server will provide advanced security feature which will be maintaining the log in information of the users and the user’s list with details.
Broadcasting Chat Server Modules
Server Application: The server application module handles the section of messages being sent and received by the broadcasting server. This module is associated with the SSL techniques and TCP/IP networking technologies. This module contains certain intrinsic logic’s which allow it to convey data about sent messages, appropriate routes of dispatching as well as receiving messages. Diagram for the server application module can be seen below:
Client Application: This module grants access to the user or the client to get logged in with authentic username and password. The client or the user of the system can go through the definite process of message sending in this category with other users of the system.
( Client ) ( Client )
( Chat server )
( Client ) ( Client )
( Client ) ( Client )
Software Requirements
When developing software, defining requirements before commencing development can save time and money. A software requirements report clearly defines everything that the software must achieve and is a starting base for defining other elements of a product, such as charges and timetables. Software requirement articulate, in writing, the needed capabilities, functions, modifications, and constraints of a software development project. The effect of these requirements is realized first from its capability to provide precise communication to the stakeholders on what is being developed and how it will operate. Before developers draft, one line of code, all components of the product have been specified and explained through narratives, specifications, visuals such as diagrams and tables, and through use cases and real-world scenarios.
· Oracle
· JDK
· Eclipse
· NetBeans
· Notepad
Hardware Requirements
· Hard Disk – 2 GB.
· RAM – 1 GB.
· Processor – Dual Core or Above.
· Mouse.
· Keyboard.
· Monitor.
· Printer.
Technologies Used
· Java
The server is designed to execute only on machines which support the windows operating system and will use approximately 700 lines of code. Some features of the application are as follows:
· This application is used for sending messages from one client to all clients. To be precise, the server grabs a message from the sender client and conveys it to all clients. If any client wants to join the chatting session then he/she executes the client application on client end, enters the login name and clicks on the login button and starts the chatting with every client.
· The server is maintaining the list of user names including the client name. After creating the connection with server, the client sends the user name to server and server holds it in the array list and conveys this array list to all clients.
Limitations of the application are as follows:
· This application is used for conveying and receiving the messages but the message is displayed to every client. This means that the application is unable to offer the private chat feature and it is comparable to a multi-party conference.
· Before running the client application, the user has to makes sure the server application is running. If server is not in the execution state then one can’t start the chatting.
Project schedule
|
Activity |
Timeline |
|
planning |
7 days |
|
Implementation |
14 days |
|
testing |
7 days |
|
Deployment and training |
1 day |
|
|
30 days |
System documentation
Installing and operating a newly designed system or modifying an existing application requires a comprehensive record of that system’s design. Documentation is essential in diagnosing flaws and making adjustments. Additionally, it serves as a method of communication among the individuals responsible for building, implementing and maintaining the system.
Training
An important element in creating a training plan is to assess the technical skills of those who will actually use the system on a daily basis. For this case, Technical novices will need more in-depth, step-by-step instruction in basics, whereas more experienced computer users will hastily pick up the basics and benefit from more education that explains to them how to use more complicated or advanced features of the software.
Data Flow diagram
In the following graphic we can see the flow diagram of this chat. When we run the server we create a new thread for manage the connections, it thread creates a socket and wait listening in the selected port for new users.
Once that the user send a request, the listening thread register the request and create another thread sending the connection information to it. In that new thread we build a new socket to manage the connection with the user and hence leaving the main socket free for new user requests. After that we can start to send all the messages that we want between the client and the server until one of them disconnect.
Class diagram
The system has two main classes. The first one is CChatServer to the implemented in the server application and allows the server to create a connection, send packets, get the status of the connection and register all the users’ requests. The second of is CChatClient that must be implemented in the user application and allow it to send request for connection and, after identification normal messages.
Server queue pseudo-code
Controlling loops for chat server
while (Boolean_expression) {
// Statements
}
When executing, if the boolean_expression result is true, then the activities inside the loop will be executed. This will continue as long as the expression effect is true. When the condition becomes invalid, program control passes to the line quickly following the loop. An example of this type of controlling loop in the broadcast server can be seen below:
Broadcast chat server variables
A Java variable is a bit of memory that can hold a data value. A variable thus has a data type. Data types are incorporated in more detail in the text on Java data types. Variables are typically used to store information which the Java program needs to do its function. This can be any kind of information ranging from texts, codes to numbers, temporary results of multi-step calculations and much more. Below is an example of type int variable used in the chat server:
Additionally, as seen above the application implements Instance variables which are formulated when an object is created with the application of the new keyword and destroyed when the object is destroyed. Instance variables hold values that must be referenced by more than one method, constructor or block, or fundamental parts of an object's state that must be present throughout the class. The instance variables are visible for all methods, constructors, and block in the class. Ordinarily, it is recommended to make these variables private. However, visibility for subclasses can be given for these variables with the use of access modifiers. Instance variables can be accessed directly by calling the variable name inside the class.
Project budget
The project budget is a comprehensive estimate of all the costs required to complete project tasks. It is much more comprehensive than the high-level budget developed in the Initiate Stage. The typical budget stipulates costs for staff labor, materials procurement, continuous operating costs and other direct costs such as travel or training. The detailed budget provides the project sponsor with a reliable estimate of how much the project will cost. The detailed budget supports control expectations and gives the project sponsor information to generate a cost/benefit for the project. The statement is also used in the Execute and Control stage to assist in determining whether the project is financially on track. The project activities and the cost can be seen below:
TCP connection
Below is an illustration of how clients will connect with the server and chat seamlessly: