An aggregated coupling measure for the analysis of object-oriented software systems

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

Highlights

  • A new aggregated coupling measure for OO systems is introduced.

  • It expresses both structural and conceptual characteristics of coupling.

  • Experiments confirms a good performance compared to classical coupling measures.

Abstract

Coupling is a fundamental property of software systems which is strongly connected with the quality of software design and has high impact on program understanding. The coupling between software components influences software maintenance and evolution as well. In order to ease the maintenance and evolution processes it is essential to estimate the impact of changes made in the software system, coupling indicating such a possible impact. This paper introduces a new aggregated coupling measurement which captures both the structural and the conceptual characteristics of coupling between the software components. The proposed measure combines the textual information contained in the source code with the structural relationships between software components. We conduct several experiments which underline that the proposed aggregated coupling measure reveals new characteristics of coupling and is also effective for change impact analysis.

Introduction

It is well-known that cohesion and coupling are software properties which are highly connected with the quality of a software design. Generally, a good object-oriented design is characterized by the principle of low coupling and high cohesion, being known that the main symptom for badly-structured systems is the violation of the rule “Put together what belong together”. The internal structure of a software is often changed during its lifecycle, having a major impact on the system’s evolution. Inaccurate implementations for the newly added functional requirements lead to structure deterioration and a more difficult and expensive maintenance. Therefore, for assuring a facile and efficient software maintenance and evolution, it is essential for the developers to clearly estimate the impact of the changes they made in the software. One method for understanding such impact is to assess the coupling between different software components (Poshyvanyk et al., 2009).

Coupling is considered an important factor in software maintenance. Independent modules are easier to change, extend and fix as, in their case, the impact of an eventual change is smaller. All forms of coupling are generally viewed in the literature as having a negative impact on maintainability (Stevens et al., 1974). Direct coupling is one category of coupling, usually easily determined using static source code analysis. But there are other forms of coupling identified in the literature: indirect coupling (Yang et al., 2005) and hidden dependencies (Yu and Rajlich, 2001) with similar negative effect on software maintainability.

Several coupling measurements were introduced in the software engineering literature for expressing the degree to which different parts of a software system are related. Among these, the class of structural coupling (Ajienka and Capiluppi, 2017) contains software metrics (Aez-Varela et al., 2017) which measure the connection between software entities (classes, methods, attributes) (Bavota et al., 2013), while the category of conceptual coupling measures the conceptual relation between the identifiers and comments from different application classes (Poshyvanyk et al., 2009). Other coupling types defined in the literature are dynamic coupling, which takes into consideration connections that appear during the execution of the program and logical coupling which considers entities that are changed together (Bavota et al., 2013). While most of the existing coupling measures belong to the class of structural coupling measures and these are the most often used, the other ones were introduced because researchers considered that there are important relations which are not captured by structural coupling measures. Bavota et al. performed an experiment to determine how different the relations captured by these four coupling types are and how much are they correlated to the strength of the couplings perceived by software developers (Bavota et al., 2013). They concluded that connections identified by logical and dynamic coupling are mostly identified by structural or conceptual coupling while these two are complementary (the links identified by them overlap only partially). When comparing the values of the metrics to evaluations of coupling given by software developers, the authors concluded that conceptual measures are the closest to the developer’s perception of coupling (Bavota et al., 2013).

A task of major importance for software developers is to understand dependencies between software components, including those which are hidden. Understanding the existing connections in a software contributes to easing the software maintenance and evolution process. Among the software development related activities which are based on dependencies between software components we mention (Vanciu and Rajlich, 2010): impact analysis (Briand, Wuest, Lounis, 1999, Poshyvanyk, Marcus, Ferenc, Gyimóthy, 2009), change propagation (Rajlich, 1997) and regression testing (White et al., 2008). Coupling metrics have proven to be useful in different software engineering activities, such as: predicting defect proneness (Kirbas et al., 2014), predicting maintainability in service-oriented designs (Perepletchikov et al., 0000), crosscutting concerns identification (Marin, Deursen, Moonen, 2007, Moldovan, Şerban, 2006), software restructuring (Czibula and Serban, 2006), change impact analysis (Poshyvanyk et al., 2009).

A recent study showed that for the problem of software restructuring, using software metrics might not be sufficient. Simons et al. performed an experiment in which they computed the values of several software metrics (which were based on structural connections between the entities) for two software systems and compared them to the evaluation of the quality of those systems given by professionals (Simons et al., 2015). The authors concluded that the values of the metrics are not correlated with the judgment of professionals.

The results of the previously mentioned studies (one presenting that structural metrics might not always capture how software developers think (Simons et al., 2015), and the other presenting that conceptual coupling is the closest to how developers consider coupling) suggest that by combining structural and conceptual metrics we could achieve a measure which can be better, more useful than any of them alone. This is also suggested by the conclusion of a study performed by Kagdi et al., where conceptual and logical (in the paper it was called evolutionary) coupling measures were combined and their combination improved the precision and recall of impact analysis (Kagdi et al., 2010). The combination of different software metrics is encouraged by Harman et al. as well, since software metrics are often used as fitness functions in Search Based Software Engineering and their combination can lead to better fitness functions (Harman et al., 2012).

