Elsevier

Journal of Systems and Software

Volume 121, November 2016, Pages 298-310
Journal of Systems and Software

Using indirect coupling metrics to predict package maintainability and testability

https://doi.org/10.1016/j.jss.2016.02.024Get rights and content

Highlights

  • We developed the metrics based on Martin's principles and indirect responsibility.

  • The new developed indirect coupling metrics are tested and validated.

  • The experimental study includes seven large well-known open source systems.

  • The new metrics are highly correlated to maintenance and testing effort.

  • The metrics can in early design help predict maintenance and testing effort.

Abstract

Object-oriented systems are dynamic and have to be constantly maintained, or they become aged and irrelevant. Many costly software issues exist due to poorly designed systems and due to systems which are not easy to test or maintain because of poor designs. Martin's metrics (Martin, 2003) are well-known package design metrics that can be used in early stages of software development. However, since Martin's metrics only measure direct coupling, the authors believe that this limits their accuracy. In previous papers (Almugrin et al., 2014; Almugrin and Melton), we began with Martin's principles and used them to modify his coupling, instability and abstractness metrics based on direct and indirect coupling, respectively. In this paper, we present an experimental study to validate the modified global metrics by showing their relationship to maintainability and testability, and then we construct prediction models for these two external quality attributes. The study results indicate that the new metrics are very promising and lead to improved results.

Introduction

Many software metrics can only be applied to software implementation (code) and, thus, can only be applied after the product is developed or nearly developed. It is recognized that mistakes committed and poor choices made during the design phase often result in the most costly and inflexible problems (Boehm, 1981). Hence, not detecting a design failure until the later stages of the life cycle can decrease quality including negatively affecting maintainability and testability. Good software design in the software development process is one of the most important and key activities in the system development life cycle and is vital for the successful implementation of software systems that are both maintainable and testable. It involves comparing design choices and finding alternatives and choosing the best choice. Choosing one of the alternatives without immediate feedback is very difficult since there is no or little knowledge about its consequences. It would be much easier for the designer if there were objective measures that could help him/her to pinpoint strengths and weaknesses of every choice. Therefore, applying design metrics should be an integral part of the software development process.

In addition, software systems and, especially, object-oriented systems are dynamic and evolve over time. When a software system is first built, it may seem that all requirements are met and that the system is working effectively and efficiently. However, requirements change with time, and systems must be updated to meet these changes. As a result, software measurement can directly and significantly influence the quality of software management. As stated by Lehman (Lehman, 1996), object-oriented systems have to be continuously updated or they may become outdated and irrelevant. Two of Lehman's laws (Lehman, 1980, Lehman, 1996, Lehman et al., 1997) state that software must continuously evolve to stay useful and that this evolution is accompanied by an increase in complexity. Therefore, these systems become difficult to analyze and maintain, and most of the cost during a software system lifecycle is dedicated to supporting its evolution (Erlikh, 2000). Object-oriented software systems evolve over time with the modification, addition and removal of new packages, classes, methods, functions, and dependencies. Therefore, the class and package dependency management is very challenging. It is clearly important to understand, assess, and manage the static structure of the software system. Classes and packages and their relationships are the most significant parts of the static structure of the software system.

The quality of the software design has a significant impact on software maintainability, which can make design level metrics beneficial predictors for software maintenance (Madhwaraj and Chitra Babu, 2011). Maintainability refers to the ease of maintaining software in order to prevent or correct defects and their causes, and to respond to new requirements and environmental changes (Jay and Mayer, 1990). Software testability is defined as: “attributes of software that bear on the effort needed to validate the software product.” (Badri et al., 2010). Both software maintainability and software testability are related to effort reduction and software quality (Gao and Shih, 2005). Their importance may significantly increase with large systems. The lack of maintainability and testability can be difficult and expensive to repair if detected late, for example, after the coding phase (Gao and Shih, 2005), which can contribute to considerably more effort. This works as a good motivation for us to focus on software maintainability and testability.

Software maintainability and software testability cannot be measured only with respect to software artifacts (Fenton and Pfleeger, 1998, Al Dallal, 2013), i.e., maintainability depends on many factors such as software environment, package design, experience of the maintenance team, and the age of the system (Al Dallal, 2013). The external attributes, e.g., maintainability, cannot be known before it is measured, i.e., it has been maintained. However, the maintainability and testability can be predicted by using software metrics, e.g., coupling, as indicators.

Many researchers have proposed software metrics in relation to software maintainability and its characteristics. Some research studies were conducted to investigate the relationship between coupling and software maintainability. One of the early studies by Li and Henry, (1993) showed that object-oriented metrics can predict software maintenance efforts. Briand et al., (1993) proposed a coupling measure based on object-oriented design principles to evaluate software maintainability. Dagpinar and Jahnke, (2003) provided empirical evidence that software metrics can effectively be used to predict software maintainability. Atole and Kale, (2006) applied Martin's design metrics on a software design example and found that the design metric has the ability to evaluate the software design quality. Al Dallal, (2013) empirically examined the relationship between coupling and maintainability. The results support that coupling has an impact on maintainability. These studies along with the importance of maintainability and testability in cost and time reductions as well as the availability of the maintenance and testing data for the open source systems motivated the authors to study coupling metrics which can, to some extent, predict maintainability and testability.

