Analysis of Sequence Diagram Layout in Advanced UML Modelling Tools

– System modelling using Unified Modelling Language (UML) is the task that should be solved for software development. The more complex software becomes the higher requirements are stated to demonstrate the system to be developed, especially in its dynamic aspect, which in UML is offered by a sequence diagram. To solve this task, the main attention is devoted to the graphical presentation of the system, where diagram layout plays the central role in information perception. The UML sequence diagram due to its specific structure is selected for a deeper analysis on the elements’ layout. The authors research represents the abilities of modern UML modelling tools to offer automatic layout of the UML sequence diagram and analyse them according to criteria required for the diagram perception.


I. INTRODUCTION
System modelling is the interdisciplinary study of how to use models for system construction as well as for model conceptualisation.With system modelling it is easy for software developers to understand system behaviour, separated parts of the system and system structure.Also system modelling provides understanding of problems by separating problem domain to models, which are based on real-world ideas.This approach gives benefits in communication for people involved in the project or modelling enterprises or documentation and designing.With modelling it is possible to promote understanding of the requirements and get more fine design and more retainable systems.Modelling language has so-called graphical aspect that consists of perceptible location of model elements and intuitive language semantics.In this way, modellers have to cope with two main tasks while creating the diagram: representation of system functionality by diagram elements and design of an optimal positioning of diagram elements.
Graphical models provide a common base at different levels of system domain and are used at different stages of system abstraction for system developers.This responsibility has been given to such standardised modelling mean as Unified Modelling Language (UML) [UML] [1].Nowadays, UML is widely used to represent system specification at different levels of system abstraction.UML defines a notation for a set of diagrams used for modelling of different aspects of the system (i.e., static and dynamic ones).The central part of static modelling in UML is class diagram, which defines the general structure of the system and serves as a basis for the development of software architecture [1].From the layout point of view, the UML class diagram can be specified as a graph and the algorithm for graph layout can be applied to place elements of class diagram, taking into consideration specific of class relationships, especially aggregation and inheritance.
The central part of system dynamic modelling is the presentation of object interaction, where UML sequence diagram plays an important role and is used to present the system behaviour.As far as the structure of the UML sequence diagram is not pure graph, but a specific presentation of objects, their lifelines and messages sent between objects, the research on the automatic layout of the UML sequence diagram became more interesting and complicated.This paper is continuation of the research initiated by the authors in 2011 [3], [4], where authors focused on the layout abilities for the UML diagrams.Then authors worked on the development of their own algorithms for the layout of the UML class and sequence diagrams to be able to implement transformations of the twohemisphere model in BrainTool [5]- [8].And now the goal of the research is to analyse the abilities offered by UML modelling tools to layout the UML sequence diagram and to resolve the issue whether modern CASE tools satisfy all the criteria defined for the perception of the UML sequence diagram in its automatic layout.
The paper is structured as follows.Section 2 reviews related studies.Section 3 discusses the depicted review of UML tools for the specific layout of the sequence diagram and provides a basis for selection of UML tools for further analysis.Section 4 covers criteria for the "good" layout of the sequence diagram.Section 5 depicts a deep analysis of how selected tools follow the criteria and discusses the way methods could be used to improve the layout of the sequence diagram.Conclusions and future research analysis are presented in Section 6.

