Skip to main content

What Programmers Do with Inheritance in Java

  • Conference paper
ECOOP 2013 – Object-Oriented Programming (ECOOP 2013)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7920))

Included in the following conference series:

Abstract

Inheritance is a distinguishing feature of object-oriented programming languages, but its application in practice remains poorly understood. Programmers employ inheritance for a number of different purposes: to provide subtyping, to reuse code, to allow subclasses to customise superclasses’ behaviour, or just to categorise objects. We present an empirical study of 93 open-source Java software systems consisting over over 200,000 classes and interfaces, supplemented by longitudinal analyses of 43 versions of two systems. Our analysis finds inheritance is used for two main reasons: to support subtyping and to permit what we call external code reuse. This is the first empirical study to indicate what programmers do with inheritance.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Basili, V.R., Briand, L.C., Melo, W.L.: A validation of object-oriented design metrics as quality indicators. IEEE Trans. Softw. Eng. 22(10), 751–761 (1996)

    Article  Google Scholar 

  2. Bloch, J.: Effective Java, 2nd edn. Addison-Wesley (2008)

    Google Scholar 

  3. Briand, L.C., Daly, J., Porter, V., Wüst, J.K.: A comprehensive empirical validation of design measures for object-oriented systems. In: METRICS 1998: Proceedings of the 5th International Symposium on Software Metrics, pp. 246–257. IEEE Computer Society, Washington, DC (1998)

    Google Scholar 

  4. Budd, T.: An Introduction to Object-Oriented Programming, 3rd edn. Addison-Wesley (2002)

    Google Scholar 

  5. Cargill, T.A.: The case against multiple inheritance in C++. USENIX Computing Systems 4(1), 69–82 (1991)

    Google Scholar 

  6. Cartwright, M.: An empirical view of inheritance. Information and Software Technology 40, 795–799 (1998)

    Article  Google Scholar 

  7. Chidamber, S.R., Kemerer, C.F.: A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20(6), 476–493 (1994)

    Article  Google Scholar 

  8. Chidamber, S.R., Kemerer, C.F.: Towards a metrics suite for object oriented design. In: OOPSLA, pp. 197–211 (1991)

    Google Scholar 

  9. Cook, W.R., Hill, W., Canning, P.S.: Inheritance is not subtyping. In: Proceedings of the 17th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1990, pp. 125–135. ACM, New York (1990)

    Chapter  Google Scholar 

  10. Daly, J., Brooks, A., Miller, J., Roper, M., Wood, M.: Evaluating inheritance depth on the maintainability of object-oriented software. Empirical Software Engineering 1(2), 109–132 (1996)

    Article  Google Scholar 

  11. Fenton, N.E., Pfleeger, S.L.: Software Metrics: A Rigorous and Practical Approach. PWS Publishing Co., Boston (1998)

    Google Scholar 

  12. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison Wesley Publishing Company, Reading (1994)

    Google Scholar 

  13. Gil, J(Y.), Maman, I.: Micro patterns in Java code. In: OOPSLA, pp. 97–116 (2005)

    Google Scholar 

  14. Harrison, R., Counsell, S., Nithi, R.: Experimental assessment of the effect of inheritance on the maintainability of object-oriented systems. Journal of Systems and Software 52, 173–179 (2000)

    Article  Google Scholar 

  15. Holub, A.: Why extends is evil: Improve your code by replacing concrete base classes with interfaces (August 2003), http://JavaWorld.com

  16. Johnson, R.E., Foote, B.: Designing reusable classes. Journal of Object-Oriented Programming (June/July 1988)

    Google Scholar 

  17. Liskov, B.: Keynote address — data abstraction and hierarchy. SIGPLAN Notices 23(5), 17–34 (1987)

    Article  Google Scholar 

  18. Manel, D., Havanas, W.: A study of the impact of C++ on software maintenance. In: International Conference on Software Maintenance, pp. 63–69 (1990)

    Google Scholar 

  19. Meyer, B.: Genericity versus inheritance. In: OOPSLA, pp. 391–405. ACM, New York (1986)

    Google Scholar 

  20. Meyer, B.: The many faces of inheritance: a taxonomy of taxonomy. IEEE Computer 29(5), 105–108 (1996)

    Article  Google Scholar 

  21. Pradel, M., Gross, T.R.: Automatic testing of sequential and concurrent substitutability. In: International Conference on Software Engineering, ICSE (2013)

    Google Scholar 

  22. Schmager, F., Cameron, N., Noble, J.: GoHotDraw: evaluating the go programming language with design patterns. In: Evaluation and Usability of Programming Languages and Tools, PLATEAU 2010, pp. 10:1–10:6. ACM, New York (2010)

    Google Scholar 

  23. Snyder, A.: Encapsulation and inheritance in object-oriented programming languages. In: OOPSLA, pp. 38–45 (1986)

    Google Scholar 

  24. Sumption, B.: Inheritance is evil, and must be destroyed (2007), http://berniesumption.com/software/inheritance-is-evil-and-must-be-destroyed (last accessed December 2012)

  25. Taivalsaari, A.: On the notion of inheritance. Comp. Surv. 28(3), 438–479 (1996)

    Article  Google Scholar 

  26. Tempero, E., Anslow, C., Dietrich, J., Han, T., Li, J., Lumpe, M., Melton, H., Noble, J.: Qualitas corpus: A curated collection of Java code for empirical studies. In: 2010 Asia Pacific Software Engineering Conference (APSEC 2010), pp. 336–345 (December 2010), www.qualitascorpus.com

  27. Tempero, E., Counsell, S., Noble, J.: An empirical study of overriding in open source Java. In: Thirty-Third Australasian Computer Science Conference (ACSC 2010), Brisbane, Australia. The Conferences in Research and Practice in Information Technology (CRPIT) Series, vol. 102, pp. 3–12 (January 2010)

    Google Scholar 

  28. Tempero, E., Noble, J., Melton, H.: How do Java programs use inheritance? An empirical study of inheritance in Java software. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 667–691. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  29. Vallée-Rai, R., Hendren, L., Sundaresan, V., Lam, P., Gagnon, E., Co, P.: Soot - a Java optimization framework. In: CASCON, pp. 125–135 (1999)

    Google Scholar 

  30. Waldo, J.: Controversy: The case for multiple inheritance in C++. USENIX Computing Systems 4(2), 157–172 (1991)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Tempero, E., Yang, H.Y., Noble, J. (2013). What Programmers Do with Inheritance in Java. In: Castagna, G. (eds) ECOOP 2013 – Object-Oriented Programming. ECOOP 2013. Lecture Notes in Computer Science, vol 7920. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-39038-8_24

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-39038-8_24

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-39037-1

  • Online ISBN: 978-3-642-39038-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics