DocumentCode :
2330070
Title :
An Empirical Validation of the Benefits of Adhering to the Law of Demeter
Author :
Guo, Yi ; Wuersch, M. ; Giger, Emanuel ; Gall, Harald C.
Author_Institution :
Dept. of Inf., Univ. of Zurich, Zurich, Switzerland
fYear :
2011
fDate :
17-20 Oct. 2011
Firstpage :
239
Lastpage :
243
Abstract :
The Law of Demeter formulates the rule-of-thumb that modules in object-oriented program code should "only talk to their immediate friends". While it is said to foster information hiding for object-oriented software, solid empirical evidence confirming the positive effects of following the Law of Demeter is still lacking. In this paper, we conduct an empirical study to confirm that violating the Law of Demeter has a negative impact on software quality, in particular that it leads to more bugs. We implement an Eclipse plugin to calculate the amount of violations of both the strong and the weak form of the law in five Eclipse sub-projects. Then we discover the correlation between violations of the law and the bug-proneness and perform a logistic regression analysis of three sub-projects. We also combine the violations with other OO metrics to build up a model for predicting the bug-proneness for a given class. Empirical results show that violations of the Law of Demeter indeed highly correlate with the number of bugs and are early predictor of the software quality. Based on this evidence, we conclude that obeying the Law of Demeter is a straight-forward approach for developers to reduce the number of bugs in their software.
Keywords :
object-oriented programming; program debugging; software quality; Eclipse plugin; OO metrics; bug-proneness; information hiding; law of Demeter; logistic regression analysis; object-oriented program code; object-oriented software; software quality; Computer bugs; Logistics; Measurement; Object oriented modeling; Predictive models; Principal component analysis; Software; Bug Prediction; Law of Demeter;
fLanguage :
English
Publisher :
ieee
Conference_Titel :
Reverse Engineering (WCRE), 2011 18th Working Conference on
Conference_Location :
Limerick
ISSN :
1095-1350
Print_ISBN :
978-1-4577-1948-6
Type :
conf
DOI :
10.1109/WCRE.2011.36
Filename :
6079847
Link To Document :
بازگشت