Section 5 compares our work with the related work. Section 4 discusses the experimental results and analyses our work.
In Section 3, we discuss our proposed approach for code generation from SDs with a case study. Few basic concepts related to our proposed methodology is given in Section 2. The rest of the paper is organised as follows. Our proposed approach can be extended to other behavioural UML diagrams such as interaction-overview diagrams, communication diagrams, activity diagrams and so on only with minor modifications. We observe that approximately 48% lines of code (LOC) within controller class methods can be generated with our approach.
We have tested our approach with a number of designs and the results substantiate the efficacy of the approach to synthesise the code for controller class methods.
For code generation, we first identify the subgraphs of our graph model where each subgraph contains the model elements in the same method scope of a class method and then apply the mapping rules to the model elements contained in the subgraphs to generate the code of different class methods. We propose a set of mapping rules to map the model elements of our graph model into code artefacts. The graph model subsumes control flow graph and additionally contains method scope information of interactions. We first construct a graph model from XMI representation of the sequence diagram. In this work, we propose an approach to generate code from UML 2.x SDs designed for use cases.
One potential use of sequence diagram (SD) is automated code generation with which we can avoid the human errors during manual translation of the SDs to equivalent code, improve communication between design team and coding team, and reduce coding effort.
In a model-driven software development environment, there is a growing applications of UML to design software architecture, code implementation, testing, maintainence and so on.Įven though UML is being widely used, its full potential in helping software development activities is yet to be exploited. UML being a visual language supports modelling different views of software and has found wide acceptance among software practitioners. To facilitate the use of standardised notations for object-oriented analysis and design, Object Management Group (OMG) introduced unified modelling language (UML). To cope with this situation, many software developers have adopted the object-oriented analysis and design paradigm. Further, these programs need to be maintained frequently. Modern day programs are often large and complex. The proposed approach can be easily extended to other behavioural UML models such as interaction-overview diagrams, communication diagrams and activity diagrams. The authors observe that approximately 48% of the total lines of code within controller class methods can be generated with the proposed approach. The proposed approach has been tested using a number of real-life application systems and the results substantiate the efficacy of the approach to synthesise the code for controller classes. These information are then used to generate code. The SIG encapsulates information related to messages, control flow and method scope of interactions. From the XML metadata interchange (XMI) representation of an SD of a use case, the authors construct a graph model called sequence integration graph (SIG). This work proposes an approach to automatic generation of code from UML 2.x SDs of use cases. However, the code generation from UML diagrams such as statechart, activity, collaboration and sequence diagrams (SDs) are not supported by most UML tools and also have scarcely been reported in the literatures. In a model-driven software development environment, the existing UML tools mainly support automatic generation of structural code from UML class diagrams. Unified modelling language (UML) is a visual modelling language, which has gained popularity among software practitioners.