How Fields are Used in Java: An Empirical Study

  • Authors:
  • Ewan Tempero

  • Affiliations:
  • -

  • Venue:
  • ASWEC '09 Proceedings of the 2009 Australian Software Engineering Conference
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

The information hiding principle is generally accepted as one that if followed leads to higher quality software than if it is not followed. To follow the information hiding principle in object-oriented designs the advice is to avoid non-private fields. There is, however, little empirical evidence as to whether or not this advice is being followed. This paper presents the results of an empirical study of 100 open-source Java applications to determine to what degree non-private fields are declared, and to what extend they are used. The study indicates that it is not uncommon (albeit not that terribly common) to declare non-private fields, but then not take advantage of that access.