Most researchers have measured only direct package dependency that is, coupling between packages that have some direct dependency relationship. There has been comparatively little study about indirect package dependency that is, coupling between packages that have no direct dependency relationship. Briand et al., (1999) discussed thirty coupling metrics of which only two metrics measure some form of indirect coupling. They stated that “To account for indirect coupling, we need only use the transitive closure of that relation.” However, these transitive closures need to be studied and understood. Indirect package coupling is a special form of coupling that can manifest itself between two seemingly unrelated packages through a path of direct dependency relationships. For instance, ripple effect is one of the most significant maintenance problems that cannot be solved properly without considering indirect package coupling. Ripple effect is a situation when one modification causes a cascading effect on the dependent entities (packages) along the dependency relationship path. The longer the transitive dependencies the more challenging it is to keep the changes consistent without mistakes.

In large object-oriented software architectures, we need to have an easy way to assess the packaging of the system and help the maintainers to manage it by detecting undesirable package dependencies which could help create structural problems. Object-oriented design principles help in the designing, building, and maintaining of robust, maintainable, and testable software systems. Following these principles during all software phases can help assure software effectiveness, and, also, software measurements which are based on these principles can be helpful in ensuring that the principles are followed. Our work was originally inspired by Martin's seminal work (Martin, 2003) in packaging of object-oriented software, and in (Almugrin et al., 2014) we enhanced Martin's metrics by introducing the responsibility factor that had not been previously used in definitions of these metrics. The responsibility of the package represents the potential difficulty in changing it because a modification of it may lead to subsequent changes to its clients or even a refactoring. The responsibility of a package may be measured based on how many services this package is providing for the other packages which depend on it.

However, Martin's metrics and the newly developed metrics only measure direct coupling. The authors believe that this limitation decreases theses metrics’ accuracy and can be misleading because it is a purely local measure. We call it a local measure because it is not able to include all the dependency relationships, and hence, the total instability of a package will not be measured.

We proposed in (Almugrin and Melton, 2015) an approach that manages packaging in object-oriented software development by analyzing all dependencies of all packages. Our approach relies therefore on packages, classes and direct as well as indirect dependencies.

The rest of this paper is organized as follows. In Section 2, we present related work, including details about Martin's metrics. Section 3 presents the need for indirect metrics. Software maintainability and testability and how to measure them will be discussed in Section 4. Section 5 describes the design of the conducted study, while Section 6 reports its results. Threats to validity are presented in Section 7. We discuss future work and close with conclusions in Section 8.

Section snippets

Related work

