CHAPTER 6 EXTRACTION OF METHOD SIGNATURES FROM UML CLASS DIAGRAM



Similar documents
Semantic Stored Procedures Programming Environment and performance analysis

Databases in Organizations

Redefining Static Analysis A Standards Approach. Mike Oara CTO, Hatha Systems

OpenLDAP Oracle Enterprise Gateway Integration Guide

Java Application Developer Certificate Program Competencies

Web Services for Management Perl Library VMware ESX Server 3.5, VMware ESX Server 3i version 3.5, and VMware VirtualCenter 2.5

Performance Analysis, Data Sharing, Tools Integration: New Approach based on Ontology

CS346: Database Programming.

ONTOLOGY-ORIENTED INFERENCE-BASED LEARNING CONTENT MANAGEMENT SYSTEM

Log Mining Based on Hadoop s Map and Reduce Technique

Semantic Modeling with RDF. DBTech ExtWorkshop on Database Modeling and Semantic Modeling Lili Aunimo

Model Driven Interoperability through Semantic Annotations using SoaML and ODM

Big Data, Fast Data, Complex Data. Jans Aasman Franz Inc

CRM Setup Factory Installer V 3.0 Developers Guide

ABSTRACT 1. INTRODUCTION. Kamil Bajda-Pawlikowski

DDI Lifecycle: Moving Forward Status of the Development of DDI 4. Joachim Wackerow Technical Committee, DDI Alliance

Java (12 Weeks) Introduction to Java Programming Language

Combining SAWSDL, OWL DL and UDDI for Semantically Enhanced Web Service Discovery

Web Service Caching Using Command Cache

Data Consumer's Guide. Aggregating and consuming data from profiles March, 2015

MultiMimsy database extractions and OAI repositories at the Museum of London

Developing Web 3.0. Nova Spivak & Lew Tucker Tim Boudreau

Open Source egovernment Reference Architecture Osera.modeldriven.org. Copyright 2006 Data Access Technologies, Inc. Slide 1

Information Management Metamodel

DISTRIBUTED RDF QUERY PROCESSING AND REASONING FOR BIG DATA / LINKED DATA. A THESIS IN Computer Science

Linked Data Interface, Semantics and a T-Box Triple Store for Microsoft SharePoint

CHAPTER 5 INTELLIGENT TECHNIQUES TO PREVENT SQL INJECTION ATTACKS

Comparison of Triple Stores

Semantic Content Management with Apache Stanbol

Copyright 2014 Jaspersoft Corporation. All rights reserved. Printed in the U.S.A. Jaspersoft, the Jaspersoft

Semantic Knowledge Management System. Paripati Lohith Kumar. School of Information Technology

City Data Pipeline. A System for Making Open Data Useful for Cities. stefan.bischof@tuwien.ac.at

MDA Overview OMG. Enterprise Architect UML 2 Case Tool by Sparx Systems by Sparx Systems

Data-Warehouse-, Data-Mining- und OLAP-Technologien

Integrating VoltDB with Hadoop

ICE Trade Vault. Public User & Technology Guide June 6, 2014

Structured Content: the Key to Agile. Web Experience Management. Introduction

Scalable End-User Access to Big Data HELLENIC REPUBLIC National and Kapodistrian University of Athens

HOBOlink Web Services V2 Developer s Guide

Large Scale Text Analysis Using the Map/Reduce

Data processing goes big

Spring,2015. Apache Hive BY NATIA MAMAIASHVILI, LASHA AMASHUKELI & ALEKO CHAKHVASHVILI SUPERVAIZOR: PROF. NODAR MOMTSELIDZE

Iotivity Programmer s Guide Soft Sensor Manager for Android

Onset Computer Corporation

UIMA and WebContent: Complementary Frameworks for Building Semantic Web Applications

So today we shall continue our discussion on the search engines and web crawlers. (Refer Slide Time: 01:02)

A collaborative platform for knowledge management

System Requirement Specification for A Distributed Desktop Search and Document Sharing Tool for Local Area Networks

Designing a Semantic Repository

technische universiteit eindhoven WIS & Engineering Geert-Jan Houben

SAP Data Services 4.X. An Enterprise Information management Solution

Dimension Technology Solutions Team 2

Models and Architecture for Smart Data Management

Managing enterprise applications as dynamic resources in corporate semantic webs an application scenario for semantic web services.

