Wednesday, August 01, 2018

Enterprise Architect Sequence Miner

Christoph Hafner, Maximilian Medetz and Michael Wapp

Introduction

Nowadays, software or production systems create log traces in order to provide a way to track systems' execution. This allows system engineers to understand what the operating system was actually doing. One challenge, which arises with log traces, is that they are usually in a text-based representation (like TXT- or CSV-Files) and often very huge. Thus, it is hard to understand and analyze them and a better representation is sought.
To overcome this challenge one possible way is to use a graphical representation such as sequence diagrams described in the Unified Modelling Language (UML). These diagrams can be generated via a text-to-model transformation from the text-based log traces. The Figure 1 and 2 present the difference in simplicity on a short example of log traces. In Figure 1 the text-based representation is shown and in Figure 2 the same data is illustrated in a graphical representation. 

Figure 1: Log trace in text-based representation
Figure 2: Log trace in graphical representation (sequence diagram)
The sequence diagram in Figure 2 shows the interaction of objects (shown in the lifelines of the diagram) over a time frame. The interaction is presented by directed arrows that are either open, closed, solid or dashed. Open arrows with a solid line (like the second one from the top) depict that the message is an asynchronous message - which doesn’t require an answer from the receiver - while closed arrows with a solid line present synchronous messages - requiring an answer by the receiver. The answers are described by dashed lines with an open arrow at the end. If the message is sent to the same lifeline again a level is added to this lifeline showing that there are multiple responses required (this can be seen on the car lifeline in Figure 2).
The prototype implementation for transforming CSV log traces to sequence diagrams is based on an extension to the Enterprise Architect (EA) by Sparx Systems which is a tool for visual model designing used by businesses and software designers to support their model-driven development processes. EA provides an API which can be used for accessing and creating models from Add-Ins. This API was used by the prototype implementation to generate the result of the transformation in a UML sequence diagram.

EA Sequence Miner

The prototype named EA Sequence Miner is an EA Add-In written in C# using Visual Studio 2017. This post will give a short and general overview of the tool. For information about the code, a documentation on how to add the Add-In to the EA and to use the EA-API can be found in [1] (tutorial pages of Sparx Systems).
There are different requirements that should be fulfilled by the prototype implementation in order to improve related work like UML Miner Tool [2]. Some of the  main requirments are:

  • Support for asynchronous messages
  • Support for levels on a lifeline
  • Improved usability by providing error messages and information about the current state

The most important issue is the ability to transform a textual log-file to a model. In order to achieve this requirement, the text file should be in a CSV representation (separated by semicolons) and contain (at least) the following columns of data
  • CaseID: Identifying the corresponding case
  • Activity: Defining the corresponding activity which was logged by the soft- or hardware
  • Lifeline: Defining the lifeline (e.g. entity or object) to map the corresponding object in the diagram
  • MessageParameter: Additional parameters which are passed with the request
  • REQ/RES Attribute: Describing the request, response and async attributes needed for getting the direction of the message. These attributes further need to be mapped to the prototype for correct handling of the messages

The mapping between the imported CSV file and the prototype is done via a drop-down selection, showing all possible columns to match. Figure 3 shows the selection screen. In addition, a name for the diagram has to be set before proceeding to the next step.
Figure 3: EA Sequence Miner Selection Screen

The prototype code is structured into four parts, following the Model-View-Controller pattern.  First, the User Interface which is implemented as a Windows Form Application. Here the interaction with the user is handled. Second, the Event Log classes which represent the Log-Entries of the given CSV-File. Third, the Transformation part which is responsible for transforming the Log-Entries in an iterative manner into the model by writing it to the Enterprise Architect via the last package, the EA-Facade. This fourth package is following the Facade-Pattern and encapsulating the communication to the Enterprise Architect.

Conclusion and Further work

We showed a prototype implementation of an Enterprise Architect Add-In for transform text-based log traces to UML sequence diagrams. This approach solves the problem of understanding big log traces by converting them into human-friendly graphical representations.
The implemented prototype could further be enhanced by providing support for even longer log files with cycle detection and other separation techniques to keep the visual representation understandable. Further enhancements would be the support of different diagram formats and from user perspective more warnings, e.g., for incomplete log files.

References

[1] https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/index/index.html
 
[2] Davydova, K. V., and Shershakov, S. A. Mining hierarchical uml sequence diagrams from event logs of soa systems while balancing between abstracted and detailed models. 28, 3 (2016).

No comments:

Post a Comment