Professional Documents
Culture Documents
On
Submitted to
the faculty of Engineering and Technology of
KakatiyaUniversity, Warangal
in partial fulfillment of the requirements
to award
Bachelor of Technology
in
Information Technology
BY
AJAY BANDARI
(B17IT006)
R.GAUTAM
i
CERTIFICATE
This is to certify that Ajay Bandari (B17IT006) of VI- Semester B.Tech. Information
Technology has satisfactorily completed the Mini Project entitled “A Group Chat Application
using Java” in the partial fulfillment of the requirement of B.Tech degree during this academic
year 2019-2020.
R.GAUTAM Dr.P.KAMAKSHI
Assistant Professor , Dept. of I.T. Professor & Head, Dept. of I.T.
ii
ACKNOWLEDGEMENT
I wish to take this opportunity to express my deep gratitude to all the people who have
extended their cooperation in various ways during my Miniproject. It is my pleasure to
acknowledge the help of all those individuals.
I thank Dr. K. Ashoka Reddy, Principal of Kakatiya Institute of Technology & Science,
Warangal, for his strong support.
In completing this Mini project successfully all our faculty members have given an
excellent cooperation by guiding us in every aspect. All your guidance helped me a lot and I am
very grateful to you.
Ajay Bandari
(B17IT006)
iii
CONTENTS
Abstract vi
1. Introduction
1.2 Objective 01
1.3.1 Modules 02
2. Literature Survey
3. Design
iv
3.6 Component Diagram 12
4. Implementation
4.1 Methodology 14
4.2 Code 15
5. Testing 20
6. Results 24
Conclusion 25
Future Scope 26
Bibliography 26
v
ABSTRACT
A Group Chat is exchanging or communicating through the Internet. a group chat application using
additional capabilities for joining “groups” of other multicast hosts on the internet.
Online chat may refer to any kind of communication over the Internet that offers a real-time transmission
of text messages from sender to receiver. Chat messages are generally short in order to enable other
participants to respond quickly. Thereby, a feeling similar to a spoken conversation is created, which
distinguishes chatting from other text-based online communication forms such as Internet forums and email.
Online chat may address point-to-point communications as well as multicast communications from one sender
to many receivers and voice and video chat, or may be a feature of a web conferencing service.
Online chat in a less stringent definition may be primarily any direct text-based or video-based
(webcams), one-on-one chat or one-to-many group chat (formally also known as synchronous
conferencing), using tools such as instant messengers, Internet Relay Chat (IRC), talkers and
possibly MUDs. The expression online chat comes from the word chat which means "informal
conversation". Online chat includes web-based applications that allow communication – often
conferencing is a more specific online service, that is often sold as a service, hosted on a web
vi
LIST OF FIGURES
vii
CHAPTER 1
INTRODUCTION
Chat server is an online system created for the community of people to interact with one another
on the Internet. This system provides solution to most of the shortcomings of the traditional
system. The teachers, students and the firm are profited evenly by the suggested system. The
system preserves a great amount of time and effort too, for both. A new software has been
introduced for chatting, which is called Chat Server. This software plays a pivotal role in
decreasing the interaction gap among the various people in a college, so it can be termed as very
significant for the college.
1.2 OBJECTIVE
The entire purpose of a group chat is to share information with a number of people, not to
exchange inside jokes with just one person. Avoid doing this at all costs or run the risk of
annoying everyone. Technology is touching and transforming nearly every area of our lives,
especially our relationships. The group chat, for instance, is replacing face-to-face conversations.
With that digital shift, comes unspoken etiquette, safety considerations, and a level of
responsibility that can easily get lost in the chatter.
Group chats are efficient and fun. But whether you use SMS or group chat apps such as What’s
App, GroupMe, Messenger, or others, chances are you (or your kids) have had at least one
texting mishap along the way.
1
1.3.1 MODULES
Administrator level
Staff level
Student level
Parent level
Administrator level:
Changes is needed in the system, he enter this level and will make enough changes .He
is the only authorized person to alter the details in database and other important areas of
the system. The updating of the details and other details are edited by him. If a new user
is registered administrator has the privilege to approve or deny his /her request .
Staff level:
This is for the staffs working at the various departments or branches. Staff will log in
using the user id and password. Staff will enter the details(subject , department etc.. )
while registering.feedback and chatting facility are available to teachers.
Student level:
Student can login in to the site from anywhere .He can register online, if registration is
completed, he is provided with login name and password .Using this he can login and
know the status of the other chatters .He can chat with his friends (online and offline)
and a also send feedback to his teachers.
Parent level:
Student can login in to the site from anywhere .He can register online, if registration is
completed, he is provided with login name and password .Using this he can login and
know the status of the other chatters .He can chat with his sons studing in that college
(online and offline) and a also make a conversation with teachers about the students .
CHAPTER 2
LITERATURE SURVEY
Internet communication is getting more and more popular among the public. Apart from using
telephones or automobiles and sending mails, people can now communicate with each other
2
through the chat technology. The chat, is a kind of Internet technology that supports human-to-
human communication. IC, for instance, is one of the latest chat. Over the past two years, with
the advanced level of technology, there is an increasing trend of using IC for communication.
With IC, users can chat, send messages, files and URL’s. As per [2] Yahoo Chat is a free online
chat room service which was provided exclusively only for Yahoo! Users and was first launched
on January 7, 1997. It was said to be a feature on the very first release of Yahoo! Pager. The first
public version was released on March 9, 1998. Yahoo Chat allows its users to create public chat
rooms, send text messages and use emoticons. As per [2] Skype is an instant messaging
application. It provides online text message and video chat services. Users may transmit both text
and video messages and allows exchange of digital documents. Skype allows video conference
calls. Chatting applications enables us to stay in connected anytime, anywhere from any part of
the world. There are many applications which provides chat services, the most popular among
them are WhatsApp, Facebook messenger, yahoo IM, emails etc. IC applications have evolved
from being just an another application to send messages. The latest IC applications have features
such as transfer of different types of files, video chatting, group chat etc. The common
disadvantage is that these applications restrict the size of the files being transferred. Thus in IC
we have implemented chatting with unlimited data transfer without any size restriction .
For so long we are using different applications for communicating each other by sending
messages over the internet. Chat apps can also allow users to hold group conversations with
both audio ... by using a phone number to authenticate new and existing customers. ... with Open
Whisper Systems to develop an end-to-end encryption system.
We are creating a chat room instead of using the applications like whats app and other
applications,for this we are using java programming language. The system to be developed in
here an chat facility ,It is centralized SystemIt is a Client-Server System using centralized
system using data base server.
All clients are connected to the Centralized server via LAN,There is Two way
Communication system between different clients and server ,The chat application is used for
group discussion.
3
CHAPTER 3
DESIGN
An Intel Pentium class, 600 MHz or higher, a RAM of 256 MB, a Free hard disk space of 600
MB, a super VGA monitor and a CD ROM drive of 52X is required
The Unified Modeling Language (UML) is a standard language for writing software blue
prints. The UML may be used to visualize, specify, construct, and document the artifacts of a
software-intensive system.
The UML is appropriate for modeling systems ranging from enterprise information
systems to distributed Web-based applications and even to hard real time embedded systems. It
is a very expressive language, addressing all the views needed to develop and then deploy such
systems.
The UML is only a language and so is just one part of a software development method.
The UML is process independent, although optimally it should be used in a process that is use
case driven, architecture-centric, iterative, and incremental.
4
Things in UML
First, a class is a description of a set of objects that share the same attributes, operations,
relationships and semantics.
Window
Origin
Size
open()
close()
move()
display()
class
Second, a use case is a description of set of sequence of actions that a system performs that
yields an observable result of value to particular actor.
Use Case
Third, a node is a physical element that exists at runtime and represents a computational
resource, generally having at least some memory and often processing capability.
Nodes
5
Behavioral things are the dynamic parts of UML models. The behavioral thing used is:
Interaction
Messages
● Dependency
● Association
● Generalization
● Realization
A Dependency is a semantic relationship between two things in which a change to one thing may
affect the semantics of the other thing (the dependent thing).
Dependencies
An Association is a structural relationship that describes a set links, a link being a connection
among objects. Aggregation is a special kind of association, representing a structural relationship
between a whole and its parts.
Association
Generalization
6
Realization
Structural Diagrams:
The structural diagrams represent the static aspect of the system. These static aspects represent
those parts of a diagram, which forms the main structure and are therefore stable.
These static parts are represented by classes, interfaces, objects, components, and nodes. The
four structural diagrams are
Class Diagram
Object Diagram
Component Diagram
Deployment Diagram
Class Diagram:
Class diagrams are the most common diagrams used in UML. Class diagram consists of classes,
interfaces, associations, and collaboration. Class diagrams basically represent the object-
oriented view of a system, which is static in nature.
Active class is used in a class diagram to represent the concurrency of the system.
Class diagram represents the object orientation of a system. Hence, it is generally used for
development purpose. This is the most widely used diagram at the time of system construction.
Object Diagram:
Object diagrams can be described as an instance of class diagram. Thus, these diagrams are
more close to real-life scenarios where we implement a system.
Object diagrams are a set of objects and their relationship is just like class diagrams. They also
represent the static view of the system.
The usage of object diagrams is similar to class diagrams but they are used to build prototype of
a system from a practical perspective.
7
Component Diagram:
Component diagrams represent a set of components and their relationships. These components
consist of classes, interfaces, or collaborations. Component diagrams represent the
implementation view of a system.
During the design phase, software artifacts (classes, interfaces, etc.) of a system are arranged in
different groups depending upon their relationship. Now, these groups are known as
components.
Finally, it can be said component diagrams are used to visualize the implementation.
Deployment Diagram:
Deployment diagrams are a set of nodes and their relationships. These nodes are physical
entities where the components are deployed.
Deployment diagrams are used for visualizing the deployment view of a system. This is
generally used by the deployment team.
Note − If the above descriptions and usages are observed carefully then it is very clear that all
the diagrams have some relationship with one another. Component diagrams are dependent
upon the classes, interfaces, etc. which are part of class/object diagram. Again, the deployment
diagram is dependent upon the components, which are used to make component diagrams.
Behavioural Diagrams:
Any system can have two aspects, static and dynamic. So, a model is considered as complete
when both the aspects are fully covered.
Behavioral diagrams basically capture the dynamic aspect of a system. Dynamic aspect can be
further described as the changing/moving parts of a system.
Sequence Diagram
Collaboration Diagram
8
Activity Diagram
Use case diagrams are a set of use cases, actors, and their relationships. They represent the use
case view of a system.
A use case represents a particular functionality of a system. Hence, use case diagram is used to
describe the relationships among the functionalities and their internal/external controllers. These
controllers are known as actors.
Sequence Diagram:
A sequence diagram is an interaction diagram. From the name, it is clear that the diagram deals
with some sequences, which are the sequence of messages flowing from one object to another.
Interaction among the components of a system is very important from implementation and
execution perspective. Sequence diagram is used to visualize the sequence of calls in a system
to perform a specific functionality.
Collaboration Diagram:
Collaboration diagram is another form of interaction diagram. It represents the structural
organization of a system and the messages sent/received. Structural organization consists of
objects and links.
The purpose of collaboration diagram is similar to sequence diagram. However, the specific
purpose of collaboration diagram is to visualize the organization of objects and their interaction.
Statechart Diagram:
Any real-time system is expected to be reacted by some kind of internal/external events. These
events are responsible for state change of the system.
Statechart diagram is used to represent the event driven state change of a system. It basically
describes the state change of a class, interface, etc.
State chart diagram is used to visualize the reaction of a system by internal/external factors.
Activity Diagram:
Activity diagram describes the flow of control in a system. It consists of activities and links.
The flow can be sequential, concurrent, or branched.
9
Activities are nothing but the functions of a system. Numbers of activity diagrams are prepared
to capture the entire flow in a system.
Activity diagrams are used to visualize the flow of controls in a system. This is prepared to have
an idea of how the system will work when executed.
Note − Dynamic nature of a system is very difficult to capture. UML has provided features to
capture the dynamics of a system from different angles. Sequence diagrams and collaboration
diagrams are isomorphic, hence they can be converted from one another without losing any
information. This is also true for Statechart and activity diagram
10
3.5 Class Diagram of Group Chat Application:
11
3.6 Component Diagram of Group Chat Application:
12
3.7 Use Case Diagram of Group Chat Application:
13
3.8 Activity Diagram of Group Chat Application:
CHAPTER 4
IMPLEMENTATION
4.1 METHODOLOGY
When you are designing distributed applications, you must consider availability
and performance. A common solution is to include a data store on the client system.
Typically, the client will require a lightweight data store as a result of li mited
resources. This approach poses a challenge for data synchronization between
heterogeneous data stores. One resolution to this problem is a Java-based approach
14
using JDBC. Distributed databases use a client/server architecture to process information
requests.
Server Side:
Server controls, manages the entire system and stores the complete details
regarding their client. And when request arises, authentication is done and the server
provides the details for the corresponding ones. The ser ver will do the entire work as a
background process. The user does not have any interaction with servers. In this system
the data request once arrived, is accepted from client and. according to the client's
request and sent the data.
Client Side:
This Client-side software will always interact with users working as the front -
end. First of all a connection is established with server. Then make appropriate request
for data. Display the data in the user requested format. Getting specification from t he
user is the main functionalities of the client side and passes it to server side for
processing.
4.1 Code
import java.net.*;
import java.io.*;
import java.util.*;
15
{
if (args.length != 2)
else
try
name = sc.nextLine();
socket.setTimeToLive(0);
socket.joinGroup(group);
16
ReadThread(socket,group,port));
t.start();
while(true)
String message;
message = sc.nextLine();
if(message.equalsIgnoreCase(GroupChat.TERMINATE))
finished = true;
socket.leaveGroup(group);
socket.close();
break;
17
DatagramPacket datagram = new
DatagramPacket(buffer,buffer.length,group,port);
socket.send(datagram);
catch(SocketException se)
se.printStackTrace();
catch(IOException ie)
ie.printStackTrace();
18
private MulticastSocket socket;
this.socket = socket;
this.group = group;
this.port = port;
@Override
while(!GroupChat.finished)
DatagramPacket(buffer,buffer.length,group,port);
String message;
19
try
socket.receive(datagram);
message = new
String(buffer,0,datagram.getLength(),"UTF-8");
if(!message.startsWith(GroupChat.name))
System.out.println(message);
catch(IOException e)
System.out.println("Socket closed!");
CHAPTER 5
TESTING
20
SOFTWARE TESTING:
Software testing is a critical element of software quality and assurance and represents ultimate
review of specifications, design and coding. Testing is an exposure of the system to trial input to
see whether it produces correct output.
TESTING PHASES:
2. The test is conducted and test results are compared with the expected results.
TESTING ACTIVITIES:
2. UNIT TESTING: This find faults by isolating an individual component using test
stubs and drivers and by exercising the components using a test case.
TYPES OF TESTING:
UNIT TESTING:
Unit testing focuses on the building blocks of the software system, that is, objects and
subsystems. They are three motivations behind focusing on components. First, unit testing
reduces the complexity of the overall test activities, allowing us to focus on smaller units of the
system. Unit testing makes it easier to pinpoint and correct faults given that few computers are
involved in this test. Unit testing allows parallelism in the testing activities; that is each
component can be tested independently of one another.
The specific candidates for unit testing are chosen from the object model and the system
decomposition of the system. In principle, all the objects developed during the development
process should be tested. Which is often not feasible because of time and budget.
21
Many unit testing techniques have been devised. Some of them are:
EQUIVALENCE TESTING:
It is a black box testing technique that minimizes the number of test cases. The possible inputs
are partitioned into equivalence classes, and a test case is selected for each class. The assumption
of equivalence testing is that the system usually behaves in similar ways for all members of a
class. To test the behavior associated with an equivalence class, we only need to test one member
of the class. Equivalence testing consists of two steps: identification of the equivalence classes
and selection of the test inputs.
BOUNDARY TESTING:
Boundary testing is a special case of equivalence testing and focuses on the conditions at the
boundary of the equivalence classes. Rather than selecting any element in the equivalence class,
boundary testing requires that the element be selected from the “edges” of the equivalence class.
A disadvantage of equivalence class and boundary testing is that these techniques do not
explore combination of test input data.
PATH TESTING:
Path testing is a white box testing technique that identifies faults in the implementation of the
component. The assumption behind path is that, by exercising all possible paths through the code
at least once, most faults will trigger failures. The identification of paths requires knowledge of
the source code and data structures.The path testing technique was developed for imperative
languages. Object oriented language introduce several difficulties when using path testing.
METHODS OF TESTING:
22
Test case design methods are divided into two types:
1. White-box testing
2. Black-box testing
WHITE-BOX TESTING:
White –box testing, sometimes called glass-box testing is a test, case designed method that uses
the control structure of the procedural design to derive test cases. Using white-box testing
methods, the s/w engineer can derive test cases that guarantee that all independent paths within a
module have been exercised at least once. Exercise all logical decisions on their true and false
sides. Execute all loops at their boundaries and within their operational bounds. Exercise internal
data structures to ensure their validity.
Basis path testing is a white-box testing technique. The basis path method enables the test
case designer to derive a logical complexity measure of a procedural design and use this measure
as a guide for defining a basis set are guaranteed to exercise every statement in the program at
least one time during testing.
Black-box testing ,also called behavioral testing, focuses on the functional requirements of the
s/w. Black-box testing enables the software engineer to derive sets of input conditions that will
fully exercise all functional requirements of a program. It is a complementary approach that is
likely to uncover a different class of errors that white-box methods could not.
● Interface errors.
23
cases that reduce, by a count that is greater than one, the number of additional test cases that
must be designed to achieve reasonable testing. Test cases that tell us something about the
presence or absence of classes of errors, rather than an error associated only with the specified
test.
CHAPTER 6
RESULT
Save the file as GroupChat.java and compile it using javac and then run the program using
two command line arguments as specified. A multicast host is specified by a class D IP address
and by a standard UDP port number. Class D IP addresses are in the range 224.0.0.0 to
239.255.255.255, inclusive. The address 224.0.0.0 is reserved and should not be used.
Here is a sample output of the above program
We have used the multicast host IP address as 239.0.0.0 and the port number as 1234 (since the
port numbers 0 through 1023 are reserved). There are 3 members in the group: Ironman,
24
CaptainAmerica, and Groot. Start all three terminals first before sending the message, otherwise
messages which are sent before starting the terminal are lost (since there is no facility of buffer
incorporated to store the messages.) We need two threads in this application. One for accepting
the user input (using the java.util.Scanner class) and the other for reading the messages sent from
other clients. Hence I have separated the thread which does the reading work into
ReadThreadclass. For leaving the group, any of the user can type in Exit to terminate the session.
The above program is executed on a single machine. Socket programming is meant for
distributed programming. The same piece of code snippet when present on different machines
which have Java installed can satisfy that requirement. This is just the bare bones service logic.
The project would be even more fascinating if the front-end is developed. You can use Java’s
AWT (Abstract Window Toolkit) or its advanced counterpart, Java Swing to develop the front
end. Since this wouldn’t be part of Socket programming I’m leaving it untouched without getting
into the details.
Additional points:
You can incorporate network security feature by performing encryption before sending the
message over the network.
Primitive techniques such as Caesar cipher or advanced methods such as RSA can be used
to perform encryption-decryption. You can try using Java’s RMI (Remote Method
Invocation) to perform the same task.
Here, you can leverage the abstraction offered by Java to maximum extent. However, if
your primary objective is efficiency, then Socket programming is the best choice. Since it
doesn’t require any run time support, it is a bit faster compared to RMI.
CONCLUSION
Online chat rooms have some real benefits. The key to using chat rooms safely is to be
Internet-literate and capable of recognizing potentially dangerous situations. If you chat online
often, consider the points above for a safer and more beneficial online experience in the future.
And if you would prefer to be assured of getting help not only online but safely, BetterHelp
may be the better way to go.
The main objective of the project is to develop a Secure Chat Application. I had taken a wide
range of literature review in order to achieve all the tasks, where I came to know about some of
25
the products that are existing in the market. I made a detailed research in that path to cover the
loop holes that existing systems are facing and to eradicate them in our application.
FUTURE SCOPE
With the knowledge I have gained by developing this chat room, I am confident that
in the future I can make the application more effectively by adding this services.
BIBLIOGRAPHY
1. https://www.instructables.com/id/Creating-a-Chat-Server-Using-Java/
2. https://www.geeksforgeeks.org/a-group-chat-application-in-java/
3. https://1000projects.org/chat-server-project-report-in-java.html
4. https://1000projects.org/conclusion-and-future-scope-of-secure-chat-java-application.html
26