Publishing Linked Data Requires More than Just Using a Tool

Services. Relational. Databases & JDBC. Today. Relational. Databases SQL JDBC. Next Time. Services. Relational. Databases & JDBC. Today.

Microsoft Active Directory Oracle Enterprise Gateway Integration Guide

Design and Implementation of a Semantic Web Solution for Real-time Reservoir Management

FreeForm Designer. Phone: Fax: POB 8792, Natanya, Israel Document2

Big Data and Semantic Web in Manufacturing. Nitesh Khilwani, PhD Chief Engineer, Samsung Research Institute Noida, India

Recovering Business Rules from Legacy Source Code for System Modernization

Getting Started with STATISTICA Enterprise Programming

BIG DATA AGGREGATOR STASINOS KONSTANTOPOULOS NCSR DEMOKRITOS, GREECE. Big Data Europe

Software Architecture Document

Sector vs. Hadoop. A Brief Comparison Between the Two Systems

Ligero Content Delivery Server. Documentum Content Integration with

HadoopRDF : A Scalable RDF Data Analysis System

Specify the location of an HTML control stored in the application repository. See Using the XPath search method, page 2.

business transaction information management

An Ontological Approach to Oracle BPM

Introduction to XML Applications

Smooks Dev Tools Reference Guide. Version: GA

BYODs & FAIR Data Stewardship

Drupal CMS for marketing sites

Semantic Web Services for e-learning: Engineering and Technology Domain

JOURNAL OF COMPUTER SCIENCE AND ENGINEERING

Information Technology for KM

JDBC (Java / SQL Programming) CS 377: Database Systems

Flattening Enterprise Knowledge

Building Web Applications, Servlets, JSP and JDBC

MUSYOP: Towards a Query Optimization for Heterogeneous Distributed Database System in Energy Data Management

SPARQL UniProt.RDF. Get these slides! Tutorial plan. Everyone has had some introduction slash knowledge of RDF.

Common Warehouse Metamodel (CWM): Extending UML for Data Warehousing and Business Intelligence

Semantic EPC: Enhancing Process Modeling Using Ontologies

Data Domain Profiling and Data Masking for Hadoop

An Integrated Framework for Hospital Appointment Management Mohammed Jamal Anwar Computer Science with Operational Research (Industry) 2008/2009

Natural Language Processing in the EHR Lifecycle

Transcription:

CHAPTER 6 EXTRACTION OF METHOD SIGNATURES FROM UML CLASS DIAGRAM 6.1 INTRODUCTION There are various phases in software project development. The various phases are: SRS, Design, Coding, Testing, Implementation, and Maintenance. During the design phase, UML class diagrams are constructed and the methods and programs are developed. The UML class diagram acts as a powerful tool between the developer and the user. It is like a contract where both parties agree for software development using UML class diagram. When a team of developers is designing a large application, which must be used by an enterprise, it is not enough to just put together a collection of code modules. The structure of an application is often known as its architecture, and the architecture must be defined in a way which allows the maintenance programmer, to easily find bugs and fix them. Because many bugs don't show up until long after the develop process, the programmer should be able to fix them quickly. The developed project s method signatures are stored in ontology and the project files are stored in Hadoop. To develop a new project, the developer search for components in the ontology and retrieve code from Hadoop. The ontology represents the knowledgebase of the company for the code reuse. The methods available in the UML class diagram is extracted and searched in the ontology and the matched methods can be retrieved from the Hadoop and used in the new project development. The method metadata are extracted from the UML and passed to the SPARQL to extract the available methods from the ontology. The developer can select appropriate method from the list and the corresponding code component is retrieved from the Hadoop. The main focus of the research is to find out the number of available methods for development and extracting them from Hadoop using UML class diagram. 86

