UML Class Diagram from Object Oriented Program for Reverse Engineering Purpose

Similar documents
Spemmet - A Tool for Modeling Software Processes with SPEM

HOW AND WHEN TO FLATTEN JAVA CLASSES?

Software Service Engineering

A Technique for Design Patterns Detection

Software Architecture Recovery based on Dynamic Analysis

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

Software Engineering Lab Manual

Comparative analyses for the performance of Rational Rose and Visio in software engineering teaching

Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML

International Journal for Management Science And Technology (IJMST)

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Semantic Web Domain Knowledge Representation Using Software Engineering Modeling Technique

JOURNAL OF OBJECT TECHNOLOGY

JOURNAL OF OBJECT TECHNOLOGY Online at Published by ETH Zurich, Chair of Software Engineering. JOT, 2002

Appendix A - Glossary(of OO software term s)

CS560: Formal Modelling and Implementation of Systems (Term II) Lecture: CASE A. O Riordan, 2009.

Practical Model-Driven Development with the IBM Software Development Platform

CTI Short Learning Programme in Internet Development Specialist

A Novel Approach to Automated Design Pattern Detection

A Framework for Converting Classical Design to Reusable Design

An Approach to Software Component Specification

CTI Higher Certificate in Information Systems (Internet Development)

IOSR Journal of Computer Engineering (IOSRJCE) ISSN: Volume 3, Issue 3 (July-Aug. 2012), PP

Scenario-based Synthesis of Annotated Class Diagrams in UML

Sequence Diagram Generation with Model Transformation Technology

SCENTOR: Scenario-Based Testing of E-Business Applications

UML big picture. Perdita Stevens. School of Informatics University of Edinburgh

CISC 322 Software Architecture

QoS-aware model-driven SOA using SoaML

INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & TECHNOLOGY (IJCET) NEED FOR DESIGN PATTERNS AND FRAMEWORKS FOR QUALITY SOFTWARE DEVELOPMENT

Cover Page. The handle holds various files of this Leiden University dissertation.

1. INTRODUCTION. IJCTA, 9(23), 2016, pp International Science Press. Parveen Kumar* and Pradeep Tomar**

A Design Rationale Representation for Model-Based Designs in Software Engineering

Designing a System Engineering Environment in a structured way

Object Orientated Analysis and Design. Benjamin Kenwright

A Study of Bad Smells in Code

MSc programme (induction week) Department of Informatics INTRODUCTION TO UML

DETERMINE COHESION AND COUPLING FOR CLASS DIAGRAM THROUGH SLICING TECHNIQUES

Computation Independent Model (CIM): Platform Independent Model (PIM): Platform Specific Model (PSM): Implementation Specific Model (ISM):

Enterprise Architect. User Guide Series. Portals. Author: Sparx Systems. Date: 19/03/2018. Version: 1.0 CREATED WITH

Software Development Methodologies

The PEPA Eclipse Plug-in

ENTITIES IN THE OBJECT-ORIENTED DESIGN PROCESS MODEL

Developing Software Applications Using Middleware Infrastructure: Role Based and Coordination Component Framework Approach

Analysis of operations and parameters involved in interface for CBSE

Design and Evolution of an Agent-Based CASE System for OOAD

License.

Evaluating OO-CASE tools: OO research meets practice

Automated Approach for Anti-Pattern Detection

Specification Manager

Coral: A Metamodel Kernel for Transformation Engines

Performance Testing: A Comparative Study and Analysis of Web Service Testing Tools

Design Patterns for Description-Driven Systems

Getting a Quick Start with RUP

An UML-XML-RDB Model Mapping Solution for Facilitating Information Standardization and Sharing in Construction Industry

UML diagrams. Software artifacts include: SRS, SDS, test cases, source code, technical/user manual, software architecture, etc.

Remote Health Service System based on Struts2 and Hibernate

Software Engineering with Objects and Components Open Issues and Course Summary

UML-Based Conceptual Modeling of Pattern-Bases

