Implementation for Model of Object Oriented Class Cohesion Metric -MCCM Tejdeda Alhussen Alhadi Dr

Total Page:16

File Type:pdf, Size:1020Kb

Implementation for Model of Object Oriented Class Cohesion Metric -MCCM Tejdeda Alhussen Alhadi Dr Advances in Information Science and Applications - Volume II Implementation for Model of Object Oriented Class Cohesion Metric -MCCM Tejdeda Alhussen Alhadi Dr. Omer Saleh Xavier Patrick Kishore Sagaya Aurelia [email protected] [email protected] [email protected] [email protected] Department of Computer Science Faculty of Education Beniwalid, Libya II. E1B NVIRONMENT Abstract—Class cohesion should not exclusively be based on common instance variables usage criteria. Method Connectivity The Java runtime environment (JRE) is required in Cohesion Metric (MCCM) uses both direct and indirect method order to run (MCCM.jar). We have also used Eclipse (SDK relations (attributes usage criterion and methods invocation 3.1) which is a kind of universal tool platform-an open criterion) in its calculations [1]. This paper presents a tool to extensible IDE for anything and nothing in particular. It measure MCCM (Method Connectivity Cohesion Metric) that provides a feature rich development environment that allows measures the cohesion of classes coded by Java programming the developer to efficiently create tools that integrate language. The major motivation is to carry out this study that seamlessly in Eclipse platform [2]. The jar file is directly computes the class cohesion and comparison between MCCM metric and LCC. executable by Eclipse SDK program. Keywords—MCCM; Cohesion; Method Invocation; Attribute A.2B MCCM Metric Architecture Usage MCCM metric is a software metrics tool that measures the structural properties of java code and computes a number of I. INTRODUCTION software measures that include cohesion and coupling. There are lots of metrics for coupling and cohesion in the literature, for the estimation of class cohesion is based on different relationships that may exist between its methods. It takes into account several ways of capturing the functional Class .Jar cohesion of the class, by focusing on Connectivity between File File methods [1]. The MCCM tool measures the quality of the entrance program by the user, Then entrance program is analyzed to classes, these classes are measured its cohesion and coupling of each class separately by the used metric (MCCM). Class Jar Finally, (MCCM) tool presents the results of cohesion and Parser parser coupling of each class, to make the programmed able to modify any class has non-satisfactory results in order to reach the highest quality. Data Repository Quality Goals MCCM Metric Calculation Tool Tool High Cohesion (MCCM Metric) Low Coupling Cohesion Coupling Results Repository Entrance program Fig.2. MCCM Metric Architecture User Interface Results Fig.1. Overview of MCCM Implementation As shown in Fig.2, object-oriented systems are parsed to the tool in order to collect the data that can be used in computing ISBN: 978-1-61804-237-8 576 Advances in Information Science and Applications - Volume II the various software metrics supported by the tool. The data collected are stored in central data repository and results in result repository. B.Flow Chart of (MCCM) Tool Start Input Find the No, of Attributes & No, of Methods Fig(4) main page of MCCM software. A. Analyzing the file file chosen in the first step will be listed. To analyze which is the second section of this program, right click on file (.class Check the or .jar) and select Analyze. Connection Indirect Type Direct Calculate Indirect Calculate Direct Connection (MI& AU) Connection (MI& AU) Calculate MCCM Display Results Fig.5. Screen Capture of Analysis the file End B.Examining the results The results will be listed in the output section, the third Fig.3. Flow Chart of (MCCM) Tool section of this program. III. USING MCCM MEASUREMENT TOOL This program has three main sections: A. Input Section B. Analyze Section C. Output Section Fig.6.Screen Capture of Exporting the results ISBN: 978-1-61804-237-8 577 Advances in Information Science and Applications - Volume II IV. THE EVALUATION In order to complete the project and make it ready for the M1 M2 M3 user it should undergo an evaluation process to confirm that MCCM tool fulfills the proposed objectives and demonstration of the software. a1 a2 A. ConnectivityCriteria In this section will calculate for each connectivity (Direct / Indirect) mathematical MCCM value [1] and the compare with MCCM tool value. The table (1) shows the results of this comparison. TABLE 1 CONNECTIVITY CRITERIA B.Selected System From a total of six projects, three projects were MCCM MCCM collected from www.projectsparadise.com, and other projects (Mathematical Calculation) (Metric Output) from SourceForge.net which are an open source websites that provides a centralized space where open source developers can control and manage open source software development [3] [4]. M M TABLE 2 DETAILS OF THE PROJECTS M No of No of No of Project Classes methods Attributes bluej-307 7 86 245 car_sales_system 11 102 323 LibraryManagementSystem 29 570 340 checkstyle-all-2.4 78 492 228 jgraph-5.10.2.0 50 750 340 Saxon9he 107 1252 876 C.Snapshot of Output of Projects Using MCCM Tool: M M TABLE 3 SNAPSHOT OF OUTPUT Project M Class name LCOM LCC MCCM COUPLING name Bluej Org.apache.log4j.chain 1 0.11 0.33 0.67 saw.controlPanel$1 - 307.jar Org.apache.log4j.chain 1 0.32 0.33 0.67 saw.controlPanel$2 Org.apache.log4j.chain 100 0.02 0.33 0.67 saw.controlPanel$3 Car_sale system AboutDialog 4 0.08 0.88 0.12 _ AddCarPanel 7 0.15 0.83 0.17 Car 77 0.01 0.88 0.12 managm Library Library system M1 M2 M3 ent AddBooks 12 0.01 0.93 0.07 AddMembers 3 0.04 0.88 0.12 Books 102 0.0 0.92 0.08 Antlr.ANTLRHashStri 4 4 0.42 0.68 0.32 Checkstyle.jar ng Antlr.ANTLRStringBu 0 0 0.37 0.5 0.5 a1 a2 ffer Antlr.ASTFactory 89 0.3 0.92 0.08 Antlr.ASTPair 0 0.27 0.5 0.5 Antlr.BaseAST 504 0.02 0.93 0.07 Antlr.CHarQueue 0 0.66 0.35 0.65 Jgrap h .jar Org.jgraph.event.Grap 0 0.41 0.25 0.75 hSelectionEvent ISBN: 978-1-61804-237-8 578 Advances in Information Science and Applications - Volume II Org.jgraph.AbstractCe 383 0.07 0.85 0.15 • The cohesion value of the LCOM metric in class llView (CarsCollection) equals (0.0), and the cohesion value of Org.jgraph.graph.Attri 325 0.03 1.0 0.0 buteMap the MCCM metric equals (0.68). The cohesion value of Org.jgraph.graph.Basi the LCOM metric in class (SearchByOtherpanel) equals 88 0.07 0.75 0.25 cMarqueeHandler (0.0), and the cohesion value of the MCCM metric equals Org.jgraph.graph.Conn 9 9 0.11 0.66 0.34 (0.77). The cohesion value of the LCOM metric in class ectionSet$Connection Org.jgraph.graph.Conn (ShowAllCarpanel) equals (0.0), and the cohesion value of 30 0.46 0.5 0.5 ectionSet the MCCM metric equals (0.62). Where LCOM metric Javax.xml.xquery.XQ gives zero value, MCCM metric gives values which are 1 1 0.0 1.0 0.0 Constant higher than zero. So not all the connection types between Javax.xml.XQQueryE 2 2 0.1 0.71 0.29 elements in a class are taken into account in LCOM xception Saxon9he.jar metric. Javax.xml.xquery.XQ 0 0 0.22 0.5 0.5 StackTraceVariable • The coupling values of all classes are low, as we know the Net.sf.saxon.dom.Attr 46 0.09 0.63 0.37 OverNodeInfo maximum value of coupling is one. For example: coupling Net.sf.saxon.dom.Doc of class (Car) equals (0.12), and coupling of class umentBuilderFactoryI 17 0.13 0.7 0.3 mpI Metric Interaction Type Interaction Mode Method Interaction Net.sf.saxon.dom.Doc 15 0.18 0.61 0.39 M/ A/ M A M M Direct Indirect umentBuilderImpI Invocation Sharing LCOM √ √ √ D.Results and Analysis LCC √ √ √ √ MCCM √ √ √ √ √ √ TABLE (4) RESULTS OF (CAR_SALES_SYSTEM.JAR) (Welcomepanel) equals (0.31). Project Class name LCOM LCC MCCM Coupling Through this explanation we results that the above tables name prove that MCCM metric tool always has high cohesion and AboutDialog 4 0.08 0.88 0.12 low AddCarpanel 7 0.15 0.83 0.17 coupling. The result states that MCCM metric always returns Car 77 0.01 0.88 0.12 higher values comparing to LCC because, all the connection car_sales_system CarDrtailsComponents 21 0.05 0.85 0.15 type between elements in the classes are taken under CarSalesSystem 130 0.02 0.95 0.05 consideration. Moreover, Cohesion refers to the degree of the CarsCollection 0 0.23 0.68 0.32 relatedness of the members in a component. High cohesion is a desirable property of software components. It is widely Manufacturer 3 0.19 0.58 0.42 recognized that highly cohesive components tend to have high SearchByAgepanel 0 0.26 0.72 0.28 maintainability and reusability. SearchByOtherpanel 0 0.22 0.77 0.23 ShowAllCarpanel 0 0.34 0.62 0.38 E. Comparison between two projects Welcomepanel 0 0.41 0.69 0.31 This section presents measuring and comparison the quality of two projects by using MCCM tool. In this section we present the analysis of the results using MCCM tool, and Comparison between LCOM metric, LCC • First project (car_sales_system.jar) metric and MCCM metric. Table (4) shows the results of metrics calculation under mentioned project using LCOM, LCC and our proposed metrics for class cohesion MCCM and we can interpret the results as follows: • The cohesion value of the LCC metric in class (AboutDialog) equals (0.08), and the cohesion value of the MCCM metric equals (0.88).
Recommended publications
  • Problem Solutions of Phase Ambiguity and Initial Phase Shifts of the Phase Radio Navigation System for Aircraft Blind Landing
    IJISET - International Journal of Innovative Science, Engineering & Technology, Vol. 2 Issue 3, March 2015. www.ijiset.com ISSN 2348 – 7968 Problem Solutions of Phase Ambiguity and Initial Phase Shifts of the Phase Radio Navigation System for Aircraft Blind Landing 1 2 Saed SasiP ,P Nasar Aldian ShashoaP P 1 P DepartmentP of Electrical and Computer Engineering , Libyan Academy, Jansour, Tripoli, Libya 2 P P Electrical Engineering Departme, Azzaytuna University, Tarhuna, Tripoli, Libya Abstract fast processing capabilities to resolve timing differences This work is a continuation of a design of a phase radio for fine-grained measurements, this problem is amplified navigation system for aircraft blind landing in case of non- over short distances. The other problem with these systems equipped runways proposed in [1], where, the proposed system is is the need to have and maintain high synchronization based on measuring the phase shifts of signals received from four between the transmitter and receiver, which adds an extra ground transmitters (antennas), placed on corners of the runway strip, which provide distance measurements accuracy in burden on the system cost and design. Unfortunately, the millimeters. However, there are two important points that need time of flight measurement is not accurate enough for the serious consideration. First, the phase measurement is going to high demands of landing systems. As third approach, by sending one or two signals of different carrier frequencies, give the total phase (ρ0 − ϕ) , while the actual phase shift of and then measuring the difference of phase shifts of the interest is ‘ϕ ’, ρ is the transmitter initial phase.
    [Show full text]
  • Admission 2014 / 2015 AD
    CatalogAdmission 2014 / 2015 AD. Contents Introduction .......................................................................................................................................... 4 Cooperation Agreements ........................................................................................................... 5 Accreditation and Recognition ............................................................................................... 6 University Location.......................................................................................................................... 6 University Campuses...................................................................................................................... 6 Admission requirements for Bachelor and Diploma programs ................... 8 Requirements for Transfer ....................................................................................................... 14 Visiting Students ............................................................................................................................... 14 Deferring Admission ...................................................................................................................... 15 Application Procedure .................................................................................................................. 15 Required Documents ..................................................................................................................... 16 Important general notes ............................................................................................................
    [Show full text]
  • A Novel Approach for Interactive Mobile Augmented Reality System
    Recent Advances in Electrical and Electronic Engineering A Novel Approach for Interactive Mobile Augmented Reality System P. SAGAYA AURELIA, DR. OMER JOMAH Department of Computer Science Azzaytuna University LIBYA [email protected], [email protected] Abstract: - Mobile augmented reality is growing rapidly because of the growth of smartphones. Due to the portable nature of smartphones, mobile augmented reality devices have become the most widely deployed consumer augmented reality display device and show promise for becoming the first commercial success for augmented reality technologies. The role of the user is identified and forwarded to the respective module. Cognitive engagement and interactivity are the main two factors of influenced learning where the engagements are focused in Learnability identification module. When a common, single optical tracking platform is available the reachability and performance can also be increased without affecting the efficiency, which will be done in AllinoneAR Module. An integrated framework consisting of three above stated modules is proposed in this paper. Keyword: - Augmented reality, Learnability, usability, authoring, Role 1 Introduction 2 Mobile Augmented Reality While AR technology is steadily maturing, application Augmented reality and mobile computing are often and content development for those systems is still mentioned together, as many mobile computing taking place mostly at source code level. Besides platforms rely on some kind of head-up or head- limiting developer productivity, this also prevents mounted display to provide continuous access to professionals from other domains such as writers, information, often coupled with hands- free operation. designers or artists from taking an active role in Augmented reality as a user interface for mobile development of AR applications and presentations.
    [Show full text]
  • Use Style: Paper Title
    3rd International Conference on Automation, Control, Engineering and Computer Science (ACECS-2016) 20 - 22 March 2016 - Hammamet, Tunisia Dimension Reduction Based on Scattering Matrices and Classification Using Fisher's Linear Discriminant Nasar Aldian Ambark Shashoa#1, Salah Mohamed Naas #2, Abdurrezag S. Elmezughi #2 #1 Electrical and Electronics Engineering Department, Azzaytuna University #2 Computer Engineering Department, Azzaytuna University Tarhuna, Libya [email protected] [email protected] [email protected] Abstract— This paper presents Feature Extraction Based on Y , the detection method generate parameter estimatesˆ , Scattering Matrices for Classification using fisher's linear which are called features[3]. Although all these techniques are discriminant approach. The recursive least square identification algorithm is estimated for autoregressive model (ARX) system. well designed for the fault detection, one of the most relevant Next, Dimension reduction based on scattering matrices is used techniques for the diagnosis is the supervised classification. It to obtain good classification performance. The classification is not unusual to see the fault diagnosis as a classification task between two classes is done by a fisher's linear discriminant. Our whose objective is to classify new observations to one of the simulation results illustrate the usefulness of the proposed existing classes. Many methods have been developed for procedures. supervised classification. Such as the Fisher Discriminant. Nevertheless, the classification (diagnosis) is a hard task in a Keywords— Scattering Matrices; Fault Diagnosis; Feature large number of parameters. Indeed, it is not uncommon for a Selection; Fisher's linear discriminant. process to be described by a large number of parameters, I. INTRODUCTION where not all parameters are of equal informative value, such that it is possible to describe the behavior of the process well Feature selection is a process of selecting a small number of enough using a smaller set of parameters.
    [Show full text]
  • Abdurrezagh Salem Elmezughi
    To Whom It May Concern: Curriculum Vitae: Abdurrezagh Salem Elmezughi Mobile: 0944157566 - 0917950586 Email [email protected] Abdurrezagh Salem Elmezughi Personal Details: Mobile Number: 0944157566 - 0917950586 Email: [email protected] Date of Birth: 08 November 1959 Marital Status: Married Nationality: Libyan Education: 2004-2008 Doctor of philosophy (PhD) RMIT University Melbourne Australia Majoring in Electrical Engineering. 1987-1989 Master of Science Indiana State University U.S Majoring in Electronics and Computer Technology 1986-1987 Bachelor of science Indiana State University U.S Majoring in Electronics Technology 1983-1985 Associate Degree Central Piedmont Community College Charlotte, N.C U.S.A Majoring in Electronics and Computer Technology Employment: 2016 till now Dean of Engineering Faculty at Azzaytuna University 2016-June 2017 Dean of Engineering Faculty and Head of Information Center at Azzaytuna University 2016 Assisting Professor and Head of Information Center at Azzaytuna University 2013-2016 Lecturer at Azzaytuna University in the Department of Computer Engineering. 2009 Consultant with Almithak and Alsalam For Inspection Co. since June 2009 till now. Dec2008-Jan2009 La Trobe University Melbourne, Australia. Foreign student advisor. 2007-2008 RMIT University Melbourne, Australia. Teaching labs for two courses, Circuit Theory and Power Engineering 1. 1991- June 2002 Spinning and Weaving Company Tripoli, Libya Head of Computer Department (Full-Time) Publications: • A. S. Elmezughi, W. S. T. Rowe and R. B. Waterhouse, "Edge-fed Cavity Backed Patch Antennas and Arrays", accepted for publication in IET Microwaves, Antennas & Prop., Sept. 2008. • A. S. Elmezughi and W. S. T. Rowe, “Realization of MMIC Integratable Antennas with Liquid Foam Dielectrics”, Proceedings of Asia Pacific Microwave Conference 2008, Hong Kong, J6-07, Dec.
    [Show full text]