II. RELATED STUDIES
Nowadays there is a considerable set of UML tool vendors that claim that their tools support the possibility to provide the best approach for UML modelling [9].However, diagram layout is not an easily executable task.Manual layout of diagrams is time-consuming, especially layout of large diagrams.
One of the questions that should be raised is how good tools support the possibility to manage "good" diagram layout.
The focus of the paper is turned to the ability of UML editors to offer the layout of the UML sequence diagram with the correspondence to the criteria stated for the diagram layout.
Similar research was conducted by Wan Husin in [10], where the author emphasised high importance of evaluation.The author proposed using the most popular tools for the investigation and classifying tools by functionality of their work, e.g., how it is more comfortable to end user to work with the tool.However, the research did not touch the layout criteria in detail, in other words, to evaluate user comfort by a set of different criteria, where the layout is one of them.
In research [11], the author proposed criteria to evaluate tools and suggested the rating system for tools selected.The research demonstrated a large variety of the case sets for evaluating the tools.But all the criteria again went through functionality of the tools and the author did not consider the criteria of the layout, but just stated the importance of performing a list of criteria needed for such analysis.
Based on this and other studies, we can conclude that evaluation of the layout is hard to make in the meaning of the proposed algorithm of layout used by tool.In [12], the author stated that most tools used graph layout for solving the layout problem of the UML and such approach was easy to be evaluated.The graph layout was also studied by [13]- [15].But the graph layout algorithms did not match all the criteria for the layout of the UML sequence diagram, due to its specific presentation.
Also the author stated that the most common approach in the layout algorithms was made for UML layout of the class diagrams and other not complicated diagrams, even a lot of libraries build for this purpose.However, more complicated diagrams, such as sequence or activity diagrams, have drawbacks in layout because of complexity and difficulties in adopting them to standard graph layout algorithms.The author also stated that this evaluation was hard to perform because of the lack of a certain algorithm for such layout.Also this evidence was stated by [16].
The author also stated that for more easy implementation vendors of the tools tried to separate complex diagrams to layers, e.g., object layout was processed by one algorithm and labels of these objects and message connections for these objects were processed by another; however, this approach led to complex decisions and difficulties in evaluation of layout criteria for the diagram at all.
In the previous research, the authors provided evidence that the problem of algorithm for the automatic UML diagram layout still exists, and it was widely discussed with regard to sequence diagrams.The authors provided information that the main problem was that the algorithms for the automated layout playing the main role in the drawing diagrams had not been well studied.The authors mentioned several algorithms that allowed us to understand the roots of the automated layout and gave us a possibility to analyse the concept of the automated layout for the UML sequence diagram.
The understanding of how each algorithm follows the criteria for diagram layout will give better understanding, if it is easy for tool vendors to provide a possibility of automated layout.
The author of [17] gave a clear idea that there was no one straight way of accomplishing automated layout and several technics should be used.Also the author studied a topology shape approach.The core concept of this approach was based on enhancement of the original graph.As a result of this approach, orthogonal graphs were taken.In this approach, crossings in the graph were taken into consideration as the main aspect.Also the approach lied in the comparison of shapes of the elements of the graph and making decision ether deformation of the graph should be performed or changing the length of the edges without touching angles of the elements of graph.
Another approach mentioned in the previous study was hierarchical graph drawing.The idea of this approach was to represent the graph or the diagram in the view of layers with the edges generally directed downwards [17], [18].
Divide and conquer approach relies on the dividing of graph into subgraphs or decomposing the graph and as the next step positioning the subgraphs according to their types, e.g.linear, cyclic [17].
According to the force-directed approach, edges should be of more or less equal length and there are as few crossing edges as possible [17].
Multi-scale approach is the further development of the forcedirected approach, also mentioned in the previous study, and it is based on the series of abstractions of the graph, performing relocations of vertically yield vertices, correcting global directions and performing fine-scale of all directions in the graph.
All the discussed studies do not provide an in-depth analysis and answer the question about how UML editors conform to the layout criteria stated for the UML sequence diagram.Therefore, the issue is still topical and studied by the authors of this paper.

III. SPECIFIC LAYOUT OF THE UML SEQUENCE DIAGRAM
With UML sequence diagrams it is easily possible to describe interactions between system components and actors of its environment.It presents a sequence of messages that may occur during system start-up and monitors the messages exchanged during this run [19].
UML sequence diagram is a popular notation for the definition of scenarios of operations as its clear graphical layout processing gives instant intuitive understanding of system behaviour [19].The UML sequence diagram is declared as one of the equivocal UML diagrams, with an implicit and unofficial semantics that designers can give to basic sequence diagram as a result of this conflict [19].
The UML sequence diagram shows the objects, their lifelines, and messages that are sent by objects-senders and received by objects-receivers.Sequence diagram is used to show the dynamic aspect of the system that in the objectoriented approach is indicated as message transfer between objects.The dynamics flow is defined by ordering of the message sending and receiving actions.It gives the ground for defining operations executed by objects to be grouped into classes, as well as showing and proving the dynamic aspect of class state transition.
The complexity of the structure of the sequence diagram raises the necessity of well-structured layout of this diagram.The right layout gives a possibility of easy interpretation and further implementation of this diagram.
Nowadays, UML diagram design is represented by the set of tools that allow formulating and structuring the layout of the diagrams.Such a variety of the tools could be explained by the interest of architects of using a uniform tool that will allow making diagrams more readable, which could be made by reaching high quality of the layout of the diagram [1].
Due to such a variety and the complexity of the UML sequence diagram, the first check point authors should investigate is the ability of the tool to perform diagram layout and to check either the tool provides an automatic layout or not (just, if any layout is built-in).The second point is if the tool can import model developed by another tool with the ability to keep the original layout.The third point is to check the correspondence of the layout algorithm offered according to the layout criteria stated for the UML sequence diagram.This step gives understanding if tools manage to provide good auto layout algorithms.Better auto layout algorithm can lead to reduction of the time consuming work on creation diagram and modification it to appropriate form that gives right position for the elements according to the layout criteria.
Table I shows the result of the research, how the tools are able to accomplish work on auto layout.In other words, Table I provides an analysis on the first and second check points, thus giving an ability to select the most appropriate tools for their analysis according to the third check point, i.e., according to the layout criteria, which are explained in detail in the next section of the paper.
The tools listed in Table I are selected as tools working with the UML sequence diagram and giving a possibility to perform automated layout.Also the argumentation to select tools is the tool presented as a standalone solution that does not require any additional software for the work.Moreover, the popularity of these tools is also taken into consideration based on the research results proven by [12], [16].Table I demonstrates several tools that provide automatic diagram layout; moreover, the research has shown that not a big number of tools give this functionality.Some tools have a possibility to perform automatic layout, but do not have a possibility to perform the layout of the sequence diagram.The evaluation "YES/NO" means that specific characteristic is/is not supported.From the research results listed in Table I, it can be seen that the variety of the UML tools does not completely propose auto layout and only few of the tools propose such functionality.Also we can see that tools give a possibility to make export of the result of the work, but it is impossible to import result of the work to another tool to provide better layout to the end user with the help of more advanced tools.In other words, it is impossible to use results of the work with another vendor.Another criterion that should be mentioned is that a huge part of the responsibility on diagram layout is given to the user that makes developing of the diagram complex and time consuming, also it could lead to a problem when the diagram could be designed in the hard-toread and maintain format.
Still, the following tools are most appropriate for further analysis: Visual Paradigm, Papyrus, Rational software modeller, Sparx Enterprise architect.To analyse these tools, according to the third check point, the criteria for the UML sequence diagram are defined in the next section.As for sequence diagram specific criteria have to be generated in order to represent all interconnections between objects in a right way.Diagram is a convenient way of presenting information and much more clear than text information.While the scheme may be used to represent complex and difficult problems, they must be semantically and syntactically correct and well-layouted to give the desired result.
A good diagram needs to satisfy different criteria, e.g.aesthetic and layout criteria.For the representation of the diagrams the main role is readability of this diagram.Speaking about diagram layout criteria, we easily can say that diagrams have some common criteria that give the set of rules for their representation.
In previous research [20], the authors take a look at the research of the layout criteria.The authors mention that general diagram criteria and specific UML diagram layout criteria have also been studied by [5], [9], [21], [22] and others.All diagrams should conform to general graph layout criteria.
General layout criteria can clearly be formulated from the theory of perception [23].In the theory of perception there are many criteria for unifying perception, but not all of them can be applied to all types of diagrams.Sequence diagram belongs to specific UML diagrams and this diagram has to cope with additional criteria, e.g., slidability.Organisation of the diagram elements has been studied in [5] and according to this study there are six perceptual principles, when the elements are considered to be a group.These principles are acquired from Gestalt theory [24] that formulates the set of laws.
Laws give restriction to the diagrams by simplifying themthe simpler the diagram, not containing too much information, the easier it is to understand.Elements of similar shape or colour often can be perceived as a group.Elements can be perceived more easily according to a smooth path.Those elements, which are connected with curved complex lines, are more difficult to perceive together.Grouping elements give a possibility to take these elements as a group, if elements are connected with a line or in other way physically.Elements that look similar are perceived together.
There are three more principles related to perceptual element segregation that explains that diagram's symmetric parts are perceived as separated.Horizontally or vertically oriented elements are more likely to be perceived as separated figures than shapes in an angle.One more principle of grouping the elements is that elements with contour are seen separately and all elements in this contour are perceived as a group.
Speaking about visual presentation it is easy to conclude that the UML sequence diagram is specific.All the objects are positioned horizontally at the top of the diagram and the life lines are drawn vertically from the top to the bottom of the diagram.This specific of the diagram shows that the criteria for the UML sequence diagram should be selected from existing or even modified ones, so they could be applicable to the sequence diagram, e.g., one specific criterion for sequence diagram called "Correct sequence of messages", which is the core concept of this diagram.The authors of [21] and [5] have identified the criteria specific for sequence diagrams.Table II shows the list of these criteria.Criteria are marked with SD identifier.
The list of the criteria combined from the previous research made by the authors of the paper are divided into three groups for better manipulating, and perhaps for further implementation of a new layout algorithm: subsets if there is one such message eliminating which, two unconnected sequence diagrams are formed. SD11 Employ symmetry.[5] and [21] believe that symmetry should also be considered in sequence diagrams.For this criterion there is no special definition, but this criterion is one of the most important aesthetic criteria.For implementation of this criterion a decision was made to look closer on the criteria formulated from graph drawing theory and related to common UML rules.
The final list of criteria includes twelve criteria.All criteria are collected for the evaluation of layout possibilities of the set of tools selected in Section 3, or in another words how each tool supports them.