RepCom: A Customisable Report Generator Component System using XML-driven, Component-based Development Approach

Fundamentals of Design, Implementation, and Management Tenth Edition

Specification and Automated Detection of Code Smells using OCL

Transformation of the system sequence diagram to an interface navigation diagram

Enterprise Architect. User Guide Series. Portals

Analyzing the Product Line Adequacy of Existing Components

JOURNAL OF OBJECT TECHNOLOGY

White Paper. Rose PowerBuilder Link

Fault Identification from Web Log Files by Pattern Discovery

Enterprise Architect Training Courses

Concurrency Control with Java and Relational Databases

Credit where Credit is Due. Goals for this Lecture. Introduction to Design

Ghassan Samara Internet Technology Department Zarqa University, Jordan.

Using Design Patterns in Education and Tutoring for the Software Systems Projects in Economic

Programming Languages and Program Development Life Cycle Fall Introduction to Information and Communication Technologies CSD 102

JOURNAL OF OBJECT TECHNOLOGY

Impact of Dependency Graph in Software Testing

CHAPTER 5 CO:-Sketch component diagram using basic notations 5.1 Component Diagram (4M) Sample Component Diagram 5.2 Deployment Diagram (8M)

Detecting Structural Refactoring Conflicts Using Critical Pair Analysis

Chapter 3. Interactive Software Development Assistants Logic-based Software Representation. Logic-based Software Analysis

X-Analysis Professional

Quantifying and Assessing the Merge of Cloned Web-Based System: An Exploratory Study

IMPACT OF DEPENDENCY GRAPH IN SOFTWARE TESTING

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.

UML UNIFIED MODELLING LANGUAGE EXEMPLIFIED ON BLACKJACK. Object Oriented Programming (Samy Zafrany)

The Eclipse Modeling Framework and MDA Status and Opportunities

Unified Modeling Language (UML)

Test Case Generation Based on Sequence Diagrams

UML Primer. -Elango Sundaram

A Taxonomy and a First Study of Design Pattern Defects

IRQA General Information:

Automation of Semantic Web based Digital Library using Unified Modeling Language Minal Bhise 1 1

PLUGIN ECLIPSE UML REVERSE ENGINEERING E-BOOK

Systems Analysis and Design in a Changing World, Fourth Edition

CSCU9T4: Managing Information

Inventions on LDAP data storage- A TRIZ based analysis

OMG Specifications for Enterprise Interoperability

Provenance in Software Engineering - A Configuration Management View

2nd Belgian-Dutch workshop on Software Evolution

Collaborative Ontology Construction using Template-based Wiki for Semantic Web Applications

A Mechanism for Runtime Evolution of Objects

Transcription:

UML Class Diagram from Object Oriented Program for Reverse Engineering Purpose Guru Prasad Bhandari 1 and Ratneshwer 2 1 DST-CIMS, Banaras Hindu University, Uttar Pradesh-221005, India 2 Department of Computer Science (MMV), Banaras Hindu University, Uttar Pradesh-221005, India E-mail: 1 guru.bhandari@gmail.com, 2 ratnesh@bhu.ac.in Abstract Numerous studies have been conducted in the field of reverse engineering with concerning UML (Unified Modelling Language) diagram generation from object-oriented source code to analyse the already existing system software. A reverse engineering approach has been used in our tool to get the UML class diagram from object oriented source code. We have developed a tool named classuml using C#.net, pattern matching of regular expressions (regex) and graphviz tool for the complete conversion from source code to UML class diagram. As our experiment, our tool successfully generated class diagram of 5 KLOC (Thousand Lines of Code) program. Keywords- Class Diagram; Dependency Analysis; Object Oriented Program; Pattern Matching; Reverse Engineering I. INTRODUCTION (HEADING 1) Jacobson stated that Reverse engineering [1] is a method that transforms source code into a mode. All reverse engineering environments need tools for extracting the information to be analysed static information includes software artefacts and their relationship. Such artefacts could be classes, interfaces, methods and variables. Relationship might include extension relationships between classes or interfaces, calls between methods, and so on. Maintainers spend more than 50% of their time and 50% maintenance cost understanding the programs before committing changes [2]. Instead of reimplementing business critical applications within time and resource constraints, the best option is software reengineering within effective design and architecture which can make better their system for reusability and maintainability [3]. Many researchers have investigated the reverse-engineering of UML static models, such as class diagrams. The UML has rapidly become the language of choice for developers who wish to visualize and model the system under development [4]. They are many diagrams in UML to analyse the system classified as dynamic diagrams and static diagrams. Sequence diagram shows the dynamic behaviour of the system where class diagram shows the static nature of the system. Class diagrams to visualize the design of the software and sequence diagrams and state chart diagrams to visualize the behaviour of the objects in the system[4]. An important problem facing developers who create and maintain large software system is that of simply capturing the overall structure of the system. Strategies for attacking these problems are fairly straightforward for conventional languages, like C for example: classes and methods are block-structure. There are some unique features that are in object-oriented programming are Inheritance, dynamic binding and code comprehension which are not in procedural programming language. So, the tool must focus these features properly. Even though, the number of reverse engineering tools have been developed, those tools that can be applied to object oriented program, do not provide the full documentation required by developers. Thus, we propose a tool classuml that automatically provides the necessary design documentation based on UML class diagram from Object Oriented source code to reverse engineer. A reverse engineering approach has been implemented in our tool to get the UML (Unified Modelling Language class diagram from Object Oriented source code. classuml has been developed for the complete conversion from source code to UML class diagram, in C# programming language using pattern matching on the basis of regular expression and graphviz tool is used to display the class diagram as output, as our experiment conducted, our tool successfully generated class diagram of C#.Net program of 5 KLOC. So, we ensure that it is also able to handle some big enterprise level object oriented program. System constructed without using modelling and visualization artefacts, due to constraints imposed by deadlines or a shortage of manpower, such system might gain the advantage from the type of tool to analyse the object-oriented software system into class diagram by reverse engineering approach. Among the various phases of software development, maintenance is the most expensive and tedious task along the while life cycle of software development thus our tool could support the maintainer to visualize the system and reduces the cost of maintenance. Difficulties are mainly occurred when the understanding of the extent system is required and the estimation of the impact change is analysed. The developers of the OOP system can use our tool to illustrate software design concepts to their team members. Our tool can help developers to perform code refactoring activities by evaluating or analysing the system code in UML class diagram. Our tool helps to reduce time and cost of training by making the system familiar to the software engineer. 147

