Effects of Dependency Injection on Maintainability. Kate Razina

Similar documents
Technical Metrics for OO Systems

Application of a Fuzzy Inference System to Measure Maintainability of Object-Oriented Software

Kostis Kapelonis Athens Greece, March 2010

Dependency Injection and Spring. INF5750/ Lecture 2 (Part II)

Empirical Evaluation and Critical Review of Complexity Metrics for Software Components

Reusability Metrics for Object-Oriented System: An Alternative Approach

Evaluation of a Business Application Framework Using Complexity and Functionality Metrics

Research Article ISSN:

1 Introduction. Abstract

A Comparative Study on State Programming: Hierarchical State Machine (HSM) Pattern and State Pattern

Prediction of Software Readiness Using Neural Network

CHAPTER 4 HEURISTICS BASED ON OBJECT ORIENTED METRICS

Investigation of Metrics for Object-Oriented Design Logical Stability

Procedia Computer Science

Introducing the Spring framework

A Study of Software Metrics

Application of Object Oriented Metrics to Java and C Sharp: Comparative Study

Effective Modular Design

SNS College of Technology, Coimbatore, India

An Object-Oriented Metrics Suite for Ada 95

HOW AND WHEN TO FLATTEN JAVA CLASSES?

Dan Hayes. October 27, 2005

Metrics and OO. SE 3S03 - Tutorial 12. Alicia Marinache. Week of Apr 04, Department of Computer Science McMaster University

OPEN source software systems are becoming evermore

Object Oriented Measurement

How to Realization Architectural testing model using Measurement Metrics

METRIC ATTITUDE PLUG-IN FOR ECLIPSE USER GUIDE

On the Impact of Refactoring Operations on Code Quality Metrics

Object Oriented Metrics. Impact on Software Quality

Fault-Proneness Estimation and Java Migration: A Preliminary Case Study

PREDICTION OF SOFTWARE DEFECTS USING OBJECT-ORIENTED METRICS

ISSN: ISO 9001:2008 Certified International Journal of Engineering and Innovative Technology (IJEIT) Volume 3, Issue 11, May 2014

Class Break Point Determination Using CK Metrics Thresholds

J2EE Development Best Practices: Improving Code Quality

Towards the re-usability of software metric definitions at the meta level

Measuring the quality of UML Designs

Principal Component Analysis of Lack of Cohesion in Methods (LCOM) metrics

Using Metrics To Manage Software Risks. 1. Introduction 2. Software Metrics 3. Case Study: Measuring Maintainability 4. Metrics and Quality

Effectiveness of software metrics for object-oriented system

JOURNAL OF OBJECT TECHNOLOGY

Visualizing Software Metrics for increased Refactoring

Towards Cohesion-based Metrics as Early Quality Indicators of Faulty Classes and Components

Risk-based Object Oriented Testing

APPLICATION OF ARTIFICIAL NEURAL NETWORKS FOR ASSESSING THE TESTABILITY OF OBJECT ORIENTED SOFTWARE

An Empirical and Analytical View of New Inheritance Metric for Object-Oriented Design

Mixing SNA and Classical Software Metrics for Sub-Projects Analysis.

Spring Framework. Christoph Pickl

Metrics in assessing the quality and evolution of jedit

Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum

Analysis of Various Software Metrics Used To Detect Bad Smells

Toward a definition of run-time object-oriented metrics

Quality Metrics Tool for Object Oriented Programming

Comparing The Accumulation Of Technical Debt Between Two Applications Developed With Spring Web MVC And Apache Struts 2

Embrace Factories Factories. By Rob Gonda

Analysis of Reusability of Object-Oriented System using CK Metrics

Design and code coupling assessment based on defects prediction. Part 1

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

2IS55 Software Evolution. Software metrics (2) Alexander Serebrenik

Inyección de Dependencias en el Lenguaje de Programación Go

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

Vragen. Intra-modular complexity measures. The uses relation. System structure: inter-module complexity

SOFTWARE ASSESSMENT USING OBJECT METRICS

Similar Characteristics of Internal Software Quality Attributes for Object-Oriented Open-Source Software Projects

Software Quality Estimation through Object Oriented Design Metrics

JOURNAL OF OBJECT TECHNOLOGY

Introduction to software metics

Influence of Design Patterns Application on Quality of IT Solutions

An Empirical Study into Class Testability 1

Quantify the project. Better Estimates. Resolve Software crises

Importance of Software Metrics to Quantify of Software Design and Source Code Quality

Enhancing Object Oriented Coupling Metrics w.r.t. Connectivity Patterns

ACICE-2013 ISSN: ; e-issn

2IS55 Software Evolution. Software metrics (3) Alexander Serebrenik

An Empirical Study on Object-Oriented Metrics

EVALUATING IMPACT OF INHERITANCE ON OBJECT ORIENTED SOFTWARE METRICS

An inheritance complexity metric for object-oriented code: A cognitive approach

CODE GENERATION IN JAVA

ISSN: [Gupta* et al., 6(5): May, 2017] Impact Factor: 4.116

A Friend in Need is a Friend Indeed

Tool support for software metrics calculation of Java projects

Chidamber and Kemerer Object-Oriented Measures: Analysis of their Design from the Metrology Perspective

JOURNAL OF OBJECT TECHNOLOGY

Analyzing Java Software by Combining Metrics and Program Visualization

Empirical Analysis of the Reusability of Object-Oriented Program Code in Open-Source Software

Utilizing Computational Intelligence to Assist in Software Release Decision