V. ANALYSIS OF THE CRITERIA SUPPORT BY UML MODELLING TOOLS FOR THE LAYOUT OF THE UML SEQUENCE DIAGRAM
The analysis of the tools made in Section 3 gives the evidence that automated layout is not so easy element of the tool to be implemented as not all tools accomplish to include it to their products.
To evaluate quality of the implemented automated layout it would be good to see if the implemented feature follows all the criteria described in Section 4.
In turn, to evaluate tools selected in Section 3 according to the criteria defined in Section 4, Table II depicts the result of the research on how tools follow the criteria for UML sequence diagram while performing automatic layout.Evaluation of the criterion as "YES" shows the possibility of the tool to follow the criterion and "NO" opposite.Evaluation of the criterion as "Partial" means that he tool could not follow the criterion in full.From these results it is possible to conclude that no one tool completes the task of the layout of the UML sequence diagram.As seen from Table II, most part of the criteria is not supported by the tools at all.
For more precise understanding of the problem the authors made a decision to make classification of existing algorithms for layout according to the criteria clarified in Section 4. The algorithms are not defined to accomplish the layout of the sequence diagram, but can be considered the potential solutions for constructing the algorithms for automated layout of the UML sequence diagram.The results of this investigation are shown in Table III.
BrainTool as a tool for generation of the UML diagrams, including the UML sequence diagram, is analysed among the algorithms according to the criteria, not among UML editors, because this tool is not the CASE tool for UML design, but the tool that creates sequence diagram.Therefore, the algorithm of the diagram layout is already built-in solution invented by the authors in their previous research.Thus, BrainTool is positioned not as a tool, but rather as an algorithm for the diagram layout.The results of the algorithm evaluation according the layout criteria give the possibility to say that not all algorithms can be taken as a full implementation of the universal algorithm for the automated layout of the sequence diagram.Also it is seen that algorithm made by the authors support the most set of the criteria defined while following all criteria for the right layout of the diagram.However, there are still criteria that are not followed by even this algorithm.

VI. CONCLUSION AND FUTURE RESEARCH
Nowadays, UML is widely used to represent system specification at different levels of system abstraction.A big set of CASE tools gives the possibility to accomplish modelling of the diagrams with their means; also, vendors show a variety of functions to the end user.Two of the most important functions of the CASE tools are: to accomplish automated layout; to perform import and export possibilities.Modelling diagrams is time-consumptive work as stated in the paper and it is a very complex task to the user to follow all the criteria of the right layout of the diagram.As for import and export possibilities it could be very comfortable to have a possibility of moving all work to another software presented by another vendor as not all companies use the same software.
UML sequence diagram is a popular notation for the definition of scenarios of operations as its clear graphical layout processing gives instant intuitive understanding of system behaviour.
The research object of this paper is the quality of the layout of the UML sequence diagram in modern CASE tools also as possibility of automated layout of the UML sequence diagram.
The research was divided into three main steps.The first step was to collect a set of tools and define if they propose to the end user working with sequence diagram and accomplishing work with automated layout.The paper describes the set of chosen tool and shows that not all tools manage to perform automated layout for the UML sequence diagram.
The second step was defining if tools managed to perform import and export possibilities.Paper shows evidence that most part of tools managed to work with export and import possibilities but for most of the tools migration of the performed work from one tool to another did not give successful result and this possibility was designed only for internal work.
The third step was to create and group criteria of "good" layout of the sequence diagram.During the research, twelve criteria of the layout of the sequence diagram were summarised.Also within the scope of research evaluation of layout was performed evaluation of the layout algorithms according to the criteria, was define how they could follow the criteria described in the paper.The investigation showed that all tools but one did not follow the criteria of the layout of the sequence diagram.The only tool that followed nine criteria of twelve was BrainTool designed not for modelling of the sequence diagram but for generating it.
These results of the research give background and show high importance of further research.Further research has to raise questions on developing algorithm of automatic layout of the sequence diagram that follows all criteria for better layout of the sequence diagram.
Also there is an issue on a possibility to provide import/export possibilities of tools.The research should provide better knowledge on how XMI standard is followed by tools while accomplishing import and export possibilities.The research should also focus on finding possible solutions for developing a tool as a middle layer between CASE tools to accomplish migration of the work from one tool to another.

