Static generation of UML sequence diagrams

  • PDF / 2,267,752 Bytes
  • 23 Pages / 595.276 x 790.866 pts Page_size
  • 45 Downloads / 251 Views

DOWNLOAD

REPORT


STTT Regular Paper

Static generation of UML sequence diagrams Chris Alvin1

· Brian Peterson2 · Supratik Mukhopadhyay2

© The Author(s) 2019

Abstract UML sequence diagrams are visual representations of object interactions in a system and can provide valuable information for program comprehension, debugging, maintenance, and software archeology. Sequence diagrams generated from legacy code are independent of existing documentation that may have eroded. We present a framework for static generation of UML sequence diagrams from object-oriented source code. The framework provides a query refinement system to guide the user to interesting interactions in the source code. Our technique involves constructing a hypergraph representation of the source code, traversing the hypergraph with respect to a user-defined query, and generating the corresponding set of sequence diagrams. We implemented our framework as a tool, StaticGen (supporting software: StaticGen), analyzing a corpus of 30 Android applications. We provide experimental results demonstrating the efficacy of our technique (originally appeared in the Proceedings of Fundamental Approaches to Software Engineering—20th International Conference, FASE 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, April 22–29, 2017). Keywords Static analysis · Scenario diagram generation · Sequence diagram · Code hypergraph · Query language · Vulnerability analysis

1 Introduction Legacy object-oriented code may be accompanied by highlevel documentation and/or descriptive comments in the source code, each of which may contain omissions or erroneous information. As documentation erodes, an engineer can trust only the source code. A necessary component of software archeology in object-oriented systems is the interactions among objects. A sequence diagram is a visual representation of those object interactions as well as their lifelines. Sequence diagrams generated from legacy code are independent of existing documentation. Dynamic techniques for

B

Chris Alvin [email protected]; [email protected] Supratik Mukhopadhyay [email protected]

generation of sequence diagrams from legacy code [5,22, 23,29,34] can synthesize a subset of all possible sequence diagrams based on runtime traces. The capability of purely dynamic reverse-engineering techniques to produce useful diagrams depends on the quality of the executions. In particular, one may need a large number of executions with sufficient diversity to cover the space of interactions. Existing static techniques [43] result in sequence diagrams that replicate the original legacy source code, including conditionals and loops, without providing further intuitive notions beyond the code itself. Hybrid techniques like [18,42] combine static and dynamic analysis. Information extracted from an accurate static analysis framework can guide the executions during the dynamic stage. We present a technique, depicted in Fig. 1, for static generation of UML sequence diagrams1 to