Can Complexity, Coupling, and Cohesion Metrics be Used as Early Indicators of Vulnerabilities?

Execution Trace Streaming based Real Time Collection of Dynamic Metrics using PaaS

Class Cohesion Revisited: An Empirical Study on Industrial Systems

An Investigation into Coupling Measures for C++

Research Article An Empirical Study of the Effect of Power Law Distribution on the Interpretation of OO Metrics

Class Inheritance Metrics-An Analytical and Empirical Approach

A VALIDATION OF OBJECT-ORIENTED DESIGN METRICS AS QUALITY INDICATORS*

Fault Prediction OO Systems Using the Conceptual Cohesion of Classes

An exploratory investigation on the invasiveness of environmental modeling frameworks

SERG. Using Source Code Metrics to Predict Change-Prone Java Interfaces

Measuring Complexity

Software Design & Evolution. Lecture 04. You cannot control what you cannot measure. Metrics & Problem Detection. Michele Lanza

Investigating the Relationship Between Violations of the Law of Demeter and Software Maintainability

Moonzoo Kim CS Division of EECS Dept.

On the Application of Software Metrics to UML Models

Transcription:

Effects of Dependency Injection on Maintainability Kate Razina

Overview Introduction Maintainability Dependency Injection Hypothesis Research Measuring Maintainability Data Collection Results Conclusion Future Work

Maintainability Definition The ease with which a software system or component can be modified. Modifications may include extensions, porting to different computing systems or improvements 1 Maintainability Most time consuming part of software life cycle 65% to 75% of total time 2 1. M. Mari and N. Eila. The impact of maintainability on component-based software systems. In Euromicro Conference, pages 25 32, 2003. 2. S. Muthanna, K. Konotogiannis, K. Ponnambalam, and B. Stacey. A maintainability model for industrial software systems using design level metrics. In Seventh Working Conference on Reverse Engineering, pages 248 256, November 2000.

Dependency Injection No Dependency Injection Dependency Injection

Dependency Injection No Dependency Injection Dependency Injection

Dependency Injection (IOC) Types Constructor Setter Used in Spring framework

Dependency Injection XML File (Constructor Injection) <?xml version= 1.0 encoding= UTF-8?> <!DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN http://www.springframework.org/dtd/spring-beans.dtd > <beans> <bean id= activityhw class= student.doinghw /> <bean id= student class = student.mastersstudent > < constructor-arg> <ref bean= activityhw /> </constructor-arg> < /bean > <beans>

Dependency Injection Java File (Constructor Injection) public class MastersStudent implements Student{ } private Activity activity; public MastersStudent(Activity activity){ } this.activity = activity;

Why Use Dependency Injection? Container is provided, configured with an XML file A MastersStudent can do any activity with a slight change of the XML file We can test MastersStudent without subsequently testing the implementation of Activity Responsibility for coordination collaboration between objects is transferred away from the objects themselves

Why Use Dependency Injection? Coupling between objects is reduced or is it? Decoupled, testable, easy to maintain 3 Couplings become more configurable and flexible. 3. Walls, Craig. Spring in Action. Manning, 2005.

Hypothesis The pattern of dependency injection significantly reduces dependencies between classes in a piece of software, therefore making the software more maintainable.

How Do We Measure Maintainability? Single Metric Measures Cohesion (LCOM) Coupling CBO 3 RFC 4

How Do We Measure Maintainability? Lower coupling Improved maintainability Decreases interdependencies between modules 4 The higher the coupling between modules, the more difficult the modules are to understand, change, and correct 5, 6 4. M. Dagpinar and J. H. Jahnke. Predicting maintainability with object oriented metrics -an empirical comparison. In 10th Working Conference on Reverse Engineering, 2003. 5. L. Briand, J. Daly, and J. Wust. A unified framework for cohesion measurement in object oriented systems. Empirical Software Engineering: An International Journal, 3(1):65 117, March 1998. 6. R.W. Selby and V.R. Basili. Analyzing Error-Prone Systems Structure. IEEE Trans. Software Eng. Vol. 17, no. 2, pp. 141-152.

Data Collection Spring Framework Project Collection Sourceforge.net 40 projects

Data Collection CKJM Tool Metrics CBO, RFC, LCOM Weighted Methods per Class (WMC) Depth of Inheritance Tree (DIT) Number of Children (NOC) Number of DIs Metric Measure to what extent each Spring project uses dependency injection

Data Collection Analysis 2 Sample t-test p-value <= 0.05

Results T-Test CBO RFC WMC DIT LCOM CE Spring 5 6 5 5 4 7 Non- Spring 6 7 7 3 5 4

Results T-Test

Results No obvious correlation exists between the presence of dependency injection and the Chidamber and Kemmerer metrics. Examine CBO & RFC results closely Correlation between lower average CBO/higher DI percentage and vise-versa Correlation between lower average RFC/higher DI percentage and visa-versa

Results Spring Non- Spring CBO 5 6

Conclusion Hypothesis: The pattern of dependency injection significantly reduces dependencies between classes in a piece of software, therefore making the software more maintainable. Results: No obvious correlation exists between the presence of dependency injection and average CBO and RFC We cannot say that using dependency injection will lower coupling and therefore reduce maintainability Correlation between lower average CBO/higher DI percentage and vise-versa Correlation between lower average RFC/higher DI percentage and visa-versa

Future Work Study coupling more Ideal percentage of DI Burden of maintenance now includes xml code as well as java code DI / CBO metric

Questions?