Abstract
Maintainability of program parts refers to the ease with which these parts can be modified. Many existing metrics of internal quality attributes such as cohesion, coupling, etc. have been used in this regard. Cohesiveness among program parts is considered as a strong measure for the maintainability of object-oriented components and to predict the probability of being erroneous. Our objective is to propose a novel graph-based cohesion metric to measure the maintainability of different program parts in an object-oriented program and predict their fault proneness. We compute the cohesion of the sliced component as a measure to predict its correctness and preciseness. In addition, we wish to theoretically validate the proposed technique against the existing guidelines of cohesion measurement and compare it with some existing techniques. We propose a new cohesion metric named affected component cohesion (ACCo) to measure the maintainability of different program parts and predict their fault proneness. This metric is based on the hierarchical decomposition slice of an object-oriented program that comprises all the affected program parts. The slices are obtained with respect to some modification made to the program under consideration. It is essential to consider all possible dependence relationships along with the control and data dependences that exist between different program parts of an object-oriented program for a better program comprehension. To represent these dependences, we construct a suitable intermediate graph for an object-oriented program. Then, we compute the slice of the object-oriented program using the intermediate graph to extract the affected program parts. These extracted affected program parts are represented as nodes in the proposed affected slice graph. The critical and sub-critical nodes that require thorough testing are determined by estimating their cohesion measure. The theoretical validation signifies that ACCo satisfies all the existing properties for cohesion measurement. The results obtained are more precise and comparable with other existing approaches. ACCo is a more precise and practical technique to measure the inter-relatedness of affected program parts in an object-oriented program. The discussion on possible threats to its validity demonstrates the scope for improvement of this approach.
Similar content being viewed by others
Notes
Access method is defined only to retrieve or update a data member of the class.
Delegation method is defined to delegate a message to an instance variable through another object.
Constructor is defined to initialize the instance members.
Destructor is defined to deinitialize the instance members.
References
Al Dallal J (2007) Efficient program slicing algorithms for measuring functional cohesion and parallelism. Int J Inf Technol 4(2):93–100
Al Dallal J (2010) Mathematical validation of object-oriented class cohesion metrics. Int J Comput 4(2):45–52
Al Dallal J (2011) Improving object-oriented lack-of-cohesion metric by excluding special methods. In: Proceedings of the 10th WSEAS international conference on software engineering, parallel and distributed systems. World Scientific and Engineering Academy and Society (WSEAS) pp 124–129
Al Dallal J (2011) Transitive-based object-oriented lack-of-cohesion metric. Procedia Comput Sci 3:1581–1587
Al Dallal J (2012) Fault prediction and the discriminative powers of connectivity-based object-oriented class cohesion metrics. Inf Softw Technol 54(4):396–416
Al Dallal J (2012) The impact of accounting for special methods in the measurement of object-oriented class cohesion on refactoring and fault prediction activities. J Syst Softw 85(5):1042–1057
Al Dallal J (2013) Object-oriented class maintainability prediction using internal quality attributes. Inf Softw Technol 55(11):2028–2048
Alomari HW, Collard ML, Maletic JI (2012) A very efficient and scalable forward static approach. In: Reverse Engineering (WCRE), 19th working conference. IEEE, pp 425–434
Alomari HW, Collard ML, Maletic JI, Alhindawi N, Meqdadi O (2014) srcSlice: very efficient and scalable forward static slicing. J Softw Evol Process 26(11):931–961
Badri L, Badri M (2004) A proposal of a new class cohesion criterion: an empirical study. J Object Technol 3(4):145–159
Barpanda SS, Mohapatra DP (2011) Dynamic slicing of distributed object-oriented programs. IET Softw 5(5):425–433
Briand LC, Morasca S, Basili VR (1996) Property-based software engineering measurement. IEEE Trans Softw Eng 22(1):68–86
Briand LC, Morasca S, Basili VR (1999) Defining and validating measures for object-based high-level design. IEEE Trans Softw Eng 25(5):722–743
Chae HS, Kwon YR, Bae DH (2000) A cohesion measure for object-oriented classes. Softw Pract Exp 30(12):1405–1432
Chen Z, Xu B (2001) Slicing object-oriented Java programs. ACM SIGPLAN Not 36(4):33–40
Chen Z, Zhou Y, Xu B, Zhao J, Yang H (2002) A novel approach to measuring class cohesion based on dependence analysis. In: Proceedings of the international conference on software maintenance (ICSM). IEEE, pp 377–384
Chidamber SR, Kemerer CF (1994) A metrics suite for object-oriented design. Softw Eng IEEE Trans 20(6):476–493
Collard ML, Decker MJ, Maletic JI (2011) Lightweight transformation and fact extraction with the srcML Toolkit. In: Source code analysis and manipulation (SCAM), 2011 11th IEEE international working conference on. IEEE, pp 173–184
Collard ML, Kagdi HH, Maletic JI (2003) An XML-based lightweight C++ fact extractor. In: Program comprehension, 2003. 11th IEEE international workshop on. IEEE, pp 134–143
Green P, Lane PC, Rainer A, Scholz S (2009) An introduction to slice-based cohesion and coupling metrics. Technical Report SE-09-488, University of Hertfordshire
Gupta V, Chhabra JK (2012) Package level cohesion measurement in object-oriented software. J Braz Comput Soc 18(3):251–266
Kovács G, Magyar F, Gyimóthy T (1996) Static slicing of java programs. In: University. Citeseer
Krinke J (2007) Statement-level cohesion metrics and their visualization. In: Source code analysis and manipulation (SCAM), 7th IEEE international working conference. IEEE, pp 37–48
Krishnaswamy A (1994) Program slicing: an application of object-oriented program dependence graphs. Technical report TR94-108. Department of Computer Science, Clemson University
Li BX, Fan XC, Pang J, Zhao JJ (2004) Model for slicing Java programs hierarchically. J Comput Sci Technol 19(6):848–858
Lossing N, Guillou P, Amini M, Irigoin F (2015) From data to effects dependence graphs: source-to-source transformations for C. In: The 18th international workshop on compilers for parallel computing (CPC’15)
Meyers TM, Binkley D (2007) An empirical study of slice-based cohesion and coupling metrics. ACM Trans Softw Eng Methodol (TOSEM) 17(1):2
Mohapatra DP, Mall R, Kumar R (2005) Computing dynamic slices of concurrent object-oriented programs. Inf Softw Technol 47(12):805–817
Mohapatra DP, Mall R, Kumar R (2006) An overview of slicing techniques for object-oriented programs. Inform (Slov) 30(2):253–277
Panda S, Mohapatra DP (2013) Application of hierarchical slicing to regression test selection of Java programs. Model Based Softw Eng Some Perspect Infosys Labs Brief 11(2):3–19
Rilling J, Klemola T (2003) Identifying comprehension bottlenecks using program slicing and cognitive complexity metrics. In: 11th IEEE international workshop on program comprehension. IEEE, pp 115–124
Romano D, Pinzger M (2011) Using source code metrics to predict change-prone Java interfaces. In: Software maintenance (ICSM), 2011 27th IEEE international conference on. IEEE, pp 303–312
Silva B, Sant’Anna C, Chavez C, Garcia A (2012) Concern-based cohesion: unveiling a hidden dimension of cohesion measurement. In: IEEE 20th international conference on program comprehension (ICPC). IEEE, pp 103–112
da Silva BC, Sant’Anna C, Chavez C (2011) Concern-based cohesion as change proneness indicator: an initial empirical study. In: Proceedings of the 2nd international workshop on emerging trends in software metrics. ACM, pp 52–58
da Silva BC, Sant’Anna CN, Chavez CvF (2014) An empirical study on how developers reason about module cohesion. In: Proceedings of the 13th international conference on modularity. ACM, pp 121–132
Tian J, Zelkowitz MV (1992) A formal program complexity model and its application. J Syst Softw 17(3):253–266
Wang D, Dong M, Zhan W (2013) An input data related behavior extracting and measuring model. Int J Appl Math Inf Sci 7(2):683–689
Wang T, Roychoudhury A (2004) Using compressed bytecode traces for slicing Java programs. In: 26th international conference on software engineering (ICSE’04). ACM, pp 512–521
Weiser M (1981) Program Slicing. In: Proceedings of the 5th international conference on software. San Diego, pp 439–449
Wen W (2012) Software fault localization based on program slicing spectrum. In: Proceedings of the international conference on software wngineering. ACM, pp 1511–1514
Weyuker EJ (1988) Evaluating software complexity measures. Softw Eng IEEE Trans 14(9):1357–1365
Yoshida N, Kinoshita M, Iida H (2012) A cohesion metric approach to dividing source code into functional segments to improve maintainability. In: Software maintenance and reengineering (CSMR), 16th European conference on. IEEE, pp 365–370
Yu P, Systa T, Muller H (2002) Predicting fault-proneness using OO metrics. An industrial case study. In: Proceedings of software maintenance and reengineering, 2002, Sixth European conference on. IEEE, pp 99–107
Zhao J (1998) Applying program dependence analysis to java software. In: Proceedings of workshop on software engineering and database systems, 1998, international computer symposium. Citeseer, pp 162–169
Zhao J, Cheng J, Ushijima K (1998) A dependence based representation for concurrent object-oriented software maintenance. In: Proceedings of 2nd Euromicro conference on software maintenance and reengineering, pp 60–66
Zhou Y, Wen L, Wang J, Chen Y, Lu H, Xu B (2003) DRC: a dependence relationships based cohesion measure for classes. In: Software engineering conference. Tenth Asia-Pacific. IEEE, pp 215–223
Zhou Y, Xu B, Zhao J, Yang H (2002) ICBMC: an improved cohesion measure for classes. In: Software maintenance, 2002. Proceedings of international conference. IEEE, pp 44–53
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Panda, S., Mohapatra, D.P. ACCo: a novel approach to measure cohesion using hierarchical slicing of Java programs. Innovations Syst Softw Eng 11, 243–260 (2015). https://doi.org/10.1007/s11334-015-0252-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11334-015-0252-8