IntroductionNowadays, 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 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 MinerThe 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  (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 . 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 workWe 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.
 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).