Accounting for data encapsulation in the measurement of object-oriented class cohesion

被引:5
作者
Al Dallal, Jehad [1 ]
机构
[1] Kuwait Univ, Dept Informat Sci, Safat 13060, Kuwait
关键词
data encapsulation; object-oriented design; class quality; class cohesion; cohesion measure; fault prediction; FAULT PREDICTION; METRICS SUITE; QUALITY; MAINTAINABILITY; ATTRIBUTES; MODELS; IMPACT;
D O I
10.1002/smr.1714
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Intuitively, in a certain class, a pair of methods that share an attribute of an object type is potentially more cohesive than those that share an attribute of a primitive type because the attribute of a reference type could implicitly refer to multiple data. Existing class cohesion measures ignore the implicit access to or sharing of attributes due to the encapsulation feature. As a result, the obtained cohesion values can be inaccurate and could lead to incorrect quality indications. This paper aims at demonstrating how to account for data encapsulation (DE) in cohesion measurement and reports empirical studies that investigate the impact of considering DE in cohesion measurement on cohesion values and the abilities of cohesion measures to predict class fault proneness. To differentiate between attributes and parameters of different types, we propose a weight assignment algorithm. The weight that is assigned to an attribute or a parameter of a type depends on the number of encapsulated attributes of the type. Seven cohesion measures are extended to consider the assigned weights in cohesion measurement. The results of the empirical study show that the cohesion values and the corresponding fault-proneness prediction results can significantly change when accounting for DE in cohesion measurement. Copyright (c) 2015 John Wiley & Sons, Ltd.
引用
收藏
页码:373 / 400
页数:28
相关论文
共 59 条
[1]   Empirical analysis for investigating the effect of object-oriented metrics on fault proneness: A replicated case study [J].
Aggarwal, K.K. ;
Singh, Yogesh ;
Kaur, Arvinder ;
Malhotra, Ruchika .
Software Process Improvement and Practice, 2009, 14 (01) :39-62
[2]  
Al Dallal J., 2010, INT J COMPUTER SCI, V4, P45
[3]  
Al Dallal J, 2012, ACM T SOFTW ENG METH, V21, P8
[4]   Predicting object-oriented class reuse-proneness using internal quality attributes [J].
Al Dallal, Jehad ;
Morasca, Sandro .
EMPIRICAL SOFTWARE ENGINEERING, 2014, 19 (04) :775-821
[5]   Object-oriented class maintainability prediction using internal quality attributes [J].
Al Dallal, Jehad .
INFORMATION AND SOFTWARE TECHNOLOGY, 2013, 55 (11) :2028-2048
[6]  
Al Dallal J, 2012, KUWAIT J SCI ENG, V39, P131
[7]   Incorporating transitive relations in low-level design-based class cohesion measurement [J].
Al Dallal, Jehad .
SOFTWARE-PRACTICE & EXPERIENCE, 2013, 43 (06) :685-704
[8]   Constructing models for predicting extract subclass refactoring opportunities using object-oriented quality metrics [J].
Al Dallal, Jehad .
INFORMATION AND SOFTWARE TECHNOLOGY, 2012, 54 (10) :1125-1141
[9]   The impact of accounting for special methods in the measurement of object-oriented class cohesion on refactoring and fault prediction activities [J].
Al Dallal, Jehad .
JOURNAL OF SYSTEMS AND SOFTWARE, 2012, 85 (05) :1042-1057
[10]   Fault prediction and the discriminative powers of connectivity-based object-oriented class cohesion metrics [J].
Al Dallal, Jehad .
INFORMATION AND SOFTWARE TECHNOLOGY, 2012, 54 (04) :396-416