Skip to main content
Log in

Measuring class cohesion based on dependence analysis

  • Software Engineering
  • Published:
Journal of Computer Science and Technology Aims and scope Submit manuscript

Abstract

Classes are the basic modules in object-oriented (OO) software, which consist of attributes and methods. Thus, in OO environment, the cohesion is mainly about the tightness of the attributes and methods of classes. This paper discusses the relationships between attributes and attributes, attributes and methods, methods and methods of a class based on dependence analysis. Then the paper presents methods to compute these dependencies. Based on these, the paper proposes a method to measure the class cohesion, which satisfies the properties that a good measurement should have. The approach overcomes the limitations of previous class cohesion measures, which consider only one or two of the three relationships in a class.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Allen E B, Khoshgoftaar T M. Measuring coupling and cohesion: An information-theory approach. InProc. the Sixth International Software Metrics Symposium, Florida, USA, 1999, pp.119–127.

  2. Briand L Cet al. Property-based software engineering measurement.IEEE Trans. Software Engineering, Jan. 1996, 22(1): 68–85.

    Article  Google Scholar 

  3. Briand L C, Daly J, Wuest J. A unified framework for cohesion measurement in object-oriented systems.Empirical Software Engineering, 1998, 3(1): 65–117.

    Article  Google Scholar 

  4. Bansiya J Let al. A class cohesion metric for object-oriented designs.Journal of Object-Oriented Programming, 1999, 11(8): 47–52.

    Google Scholar 

  5. Briand L Cet al. Defining and validating measures for object-based high-level design.IEEE Trans. Software Engineering, 1999, 25(5): 722–743.

    Article  Google Scholar 

  6. Chae H S, Kwon Y R, Bae D H. A cohesion measure for object-oriented classes.Software Practice & Experimence, 2000, 30(12): 1405–1431.

    Article  MATH  Google Scholar 

  7. Chae H S, Kwon Y R. A cohesion measure for classes in object-oriented systems. InProc. the Fifth International Software Metrics Symposium, Bethesda, MD, USA, 1998, pp.158–166.

  8. Chidamber S R, Kemerer C F. A metrics suite for object-oriented design.IEEE Trans. Software Engineering, 1994, 20(6): 476–493.

    Article  Google Scholar 

  9. Hitz M, Montazeri B. Measuring coupling and cohesion in object-oriented systems. InProc. International Symposium on Applied Corporate Computing, Monterrey, Mexico, October 1995, pp.25–27.

  10. Xu B, Zhou Y. Comments on a cohesion measure for object-oriented classes by Heung Seok Chae, Yong Rae Kwon and Doo Hwan Bae.Software Practice and Experience, 2001, 31(14): 1381–1388.

    Article  Google Scholar 

  11. Zhou Y, Guan Y, Xu B. On revising Chae's cohesion measure for classes.J. Software, 2001, 12 (Suppl.): 295–300.

    Google Scholar 

  12. Chen Z, Xu B, Yang H. Silicing tagged objects in Ada 95.LNCS 2043, 2001, pp.100–112.

  13. Chen Z, Xu B, Slicing object-oriented Java programs.ACM SIGPLAN Notices, 2001, 36(4): 33–40.

    Article  Google Scholar 

  14. Horwitz Set al. Inter-procedural slicing using dependence graphs.ACM Trans. Programming Languages and Systems, 1990, 12(1): 26–60.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Bao-Wen Xu.

Additional information

Supported by the National Natural Science Foundation of China under Grant No.60073012; the National Basic Research 973 Program of China under Grant No.2002CB312000; the Program for Cross-Century Outstanding Teachers of the Ministry of Education; the National Research Foundation for the Doctoral Program of Higher Education of China under Grant No.20020286004; the Natural Science Foundation of Jiangsu, China, under Grant No.BK2001004; the Jiangsu Key Science and Technology Project under Grant No.BE2001025; the Opening Foundation of State Key Laboratory of Software Engineering in Wuhan University; the Opening Foundation of Jiangsu Key Laboratory of Computer Information Processing Technology in Soochow University.

Zheng-Qiang Chen was born in 1976. He received the M.S. and Ph.D. degrees in computer science in 2000 and 2003, respectively. His current research interests include program analysis, understanding and testing as well as other topics related to reverse engineering. He has published more than 30 technical papers.

Bao-Wen Xu was born in 1961. He received the M.S. and Ph.D. degrees in computer science in 1984 and 2002, respectively. He is a professor in the Computer Science & Engineering Department of Southeast University, Nanjing, China. His current research interests include programming language, program analysis, understanding, metrics and testing, Web search engine, and other topics related to reverse engineering. He has published more than 200 technical papers and 10 books. He is General Chairs of IEEE FTDCS'2004 and ICYCS'99, PC Chairs of WISA'2004 and WEBSA'2003, PC Members of IEEE COMPSAC'2003,'2002 and '2001, IEEE ICTAI'2003 and IEEE IRI'2003, and Session Chairs of IEEE ICTAI'2003 and COMPSAC'2002.

Yu-Ming Zhou was born in 1974. He received the M.S. and Ph.D. degrees in computer science in 1999 and 2003, respectively. His current research interests include program analysis and metrics. He has published more than 20 technical papers.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Chen, ZQ., Xu, BW. & Zhou, YM. Measuring class cohesion based on dependence analysis. J. Comput. Sci. & Technol. 19, 859–866 (2004). https://doi.org/10.1007/BF02973449

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF02973449

Keywords

Navigation