Figure 1
Figure 1 depicts the examples of good and bad layout of the diagram and demonstrates the effects of bad layout of the diagram.The diagram on the left side of Fig. 1 demonstrates unreadable message flow; on the other hand, the right one represents an easy-to-read flow of the messages, structured using layout criteria.As for sequence diagram specific criteria have to be generated in order to represent all interconnections between objects in a right way.Diagram is a convenient way of presenting information and much more clear than text information.While the scheme may be used to represent complex and difficult problems, they must be semantically and syntactically correct and well-layouted to give the desired result.A good diagram needs to satisfy different criteria, e.g.aesthetic and layout criteria.For the representation of the diagrams the main role is readability of this diagram.

1 ) 2 )
Vertical alignmentdescribes how to better situate vertically positioned elements:  SD0 Precise sequence of messages.The Requirement of notational convention of the UML is to display messages in the order they are being sent. SD1 Avoid object and lifeline overlapping.It makes difficult or sometimes impossible to read diagram when objects or lifelines are overlapping. SD2 Minimize crossings.Understanding of the diagram is more complex with crossings of message arrows.This criterion says that message arrows should not cross at all. SD3 Improve slidability.Slidability is an aesthetic criterion for better transparency, particularly it is important in bigger sequence diagrams, where the whole diagram fails to fit in one screen.Slidability means that a fixed size window can be placed on the diagram and slid over it in such a way that all senders and receivers of messages, which are in this window, fit in too.Horizontal alignment -describes how to better situate horizontally positioned elements:  SD4 Message arrow length minimisation.To minimize message arrow length for making the diagram more comprehensible and the region smaller. SD5 Reduction of number of long message arrows.It is better to limit message arrow length because of difficulty to follow long message arrows. SD6 Minimize longest message arrow length.The elements of the diagram should be placed closer to make message arrows shorter as possible. SD7 Uniform message arrow length.To make diagram more understandable it is better to perform message arrows with similar length.Similar arrow length is also needed to fulfil the slidability criteria.3) Criteria applied for layout of the whole diagramdescribe positioning elements in the appropriate way for better reading possibility and easier to maintain for the end user:  SD8 Elements need to be arranged orthogonally.Sequence diagram is an example of orthogonal diagrammessage arrows are situated horizontally (typically) and lifelinesvertically.  SD9 Diagram flow.It is very important to layout elements by creating obvious flow.Diagram should have start and end that gives a possibility to follow the elements and read the diagram easier.Usually the first message is located at the top left corner of sequence diagram. SD10 Subset separation.Sequence diagram has

ACKNOWLEDGMENT
The research presented in the paper is supported by Accenture Latvian Branch, project No. L7950 "Development of Model Transformation Tool Prototype", and by Latvian Council of Science, No. 342/2012 "Development of Models and Methods Based on Distributed Artificial Intelligence, Knowledge Management and Advanced Web Technologies".

TABLE I RESULT
OF EVALUATING TOOLS FOR UML LAYOUT SEQUENCE DIAGRAM

TABLE III ALGORITHM
CRITERIA EVALUATION FOR LAYOUT OF THE UML SEQUENCE DIAGRAMAbbreviations used in the table are the following: TSMA -Topology-Shape-Metrics Approach, HA -Hierarchical Approach, VA -Visualisation Approach, DCA -Divide and Conquer Approach, FDA -Force-Directed Approach, MSA -Multi-Scale Algorithms, GA -Genetic Algorithms, BT -BrainTool, adjadjustable.