International Conference on Innovative Entrepreneurship and Startup The rest of the paper is organized as follows: Section 2 deals with the works already done by the researchers. UML class diagram has been discussed in section 3. Section 4 focuses on the overview of class diagram from OOP (Object Oriented Programming) code with considering the steps of our proposed tool. Section 5 presents the brief description of our proposed tool classuml by showing interfaces and finally section 6 concludes our paper with summary of our current effort and future works relating to this paper. II. RELATED WORKS Selected works are mentioned in this section which is relevant to our tool. Different researchers have proposed different tools, algorithms, theoretical models, empirical analysis and so on. Here we have listed some of them as follows. Matzko et al have presented a tool for class diagram from the C++ source code representation of the software in their paper [4]. They have tried to fulfil the UML standard definition of a class diagram through their tool. Gueheneue and Ziadi have stated the model approach [2] to UML V2.0 dynamic models reverse engineering and sketch some use of these models. They have also discussed on some issues related to the models, reverse-engineering and their use. Lejter et al have developed a system for working with C++ programs. This system comprises a relational database system for information about programs, and an interactive database interface integrated with a text editor. They have also described the system architecture detail the database relation [5]. Gueheneuc proposed a reverse-engineering tool suite, PTIDEJ (Pattern Trace Identification, Detection and Enhancement in Java), in his paper [6] to build precise class diagrams from Java programs, with respect to their implementation and behaviour. In this paper static and dynamic model of Java programs and algorithms to analyse these models and to build class diagrams have been presented. They have also shown that class diagrams obtained semi-automatically are similar to those obtained manually and more precise than those provided usually. Sheldon et al have presented an analysis of class diagrams used in the design of static analysis using UML for specifying both the static and dynamic characteristics of object oriented systems [7]. They have also measured the level of understandability of the system to evaluate the structural complexity metric by measuring the time needed to reverse engineer the source code for a given class diagram including the number of errors produced while creating the diagram as one indicator of maintainability. Nanthaamornphony et al have proposed a software tool to extract UML class diagram from Fortran code [8]. The extracted diagrams enhance software maintenance and evolution. They have also carried out experiments with the aim to evaluate the proposed tool show its accuracy and a few of the limitations. database and the response of each call. AgileJstructureViews [10] is a plugin for Eclipse which generates UML class diagrams reverse engineered from Java source code. This tool ensures of filters for common design patterns, framework and conventions. User can create his own filters to suit his project s patterns, libraries and conventions. It exports SVG (Super Video Graphics), PNG (Portable Network Graphics) or print file of UML class diagram output. The ObjectAid UML Explorer [11] is an agile and lightweight code visualization tool for the Eclipse IDE (Integrated Development Environment). It shows Java source code and libraries in live UML class and sequence diagrams that automatically update as program code changes. Jupe is a UML plugin [12] for Eclipse for creating UML class diagrams, generating Java code, and reverse engineering UML class diagrams. The plugin is based on the GEF (Graphical Editing Framework)[13]and UML 2 frameworks[14] and supports Eclipse 3.2. Jupe, as open source software, allows loading and saving diagrams to XMI (XML Metadata Interface) [15]. III. UML CLASS DIAGRAM Class diagrams represent the structure and global behaviour of programs. They show the programs classes and interfaces and their relationships of inheritance, instantiation, use association, aggregation and composition. Class diagram would provide useful data during programs maintenance [6].The UML class diagram facilitates the developers ability to examine the entities and their relationships in the software system [8]. In software engineering, class diagram in the UML is a type of static structure diagram that describes the structure of a system by showing the system s classes, their attributes, operations(or methods), and the relationships among objects[16]. IV. CLASS DIAGRAM FROM OOP CODE As we have developed our proposed tool classuml, before any other activity user of the tool is needed to import object oriented source code or we say project. Regular expression (regex)[17] has been applied to extract the patterns of object or classes and functions by pattern matching technique on the basis formal grammar and languages[18]. Figure 1 depicts the workflow or overview of the proposed tool. Then after, our tool analyses the dependency among object by using program slicing and pattern matching technique. Next, we get the objects with their dependencies. A graphical representing tool- GraphViz [19] is used to generate the UML class diagram from objects relationship matrix. Here we are using objects as artefacts of the object-oriented source code interchangeably. There are some professional tools as well to generate UML diagrams from program source code which are mentioned as below. MaintainJ [9] generates runtime sequence diagram using the call trace captured for a single use case while we run the application. The captured information includes data at each method call, any SQL (Structured Query Language) calls to the 148 Figure 1 Overview of the Proposed Tool