This chapter begins with detailed features and process for method retriever in section 6.2 and the Keyword Extractor for UML in section 6.3. The Method Retriever by Jena framework is in section 6.4 and the Source Retriever from the HDFS is in section 6.5. 6.2 METHOD RETRIEVER The total numbers of methods used in the project are transformed into a Method Ontology (MO). Method Retriever is a process that takes either UML class diagram or XMI file as an input mentioned by the user. Method Retriever identifies the reusable methods for the given class diagram. The Method Retriever consists of three components: 1. Keyword Extractor 2. Method Matcher 3. Source Retriever The process of the Method Retriever process is presented in Figure 6.1. The Keyword Extractor for UML extracts the metadata from the UML class diagram. The class diagram created by Umberllo tool is passed as input to the Keyword Extractor. The input for the process is an existing UML class diagram or created by the tool. Both types of input are loaded in to Umberllo and the file type for storing UML class diagram is XMI format. The file is parsed for metadata extraction. The parser extracts method signatures from the XMI file and passes it to the Method Matcher component. The Method Matcher component retrieves the matched methods from the method ontology. It constructs SPARQL query to retrieve the matched results. The user should select the appropriate method from the list of methods and retrieve the source code by Source Retriever component which interacts with HDFS and displays the source code. 87

Figure 6.1 - Process of Method Retriever for UML 6.3 KEYWORD EXTRACTOR To make sense of various approaches of an object oriented analysis and design, an Analysis and Design Task Force was established within the Object Management Group (OMG). By November 1997, a de jure standard was adopted by the OMG members called, UML [72], [73] and [74]. UML 2.0 is the latest version of UML [75]. To create UML class diagram, Umberllo UML Modular open source tool is used. The diagram is stored in XMI format. The XMI is an OMG standard for exchanging metadata information using XML. The process flow of Keyword Extractor for UML is shown in the Figure 6.2. The XMI or UML file is parsed with the help of the SAX Parser. SAX provides a mechanism 88

for reading data from an XML document. SAX loads the UML diagrams with the extension of.xmi files are used in the Method Extraction. Each diagram consists of Class, Operation, Field etc. It gets the attribute value of the tags by attributes.getvalue(<name of the attributes>) method. The retrieved attributes by the methods are Parse, Attributes and getvalue(nameofattribute). The Parse() method will parse the XMI file. The Attribute is to hold the attribute value. GetValue(nameOfAttibute) method returns class information, Figure 6.2 - Process of Keyword Extractor for UML method information and parameter information of the attribute. The XMI file consists of XML tags. To extract class information, method information and parameter information, they are identified with the appropriate tag as illustrated in Table 6.1. Using the tags the metadata of the UML or the XMI is extracted. The extracted metadata - class, methods, attributes etc., are passed to the Method Retriever component. 89

6.4 METHOD MATCHER Method Matcher component interact with the OWL and returns the available methods for the given class diagram. This is represented diagrammatically in Figure 6.3. The extracted information from the UML file by the Keyword Extractor for UML is passed to the Method Retriever. Table 6.1 - Tags used to extract Metadata from XMI file Tag UML:DataType UML:Class UML:Attribute UML:Operation UML:BehavioralFeature.parameter Purpose It holds the data type information It holds the class information like name of the class, visibility of the class,etc., Attribute is a sub tag of class. It holds the information of the class attributes like name of the attributes, type of the attributes, and visibility of the attributes etc., It holds the methods information of the class like name of the methods, return type of the methods, visibility of the methods. It holds the information of the methods parameters like name of the parameter, data type of the parameter. Query answering is important in the context of the Semantic Web, since it provides a mechanism via, which users and applications can interact with ontology and data. Several query languages have been designed for this purpose, including RDQL, SeRQL and, most recently, SPARQL. 90

6.4.1" Query Processor A query processor executes the SPARQL Query and retrieves the matched results. The SPARQL Query Language for RDF [76] and the SPARQL Protocol for RDF [77] are increasingly used as a standardized query API for providing access to datasets on the public Web and within enterprise settings. The SPARQL query takes method parameters and returns the results. The retrieved results contains project details like name of the project, version of the project and method details like name of the package, name of the class, method name, method return type, method parameter. Query processer takes the extracted method name and the method parameter as an input and retrieves the methods and project information from the OWL. The steps followed to extract the matched methods are as follows: Load the Ontology model. Create a SPARQL Query to retrieve method details from the OWL. This SPARQL Query filters the details based on the given method name. Create Query using the create(string query) static method of QueryFactory. Execute the query and obtain the result using the create(query, model) static method of QueryExecutionFactory. Get the ResultSet from the QueryExecution. From the ResultSet get the QuerySolution. This QuerySolution will contain a row of record. Using this query solution the user gets the value of each query variable. These query variables appear in the SPARQL with prefix of question mark (eg.?projectname). So the user gets the value of projectname by row.get( projectname ).tostring(). This will return the name of the project. Similarly pass all the query variables and get the result. 6.4.2 SPARQL Query The SPARQL query is constructed to extract the project name, version, package name, class name, method name, return type, return identifier name, method parameter name and type. The sample query is as follows: 91