Sustained by the aforementioned studies from the literature, the idea of combining structural and conceptual coupling metrics seems to be promising, as it is agreed that the structural metrics do not express entirely the conceptual side of coupling and vice versa. Starting from the hypothesis that a coupling measure expressing both the structural and conceptual characteristics of coupling would be, very likely, capable to detect dependencies between software components which cannot be captured using only structural or conceptual coupling, we introduce in this paper a new aggregated coupling measure, ACE, which captures both the structural and the conceptual relationships between the software components. Our assumption will be empirically confirmed in Section 4.2 where an experiment related to software packages remodularization is conducted for highlighting that ACE is able to encapsulate relevant information which is different from the one captured by only structural or conceptual coupling measures.

The ACE measure aggregates a measure which is based on the textual information contained in the source code and a measure which expresses the structural relationship between software components. Experiments will be performed with the main goal of evaluating the extent to which the combination of structural and conceptual coupling into a single aggregated measure is suitable for better expressing the degree to which software entities are related together. We also aim to emphasize that the aggregated measure differs quite significantly from existing structural and conceptual coupling measures and that it can capture multiple aspects of coupling and is more useful than classical coupling measures in software engineering related activities. The proposed ACE measure can be used independently of the programming paradigm in which the analyzed software was developed, even if, in this paper, we are focusing on object-oriented software systems. Several experiments are conducted in order to emphasize the effectiveness of ACE. In the current proposal, ACE expresses a linear combination between structural and conceptual coupling metrics. However, a non-linear relationship may be effective and will be further investigated.

In summary, the major goal of the work conducted in this paper is that of emphasizing the relevance of aggregating structural and conceptual coupling into a single measure ACE, as a proof of concept, by answering the following research questions:

  • RQ1 Is the ACE aggregated coupling measure able to express new aspects of coupling, which are not detected by the existing structural and conceptual coupling measures from the literature?

  • RQ2 To what extent is the ACE measure correlated with existing structural and conceptual coupling measures from the literature?

In addition to addressing RQ1 and RQ2 we also aim to provide a possible application of using ACE measure for an important activity in software maintenance and evolution, that of impact analysis. With this aim the proof of concept considers only two software systems of different sizes for highlighting the potential of ACE for guiding the process of analyzing the impact of changes in software systems. If this stands, the study of using ACE for impact analysis can be further extended on a larger scale. Therefore, research question RQ3 formulated below will be furthermore investigated.

  • RQ3 Would ACE be effective for change impact analysis an how does it compare to similar measures already proposed in the literature for this activity?

The paper is organized as follows. We start by reviewing in Section 2 existing coupling measurements from the literature. Our aggregated coupling measure ACE which expresses the coupling between object-oriented software system components is introduced in Section 3. Section 4 highlights the differences between ACE and other existing coupling measures. The effectiveness of using the proposed ACE measure for change impact analysis is shown in Section 5. The experimental results as well as their analysis are provided in Section 6. Section 7 discusses about the threats to validity that can affect the results of our study. The conclusions of our paper and further research directions are outlined in Section 8.

Section snippets

Coupling measurements

The concept of coupling was introduced by Stevens et al. (1974) in the context of structured design. The main idea of the authors was that if the connections between the software modules are as weak as possible, the software is easier to maintain and evolve since the likelihood of changes and errors propagating to other parts of the system is minimized. The coupling concept was later defined by Chidamber and Kemerer (1991) in the context of object-oriented software systems, where classes

Our proposal of aggregated coupling measure

This section introduces our aggregated coupling measurement which is based on the idea that at least two types of relations exist between software entities (classes, methods, modules, components). The first type of relationships are the so-called structural relations which are based on data and control dependencies (Poshyvanyk et al., 2009), being the ones mostly investigated in the literature. Besides these structural relationships, the software entities which implement the same domain concept

Comparison between ACE and other coupling measurements

In this section, we compare our new aggregated coupling measure ACE with four classical structural coupling measures from the literature (CBO, MPC, DAC, ICH), as well as with the conceptual coupling measure CoCC defined by Poshyvanyk et al. (2009) to measure the conceptual coupling of a class. The experiments will be conducted considering the class level granularity for computing the aggregated coupling measures AC and ACE.

The structural coupling measures which will be used in our comparison

Change impact analysis using AC coupling measure

In this section, we aim to illustrate the usefulness of the introduced AC coupling measure in an important activity related to the software development process, namely change impact analysis. With the major goal of answering our third research question RQ3, we consider several case studies on two open source software system, DbUtils and Apache Collections, to point out that ACE is useful for guiding a software developer during change impact analysis.

Results and discussion

