skip to main content
10.1145/1185448.1185469acmotherconferencesArticle/Chapter ViewAbstractPublication Pagesacm-seConference Proceedingsconference-collections
Article

Metrics for class cohesion and similarity between methods

Published: 10 March 2006 Publication History

Abstract

Class cohesion is one of the desirable properties in object oriented designs. But, designers and managers need a good metric for this property to help them evaluate, compare and choose among various possible solutions to a given problem. In this paper, we will present a new metric for class cohesion based on similarity between the methods of a class. Cohesion metrics developed in previous researches have made vital contributions in the area; however, they are subject to some criticisms. This research is based on the same theoretical foundations and addresses some of the drawbacks in previous works. The theory behind similarity of methods is discussed, and then the notion is used to develop a metric for the degree of similarity between a pair of methods in a class. This metric will be extended further to develop a new metric for class cohesion. Next, the developed cohesion metric is evaluated with Weyuker's set of properties for measurement followed by use of the metrics with some empirical data from a small application developed for student class project along with data collection tool for computing the metrics. Our empirical validation deals with specific examples of classes to show that the new metric is more powerful than LCOM, one of the basic metrics for lack of cohesion in class, and CAMC, another metric for class cohesion. Moreover, it shows how the new metric reflects the intuition of class cohesion and discriminates against classes for which these metrics consider equally cohesive or non-cohesive.

References

[1]
Badri, Linda and Badri, Mourad, "A New Class Cohesion Criterion: An Empirical Study on Several Systems", Département de mathématiques et d'informatiqueUniversité du Québec à Trois-Rivières, C.P. 500, Trois-Rivières, Québec, Canada, G9A 5H7.
[2]
Bansiya, Jagdish and Davis, Carl, "Class Cohesion Metrics for Object Oriented Designs", Object Oriented Programming, vol. 11, No. 8.
[3]
Basiniya, Jagdish and Davis, Carl, "A Hierarchical Model for Object-Oriented Design Quality Assessment", IEEE Transactions on Software Engineering, vol. 28, no. 1, January 2002.
[4]
Chidamber, Shyam R. and Kemerer, Chris F., "A Metrics Suite for Object Oriented Design", IEEE Transactions on Software Engineering, vol. 20, no. 6, June 1994.
[5]
Kan, Stephen H., Metrics and Models in Software Quality Engineering, 2nd Edition, Pearson Education, Inc., 2003.
[6]
Weyuker, J. Elaine, "Evaluating Software Complexity Measures", IEEE Transactions on Software Engineering, vol. 14, no. 9, September 1988.

Cited By

View all
  • (2024)Exploring the Impact of Alternatives of Object-Oriented Cohesion Measures on Machine Learning-Based Predictions of Inheritance ReusabilityIEEE Access10.1109/ACCESS.2024.348400712(159252-159266)Online publication date: 2024
  • (2023)Empirical Exploration of the Relationship Between Coupling and Method Interaction-Based Cohesion Measures for Object-Oriented Classes2023 Computer Applications & Technological Solutions (CATS)10.1109/CATS58046.2023.10424366(1-5)Online publication date: 29-Oct-2023
  • (2023)Investigating the Relationship Between Cohesion and Inheritance Quality Attributes Empirically2023 Computer Applications & Technological Solutions (CATS)10.1109/CATS58046.2023.10424161(1-5)Online publication date: 29-Oct-2023
  • Show More Cited By

Index Terms

  1. Metrics for class cohesion and similarity between methods

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    ACMSE '06: Proceedings of the 44th annual ACM Southeast Conference
    March 2006
    823 pages
    ISBN:1595933158
    DOI:10.1145/1185448
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 10 March 2006

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. classes
    2. cohesion
    3. complexity
    4. methods
    5. metrics
    6. similarity

    Qualifiers

    • Article

    Conference

    ACM SE06
    ACM SE06: ACM Southeast Regional Conference
    March 10 - 12, 2006
    Florida, Melbourne

    Acceptance Rates

    ACMSE '06 Paper Acceptance Rate 100 of 244 submissions, 41%;
    Overall Acceptance Rate 502 of 1,023 submissions, 49%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)17
    • Downloads (Last 6 weeks)2
    Reflects downloads up to 30 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Exploring the Impact of Alternatives of Object-Oriented Cohesion Measures on Machine Learning-Based Predictions of Inheritance ReusabilityIEEE Access10.1109/ACCESS.2024.348400712(159252-159266)Online publication date: 2024
    • (2023)Empirical Exploration of the Relationship Between Coupling and Method Interaction-Based Cohesion Measures for Object-Oriented Classes2023 Computer Applications & Technological Solutions (CATS)10.1109/CATS58046.2023.10424366(1-5)Online publication date: 29-Oct-2023
    • (2023)Investigating the Relationship Between Cohesion and Inheritance Quality Attributes Empirically2023 Computer Applications & Technological Solutions (CATS)10.1109/CATS58046.2023.10424161(1-5)Online publication date: 29-Oct-2023
    • (2023)Machine Learning-Based Exploration of the Impact of Move Method Refactoring on Object-Oriented Software Quality AttributesArabian Journal for Science and Engineering10.1007/s13369-023-08174-049:3(3867-3885)Online publication date: 21-Aug-2023
    • (2022)Extract Class Refactoring Based on Cohesion and Coupling: A Greedy ApproachComputers10.3390/computers1108012311:8(123)Online publication date: 16-Aug-2022
    • (2021)A Network of Object-Oriented Software Metrics’ Parameters2021 IEEE International Conference on Communication, Networks and Satellite (COMNETSAT)10.1109/COMNETSAT53002.2021.9530822(172-178)Online publication date: 17-Jul-2021
    • (2020)An Approach to Automatically Measure and Visualize Class Cohesion in Object-Oriented Systems2020 International Conference on Decision Aid Sciences and Application (DASA)10.1109/DASA51403.2020.9317140(1174-1179)Online publication date: 8-Nov-2020
    • (2020)Measuring Class Cohesion Based on Client Similarities Between Method Pairs: An Improved Approach That Supports RefactoringIEEE Access10.1109/ACCESS.2020.30461098(227901-227914)Online publication date: 2020
    • (2019)Sensitivity and Monotonicity in Class Cohesion MetricsProceedings of the 12th Innovations in Software Engineering Conference (formerly known as India Software Engineering Conference)10.1145/3299771.3299794(1-5)Online publication date: 14-Feb-2019
    • (2019)Measuring Class Cohesion Using Internal and External Class RelationshipsInternational Journal of Software Engineering and Knowledge Engineering10.1142/S021819401950032329:07(971-996)Online publication date: 6-Aug-2019
    • Show More Cited By

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media