Not logged in.

Contribution Details

Type Conference or Workshop Paper
Scope Discipline-based scholarship
Published in Proceedings Yes
Title An Empirical Validation of the Benefits of Adhering to the Law of Demeter
Organization Unit
Authors
  • Yi Guo
  • Michael Würsch
  • Emanuel Giger
  • Harald Gall
Presentation Type paper
Item Subtype Original Work
Refereed Yes
Status Published in final form
Language
  • English
ISBN 978-1-4577-1948-6
Page Range 239 - 243
Event Title 18th Working Conference on Reverse Engineering (WCRE)
Event Type conference
Event Location Limerick, Ireland
Event Start Date November 17 - 2011
Event End Date November 20 - 2011
Publisher IEEE
Abstract Text 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.
Digital Object Identifier 10.1109/WCRE.2011.36
Export BibTeX
EP3 XML (ZORA)