This section presents the experimental results and their analysis, as well as a comparison to related work.

Threats to validity

Our evaluation, as every experimental analysis, may suffer from some threats to validity and biases that can affect the results of our study. There are several issues which may have influenced the obtained results and their analysis.

Threats to internal validity refer to experimental settings and internal parameters which could affect the obtained results. The aggregated coupling measure ACE introduced in this paper depends on a parameter w representing the weight associated to structural

Conclusions and future work

We have introduced in this paper two novel aggregated coupling measurements, AC and ACE, which expresses both structural and conceptual relationships between the software entities. The proposed coupling measures use both the textual information contained in the source code and information about the structural connections between parts of a software. Even if the proposed measures can be used both for procedural and object-oriented software systems, we performed our case studies for

Acknowledgments

The authors would like to thank the editor and the anonymous reviewers for their valuable comments and suggestions which have significantly improved the paper and the presentation.

István Gergely Czibula works as a professor at the Computer Science Department, Faculty of Mathematics and Computer Science from the Babeş-Bolyai University, city of Cluj-Napoca, Romania. He received his Ph.D. degree in Computer Science in 2009. He published more than 90 papers in various journals and conferences proceedings. His main research interests are Software Engineering and object-oriented Design.

References (50)

  • S. Church

    Impact analysis: an essential part of software configuration management

    (2003)
  • Commons, A.,. Collections....
  • L.M. Crivei

    Incremental relational association rule mining of educational data sets

    Studia Universitatis Babes-Bolyai Series Informatica

    (2018)
  • I.G. Czibula et al.

    A software framework for solving combinatorial optimization tasks

    Studia Universitatis Babeş-Bolyai, Informatica LVI

    (2011)
  • I.G. Czibula et al.

    A novel approach using fuzzy self-organizing maps for detecting software faults

    Stud. Inf. Control

    (2016)
  • I.G. Czibula et al.

    Improving systems design using a clustering approach

    Int. J. Comput. Sci. Netw. Secur.

    (2006)
  • DbUtils, C.,...
  • N. Elfelly et al.

    A neural approach of multimodel representation of complex processes

    Int. J. Comput. Commun. Control III

    (2008)
  • M. Harman et al.

    Search based software engineering: techniques, taxonomy, tutorial

    Empirical Software Engineering and Verification

    (2012)
  • H. Kagdi et al.

    Blending conceptual and evolutionary coupling to support change impact analysis in source code

    Proceedings of the 2010 Working Conference on Reverse Engineering

    (2010)
  • S. Kaski et al.

    Exploratory data analysis by the self-organizing map: structures of welfare and poverty in the World

    Neural Networks in Financial Engineering. Proceedings of the Third International Conference on Neural Networks in the Capital Markets, World Scientific

    (1996)
  • S. Kirbas et al.

    The effect of evolutionary coupling on software defects: an industrial case study on a Legacy System

    Proceedings of the 8th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, ESEM ’14, ACM, New York, NY, USA

    (2014)
  • Q.V. Le et al.

    Distributed representations of sentences and documents

    Proceedings of the 31st International Conference on Machine Learning, ICML

    (2014)
  • LeeY.S. et al.

    Measuring the coupling and cohesion of an object-oriented program based on information flow

    Proceedings of the International Conference on Software Quality, Maribor, Slovenia

    (1995)
  • D.C. de Leon et al.

    Hidden implementation dependencies in high assurance and critical computing systems

    IEEE Trans. Softw. Eng.

    (2006)
  • Cited by (11)

    • On measuring coupling between microservices

      2023, Journal of Systems and Software
    View all citing articles on Scopus

    István Gergely Czibula works as a professor at the Computer Science Department, Faculty of Mathematics and Computer Science from the Babeş-Bolyai University, city of Cluj-Napoca, Romania. He received his Ph.D. degree in Computer Science in 2009. He published more than 90 papers in various journals and conferences proceedings. His main research interests are Software Engineering and object-oriented Design.

    Gabriela Czibula works as a professor in the Computer Science Department, Faculty of Mathematics and Computer Science from the Babeş-Bolyai University, city of Cluj-Napoca, Romania. She received her Ph.D. degree in Computer Science in 2003, with the “cum laude” distinction. She published more than 170 papers in prestigious journals and conferences proceedings. Her research interests include artificial intelligence, machine learning, multiagent systems, software engineering.

    Diana-Lucia Miholca is currently a Ph.D. student in the first year of study at the Faculty of Mathematics and Computer Science from the Babeş-Bolyai University, city of Cluj-Napoca, Romania. Her main research interests are Machine Learning and Software Engineering.

    Zsuzsanna Onet-Marian works as a lecturer at the Department of Computer Science, Faculty of Mathematics and Computer Science from the Babeş-Bolyai University, city of Cluj-Napoca, Romania. She published more than 20 papers in prestigious journals and conferences proceedings. Her main research interests are Machine Learning and Software Engineering.

    View full text