UML Class Diagram from Object Oriented Program for Reverse Engineering Purpose V. DESCRIPTION OF THE PROPOSED TOOL (CLASSUML) In this section, all the interfaces and outputs of classuml are presented with their brief explanation. The tool has been developed in C#.net using regular expression for code pattern detection and graphviz tool[19] has been used for the display of class diagram. Windows Form design has been used to design the interface but the output of the graph is soon in the browser. Most of the forms have button control to see the desired output by clicking it. Label controls are used to support the user to understand the meaning of output. The concept has been implemented using C#.Net 2012, graph-viz tool, internet explorer and MS-DOS (Microsoft Disk Operating System). Regular expression and file handling have been used in the project to extract the class and method information and import the OOP (Object Oriented Program) project code automatically respectively. User is required to upload the system before analysing the code. Figure 2 presents the project importing form for a fresh project. There are two options as tab in this form. Either user imports new project or selects from the already analysed project. Select Project button has been shown in the form to allow user to select the fresh project into our tool. After selecting the project, the list of files will be shown in the rightside list box and the project tile will be displayed in the left bottom. Figure 3 concerns with the selection of the already analysed project by the tool. After selection of the project from project repository through combo box selection, the dialogue box will be shown as shown in the centre of this form. Figure 2 Project importing form for a new project Figure 3 Project importing form for already analysed project Mainly we have two view of the class diagram; one is abbreviated class diagram and full or complete class diagram. Abbreviated class diagram view only concerns with the class dependency whether an object of one class is created by another class or not. For example: A and B are two classes. If class B creates an object of class A and invokes its at least function then in that case, class B is dependent on class A. Therefore, there would be arrow from class B to class A. Figure 4 presents the abbreviated view of class diagram where rectangle represents the class and arrow represents the class dependency. That shows the relationship or dependency among classes. For example: class MDI_marksheet dependent on class Subject whereas class Subject is itself dependent on class mainclass. Our example system is 149 marksheet management system itself not a complete system. Thus, our tool can analyse intermediate system and enhance the readability of the system. Figure 4 Abbreviated View of Class Dependency Dependency among functions and classes can be found out through its special pattern matching technique. If one function defined in one class, calls the function defined in another class then there would be dependency between these two calling and called function of different classes. When one function of one class calls to another function of another class then control pauses the current operation of the statement of the calling function and goes to the called function. Control enters to the called function and continues the execution of the statements. After completion of execution of last statement or after returning the value to the calling function, control comes back to the calling function that is the how execution of the program performed. Control dependency analysis or control-flow analysis describes the flow of code execution. Control enters into the block through the first statement as entry point and remains there until the last statement does not complete its execution. During the execution of instructions or statements inside the block, control-flow can go from one block to another depends upon the logical statement, conditional statements, looping statement, function call, goto statement and any type of jump instructions. Figure 5 shows dependency of the object-oriented program. Treeview of all class lists with their function are shown right side of the form. On the left of the form, one listbox control displays the list of control dependency among classes and functions. For example: mainclass insert_record.>>>term add_btn_click() means there is a function add_btn_click() declared inside class term which is calling another function insert_record() which is defined inside class mainclass.

International Conference on Innovative Entrepreneurship and Startup Figure 5 Dependency among functions and classes Figure 6 presents the multidimensional view of class relationship where row and column header represents the classes. 1 means row class is dependent on the column class i.e. row class is creating an object of column class where 0 means there is no such class dependency. Display Graph button allows jumping into the crossponding complete class diagram. Figure 7 Complete Class Diagram Figure 6 Class relationship diagram matrix view The complete reverse engineering UML class diagram of our example code has been shown in Figure 7. Classes are presented with rectangle boxes and arrow shows the inter-class relationship pointing dependent class to another class. For example: class Subject is dependent on class user whereas class user itself is dependent on class mainclass. To make the class diagram more understandable, we have included only the function member of the class and ignored the data variable portions. Functions are in the rectangle box just below the class name followed by + sign. The output has been shown in the browser using GraphViz diagram designing tool. VI. CONCLUSION AND FUTURE WORKS The present study has been made to develop a tool which will eventually be useful to create UML class diagram for object oriented program maintainer. Comparison between tool output design and code design through the experiment ensures that our tool is surely capable to generate class diagram of any object-oriented program. Project import module, class and functions dependency view, abbreviated class diagram, class relationship multidimensional view and complete class diagram have been precisely presented by our tool. We would like to discuss with the participants about the difficulty and limitations of reverse-engineering dynamic models of programs as well as the opportunities of higher level analyses. Our future work will be to develop all other UML diagrams and address the dynamic behaviour of the objectoriented software properly. REFERENCES [1] I. Jacobson, G. Booch and J. Rumbaugh, The unified software development process, Addison-Wesley Professional, 1 st edition, 1999. [2] Y.G. Guéhéneuc and T. Ziadi, Automated reverse-engineering of UML v2.0 dynamic models, 2006. [3] S. K. Mishra, D.S. Kushwaha and A.K. Misra, Creating Reusable Software Component from Object-Oriented Legacy System through Reverse Engineering, Journal of Object Technology 01/2009, 2009, vol. 8, pp. 133-152. [4] S. Matzko, P. J. Clarke, T. H. Gibbs, B. A. Malloy, J. F. Power and R. Monahan, Reveal: a tool to reverse engineer class diagrams, Proceeding CRPIT '02 Proceedings of the Fortieth International Conference on Tools Pacific: Objects for internet, mobile and embedded applications, 2002, pp. 13-21. [5] M. Lejter, S. Meyers, S. P. Reiss, Support for maintaining objectoriented programs, Software Engineering, IEEE Transactions on 1992. vol. 18(12), pp. 1045-1052. 150