Many object-oriented metrics have been suggested in literature (Bocco et al., 2005). One of the best known object-oriented metric suites was presented by Chidamber and Kemerer, 1994, Chidamber and Kemerer, 1991). Their metrics suite is composed of six metrics that evaluate class cohesion, coupling, inheritance and complexity. They enriched the definition of some of these metrics in (Izurieta and Bieman, April 2008). Several studies were conducted to validate Chidamber and Kemerer metrics (

The need for indirect metrics

The afferent couplings (Ca), also called the import links, define the package's responsibility while the efferent couplings (Ce), also called export links, represent the dependency of the package. The more clients a package has the more difficult the change will likely be. A responsible package is difficult to change because a modification of it may lead to subsequent changes or even a refactoring. On the other hand, any change applied to any provider package (server) may ripple up to its

Maintainability

Software maintenance is one of the most challenging and costly parts in the software life-cycle (Boehm, Jan. 1984). Maintainability is defined in (ISO/IEC Standard 9126 1991) as “The ease with which a software system or component can be modified to correct faults, improve performance or other attributes, or adapt to a changed environment.” Accordingly, package maintainability is the probability that a package can be easily modified. During the development of the software, it is difficult to

Experimental design

This research studies the relationship between the newly developed metrics of package coupling and the maintenance and testing efforts. Also, this research will assess the capability of these metrics to predict the two software quality characteristics, maintainability and testability. Thus, we are assessing whether these metrics can predict the required amount of effort needed for maintaining and testing a package. This experiment also aims to evaluate the new metrics and compare them to

Empirical analysis and results

Data screening and evaluation of linearity for assessing correlations and regression analysis led us to use the natural log transformation for the following variables: number of revisions (REVISION), package size (number of classes in a package) and number of revised lines of code (RLOC). Martin's package metric suite is included in the list of variables for the purpose of comparison.

Threats to validity

In this section, we examine the threats to the validity of this study. Validity of any empirical study can be threatened in different ways. The main validity threat in any study of an external quality software attribute usually lies in how to quantify this attribute. As for the dependent variables used in our study, we have selected indicators whose validity has already been investigated in the literature. In this study, a package maintenance effort is measured as the number of changes made to

Conclusion and future work

In this paper, the newly developed coupling, instability and abstractness metrics, which are based on Martin's principles and on indirect responsibility, are tested and validated. We give an explicit formula for each metric. The results produced by these metrics are highly correlated to maintainability and testability. For validation purposes, the new metrics have been applied to seven well-known open source systems: Camel 2.0.0, Tomcat 7.0.6, JHotDraw 7.5.1, JEdit 4.5.0, Hadoop 2.2.0, Synapse

Dr. Saleh Almugrin received his Ph.D. from Kent State University- the Departments of Computer Science and Mathematical Sciences. Dr. Almugrin is currently working as e-Transaction director in Saudi Ministry of Defense. His research areas include software evolution, software measurement theory, software engineering, information security, and data mining. Additionally, he has more than eighteen years of experience in the academia as well as in the private and public sectors.

References (60)

  • BadriLinda et al.

    Exploring empirically the relationship between lack of cohesion and testability in object-oriented systems

    Advances in Software Engineering

    (2010)
  • V.R. Basili et al.

    A validation of object- oriented design metrics as quality indicators

    IEEE Trans. Softw. Eng.

    (1996)
  • M.G. Bocco et al.

    A survey of metrics for UML class diagrams

    J. Object Technol.

    (2005)
  • BoehmB.

    Software Engineering Economics

    (1981)
  • BoehmB.W.

    Software engineering economics

  • BoochG

    Object Oriented Analysis and Design with Applications

    (1994)
  • L.C. Briand, J.W. Daly, V. Porter, and J. Wust, A Comprehensive Empirical Validation of Product Measures for OO...
  • BriandL.C. et al.

    A unified framework for cohesion Measurement in object-oriented systems

    Empir. Softw. Eng.

    (1998)
  • L.C. Briand et al.

    A unified framework for coupling measurement in object-oriented systems

    IEEE Trans. Softw. Eng.

    (1999)
  • L.C. Briand et al.

    Investigation of quality factors in object-oriented designs: an industrial case study

  • BriandLionel C. et al.

    Measuring and assessing maintainability at the end of high level design

  • Champaign, J.C., “An Empirical Study of Software Packaging Stability", Master's thesis, University of Waterloo,...
  • S. Chen et al.

    Ripple effect in SDL specification

  • S. Chidamber et al.

    Towards a metrics suite for object oriented design

  • S. Chidamber et al.

    A metrics suite for object oriented design

    IEEE Trans. Softw. Eng.

    (1994)
  • M. Dagpinar et al.

    Predicting Maintainability with OO Metrics – an empirical comparison

  • M. Dagpinar et al.

    Predicting maintainability with object-oriented metrics – an empirical comparison

  • J. Daly et al.

    An empirical study evaluating depth of inheritance on maintainability of object- oriented software

    Empir. Softw. Eng.

    (1996)
  • S. Ducasse et al.

    Butterflies: A visual approach to characterize packages

  • L. Erlikh

    Leveraging legacy system dollars for e-business

    IT Prof.

    (2000)
  • Cited by (46)

    • On measuring coupling between microservices

      2023, Journal of Systems and Software
    • Package-Level stability evaluation of object-oriented systems

      2019, Information and Software Technology
      Citation Excerpt :

      This method is widely applied by many studies [64,65] for prediction in software engineering. Almugrin et al. [65] used linear regression to predict package maintainability and testability. In linear regression, we use independent variables to explain and predict the dependent variable.

    View all citing articles on Scopus

    Dr. Saleh Almugrin received his Ph.D. from Kent State University- the Departments of Computer Science and Mathematical Sciences. Dr. Almugrin is currently working as e-Transaction director in Saudi Ministry of Defense. His research areas include software evolution, software measurement theory, software engineering, information security, and data mining. Additionally, he has more than eighteen years of experience in the academia as well as in the private and public sectors.

    Dr. Waleed Albattah received his Ph.D. from Kent State University on 2014. Dr. Albattah is an Assistant Professor at Information Technology Department, Qassim University. His research interests are: Software Evolution and Maintenance, Software Measurements, Software Design and Agile Software development, Package-level and Class-level Cohesion, and Software Quality.

    Dr. Austin Melton received his Ph.D. from Kansas State University in 1980. Dr. Melton is Professor for the Departments of Computer Science and Mathematical Sciences. His research areas include formal semantics, the semantic web, software measurement theory, software engineering, security, lattice theory, fuzzy mathematics, Galois connections, and category theory. Lately, he has co-organized the Symposia on Fuzzy Mathematics, hosted by Kent State University and Youngstown State University.

    View full text