Figure 6.3 Process of Method Matcher for UML PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT?pname?version?packname?cname?mname?rType?identifier?paramName?parmDT?paramT WHERE {?project rdf:type base:project.?project base:name?pname.?project base:project_version?version.?project base:haspackage?pack.?pack base:name?packname.?pack base:hasclass?class. 92

}?class base:name?cname.?class base:hasmethod?subject.?subject base:name?mname.?subject base:returns?rtype.?subject base:identifier?identifier.?subject base:hasparameter?parameter.?parameter base:name?paramname.?parameter base:datatype?parmdt.?parameter base:datatype?parmt. FILTER regex (?mname, "add", "i" ). FILTER regex (?parmt, "java.lang.string", "i" ). 6.5 SOURCE RETRIEVER Source Retriever component retrieves the appropriate source code from HDFS. The source code file location of the Hadoop repository path is obtained from the OWL and retrieved from the HDFS by the copytolocal(fromfilepath,localfilepath) method. In order to retrieve the source code from Hadoop process, it must be started at background. Only then the user is allowed to retrieve the source code. The user selects the methods for viewing code from the Hadoop. The parameters associated with the methods such as project name, version, package name, class name, and Method Name are passed as input to the Hadoop process. Hadoop file system lists the available data in the given path. The data can be a file or a directory itself. If it is a directory, again list the available data in the path. If not, get the file name from the listed path using getname() method of the Path. This will return the name of the file. If the class name from the metadata matches the name of the java file, open the file path using Hadoop file system and create instance for BufferedReader. 93

In Hadoop repository files are organized in the same hierarchy of java folder. This BufferedReader instance holds the entire content of the file. The above is a recursive operation. So when the recursive operation gets over, The BufferedReader instance will have the content of the file. Create a new instance of the JavaDocBuilder of the Qdox library. Then add the created BufferedReader instance as resource to the JavaDocBuilder. List all the methods from the JavaDocBuilder instance using getmethods(). Search through the listed methods with the method name. If a method matches with method in the meta data get the source code of the method using getsourcecode(). The entire process is illustrated in Table 6.2. The sample output of the matched methods is listed in Table 6.3. From the list the appropriate method will be selected and the QDox retrieves the source code from the HDFS and displays the method definition of the selected methods. It is shown in the output of the Source Retriever Table 6.2. This chapter presented a process to extract the method code components from the ontology using the UML class diagram. With this sample process flow of the UML method matching, the chapter argued that it is indeed possible to extract code from ontology using the UML class diagram. The method ontology for the source code has already been created and this chapter searched and extracted the code and components and reuses to shorten the software development life cycle. Before starting the coding phase of the development, the framework helps the software development team, to access the possibilities of how much code can be reused and how much code need to be developed. 94

Table 6.2 - Process flow of the UML Method Matching Process Input Output UML Extraction Method Retriever Given Class Diagram Name : validatelogin Return : Boolean visibility : public Parameters : User Name DataType : username validatelogin(string Refer Table 5.3 username) Source Retriever validatelogin(string username) boolean returnstatus = false; DatabaseOperation databaseoperation = new DatabaseOperation(); String strquery = "SELECT * FROM login WHERE uname='"+userid+"'"; ResultSet resultset = databaseoperation.selectfromdatabase(st rquery); try { while(resultset.next()){ } returnstatus = true; } catch (SQLException e) { e.printstacktrace(); } return returnstatus; 95

Table 6.3 Method Matcher Output Sl. No. Information Project Name : CBR_1.0 Package : com.cbr.my.engine Class Name : Login 1. Method Name : ValidateLogin Parameters : Return Type : UserName boolean Project Name : RBR_1.0 Package : com.my.rbr.utils.engine Class Name : LoginManger Method Name : LoginLog 2. Parameters : Return Type : Method UserName,ActivityCode boolean Name : LoginContol Parameters : Return Type : UserName,password boolean 3. Project Name : BHR_1.0 Package : com.boscoits.bhr.utils.action 96

Class Name : ControlManager Method Name : ManageLogin Parameters : UserName,password,memberId,ActionId Return Type : boolean Method Name : ValidateLogin Parameters : Return Type : UserName,password boolean 97