UML Class Diagram from Object Oriented Program for Reverse Engineering Purpose [6] Y.G. Guéhéneuc, A reverse engineering tool for precise class diagrams, Proceedings of the 2004 conference of the Centre for Advanced Studies on Collaborative research, 2004, pp. 28-41. [7] F. T. Sheldon and H. Chung, Measuring the complexity of class diagrams in reverse engineering, Journal of Software Maintenance and Evolution: Research and Practice, 2006, vol. 18(5): pp. 333-350. [8] A. Nanthaamornphong, J. C. Carver, K. Morris and S. Filippone, A lightweight UML-based reverse engineering for object-oriented Fortran: foruml, Proceedings of the 1st International Workshop on Software Engineering, 2007. [9] N. Alizadeh and Ericsson, MaintainJ : reverse engineer Java like never before,web article, Accessed at: http://maintainj.com/, updated date: April 30, 2013, accessed date: 19/09/2014, 2013. [10] AgileJ, Java UML reverse engineering using eclipse, web article, accessed at: http://www.agilej.com/, updated date: April 30, 2013, accessed date: 19/09/2014, 2006. [11] ObjectAid, The ObjectAid UML Explorer for Eclipse web article, accessed at: http:www.objectaid.com, updated date: Feb 4, 2012, accessed date: 19/09/2014, 2014. [12] M. Adolph, R. Ebert, S. Klüpfel, M. Pradel, E. Thomas, C. J. G. Vieira, R. Wolf, E. Zielasko, Jupe is a UML plugin for Eclipse web article, accessed at: http:www.jupe.binaervarianz.de, updated date: March, 2007, accessed date: 19/09/2014, 2007. [13] GEF, Graphical Editing Framework web article, accessed at: http://www.eclipse.org/gef/, updated date: March 23 2007, accessed date: 19/09/2014, 2007 [14] UML2.0, Documents associated with UML version 2.0 web article, accessed at: www.omg.org/spec/uml/2.0/, updated date: Jun 5, 2005, accessed date: 19/09/201a4, 2014. [15] XMI, XML Metadata Interchange web article, accessed at: https://help.sap.com/saphelpnw73/helpdata/en/ee/daa16249c742bd8a111 d9b40bcce75/content.htm, updated date: May 3, 2002, accessed date: 19/09/2014, 2002. [16] Sparks, Database modeling in UML. designlines automotive news and analysis web article, accessed at: http://www.sparxsystems.com/ downloads/whitepapers/database_modeling_in_uml.pdf, 2002. updated date: 6/25/2002, accessed date: 18/09/2014. [17] Regex, Regular expression language - Quick Reference Microsoft Developer Network, web article, accessed at: http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.110).aspx, 2014. Last visit: 25/4/2014, accessed date: 18/09/2014. [18] T. Jiang,M. Li, B. Ravikumar and K. W. Regan, Formal grammars and languages, Algorithms and theory of computation handbook, 2010, vol. 2, pp. 20-20 [19] Graphviz, Graph visualization software web article, access at: http://www.graphviz.org/, accessed date: 01/04/2014, 2014.. 151