Nothing Special   »   [go: up one dir, main page]

skip to main content
10.5555/1862199.1862200dlproceedingsArticle/Chapter ViewAbstractPublication Pagesaus-cscConference Proceedingsconference-collections
research-article
Free access

An empirical study of overriding in open source Java

Published: 01 January 2010 Publication History

Abstract

Inheritance is a key feature of object-oriented programming. Overriding is one of the most important parts of inheritance, allowing a subclass to replace methods implemented in its superclass. Unfortunately, the way programmers use overriding in practise is not well understood.
We present the first large-scale empirical study of overriding. We describe a suite of metrics that measure overriding and present a corpus analysis that uses those metrics to analyse 100 open-source applications, containing over 100,000 separate classes and interfaces. We found substantial overriding: most subclasses override at least one method and many classes that only declare overriding methods. We also found questionable uses of overriding, such as removing superclass method implementations by overriding them with empty method bodies.

References

[1]
}}Baxter, G., Frean, M., Noble, J., Rickerby, M., Smith, H., Visser, M., Melton, H. & Tempero, E. (2006), Understanding the shape of Java software, in W. Cook, ed., 'OOPSLA', pp. 397--412.
[2]
}}Binder, R. V. (1999), Testing object-oriented systems: models, patterns, and tools, Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
[3]
}}Briand, L. C., Wüst, J., Daly, J. W. & Porter, D. V. (2000), 'Exploring the relationships between design measures and software quality in object-oriented systems', Journal of Systems and Software 51(3), 254--273.
[4]
}}Briand, L., Devanbu, P. & Melo, W. (1997), An investigation into coupling measures for C++, in 'ICSE', pp. 412--421.
[5]
}}Cartwright, M. (1998), 'An empirical view of inheritance', Information and Software Technology 40, 795--799.
[6]
}}Counsell, S. & Newson, P. (2000), 'Use of friends in C++ software: an empirical investigation', Journal of Systems and Software 53(1), 15--21.
[7]
}}Daly, J., Brooks, A., Miller, J., Roper, M. & Wood, M. (1996), 'Evaluating inheritance depth on the maintainability of object-oriented software', Empirical Software Engineering 1(2), 109--132.
[8]
}}Emam, K. E., Benlarbi, S., Goel, N. & Rai, S. N. (2001), 'The confounding effect of class size on the validity of object-oriented metrics', IEEE Transactions on Software Engineering 27(7), 630--650.
[9]
}}Fenton, N. E. & Pfleeger, S. L. (1998), Software Metrics: A Rigorous and Practical Approach, PWS Publishing Co.
[10]
}}Gamma, E., Helm, R., Johnson, R. & Vlissides, J. (1994), Design Patterns, Addison Wesley Publishing Company.
[11]
}}Gosling, J., Joy, B., Steele, G. & Bracha, G. (2005), The Java(tm) Language Specification, third edn, Addison-Wesley.
[12]
}}Harrison, R., Counsell, S. & Nithi, R. (2000), 'Experimental assessment of the effect of inheritance on the maintainability of object-oriented systems', Journal of Systems and Software 52, 173--179.
[13]
}}Holub, A. (2003), 'Why extends is evil: Improve your code by replacing concrete base classes with interfaces', JavaWorld.com.
[14]
}}Lorenz, M. & Kidd, J. (1994), Object-oriented software metrics: a practical guide, Prentice-Hall.
[15]
}}Mikhajlov, L. & Sekerinski, E. (1998), A study of the fragile base class problem, in 'ECOOP '98: Proceedings of the 12th European Conference on Object-Oriented Programming', Springer-Verlag, London, UK, pp. 355--382.
[16]
}}Qualitas Research Group (2008), 'Qualitas corpus. release 20080603', http://www.cs.auckland.ac.nz/~ewan/corpus/.
[17]
}}Steyaert, P., Lucas, C., Mens, K. & D'Hondt, T. (1996), Reuse contracts: managing the evolution of reusable assets, in 'OOPSLA '96: Proceedings of the 11th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications', ACM, pp. 268--285.
[18]
}}Tempero, E., Noble, J. & Melton, H. (2008), How do Java programs use inheritance? an empirical study of inheritance in Java software, in J. Vitek, ed., '22nd European Conference on Object-Oriented Programming', Paphos, Cyprus, pp. 667--691.
[19]
}}Venners, B. (2005), 'Design principles from design patterns: A conversation with Erich Gamma, Part III', http://www.artima.com/lejava/articles/designprinciples4.html.

Cited By

View all
  • (2013)What programmers do with inheritance in javaProceedings of the 27th European conference on Object-Oriented Programming10.1007/978-3-642-39038-8_24(577-601)Online publication date: 1-Jul-2013

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image DL Hosted proceedings
ACSC '10: Proceedings of the Thirty-Third Australasian Conferenc on Computer Science - Volume 102
January 2010
188 pages
ISBN:9781920682835

Sponsors

  • Australian Comp Soc: Australian Computer Society
  • SAP Research
  • Queensland University of Technology
  • CEED
  • CSIRO ICT Centre
  • CORE - Computing Research and Education
  • Macquarie University-Sydney

Publisher

Australian Computer Society, Inc.

Australia

Publication History

Published: 01 January 2010

Author Tags

  1. inheritance
  2. object-oriented design
  3. overriding

Qualifiers

  • Research-article

Conference

ACSC '10
Sponsor:
  • Australian Comp Soc
ACSC '10: Computer Science
January 1, 2010
Brisbane, Australia

Acceptance Rates

ACSC '10 Paper Acceptance Rate 18 of 60 submissions, 30%;
Overall Acceptance Rate 136 of 379 submissions, 36%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)55
  • Downloads (Last 6 weeks)9
Reflects downloads up to 25 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2013)What programmers do with inheritance in javaProceedings of the 27th European conference on Object-Oriented Programming10.1007/978-3-642-39038-8_24(577-601)Online publication date: 1-Jul-2013

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media