background image
MANAGEMENT AND TECHNOLOGY SCHOOL OF THE POLYTECHNIC INSTITUTE OF BEJA (PORTUGAL), 31 OCTOBER OF 2007
1
Dynamic Generation of Sequence Diagrams
from Java
TM
Programs
Nuno Fortes
Abstract--This project contributes to the area of tools for generating sequence diagrams in an automatic way. To
increase the flexibility and interaction with other applications, the developed application is able to export the generated
diagrams to multiple formats allowing its visualization by diverse tools.
Index Terms--Diagram, Generator, Java, Sequence.
3
1
I
NTRODUCTION
W
E
start by presenting the motivation and
objectives for the development of this
work.
1.1
Motivation
The debugging (monitoring and analyzing) of
Java
TM
[18] applications can be very boring
and annoying, specially when we do not have
easy access to the code that is being imple-
mented in the program. The problem starts to
get more complicated when an application is in
a remote environment and does not produce
any output in the console or in a Log file
(registration of transactions), mainly in the case
of computer software of considerable size. Due
to the increasing size and complexity of soft-
ware applications the understanding of their
structure and behaviour has become more and
more important. Proper specification and de-
sign activities are known to be indispensable
for producing understandable software. The re-
verse engineering
of dynamic behaviour of a
program is still a topic of on-going research.
However, there are allready several types of
diagrams which allow us to visualize the se-
quence of communication between objects of a
Nuno M. Fortes is a Student of Computer Engineering at the
Management and Technology School (ESTIG) of the Polytechnic
Institute of Beja (PORTUGAL) (e-mail: nunofort@ gmail.com).
Manuscript received October 31, 2007.
program, also called Message Sequence Charts
[5]. In UML2 [13] specification there is a type
of diagram for this purpose which is called
Sequence Diagram
. It allows to represent in
a graphic way, the program behaviour and
mainly the sequence of messages between ob-
jects (call and return method events). This type
of diagrams can be very useful in analysis of
object-oriented computer applications. Because
allow us to know many informations about
what the application does throughout its im-
plementation (In the course of its execution).
They therefore are called behaviour diagrams.
One of the issues to be considered when trying
to develop a tool for the generation of this type
of diagram is, if there is some kind of support
for the language through an API (Application
Program Interface
), to be able to automatically
extract all the information required for the
implementation of a program, in order to build
the Sequence Diagram. Java
TM
[18], is an object-
oriented programming language developed by
Sun Microsystems [11] in 1991, with the main
characteristic of creating applications which
can run in any platform or Operating Sys-
tem, by a Java
TM
Virtual Machine. The Java
TM
applications usually are compiled to bytecode,
which is a binary language the virtual machine
will understand, thus to interpret or compile
to native code, in order to run nativily by the
operating system. So, for the purpose of cre-
ating Sequence Diagrams, the Java
TM
language
technology is very useful, because it enables
to obtain such information as the sequence of