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.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
Bloch, J.: Effective Java, 2nd edn. Addison-Wesley (2008)
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)
Budd, T.: An Introduction to Object-Oriented Programming, 3rd edn. Addison-Wesley (2002)
Cargill, T.A.: The case against multiple inheritance in C++. USENIX Computing Systems 4(1), 69–82 (1991)
Cartwright, M.: An empirical view of inheritance. Information and Software Technology 40, 795–799 (1998)
Chidamber, S.R., Kemerer, C.F.: A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20(6), 476–493 (1994)
Chidamber, S.R., Kemerer, C.F.: Towards a metrics suite for object oriented design. In: OOPSLA, pp. 197–211 (1991)
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)
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)
Fenton, N.E., Pfleeger, S.L.: Software Metrics: A Rigorous and Practical Approach. PWS Publishing Co., Boston (1998)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison Wesley Publishing Company, Reading (1994)
Gil, J(Y.), Maman, I.: Micro patterns in Java code. In: OOPSLA, pp. 97–116 (2005)
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)
Holub, A.: Why extends is evil: Improve your code by replacing concrete base classes with interfaces (August 2003), http://JavaWorld.com
Johnson, R.E., Foote, B.: Designing reusable classes. Journal of Object-Oriented Programming (June/July 1988)
Liskov, B.: Keynote address — data abstraction and hierarchy. SIGPLAN Notices 23(5), 17–34 (1987)
Manel, D., Havanas, W.: A study of the impact of C++ on software maintenance. In: International Conference on Software Maintenance, pp. 63–69 (1990)
Meyer, B.: Genericity versus inheritance. In: OOPSLA, pp. 391–405. ACM, New York (1986)
Meyer, B.: The many faces of inheritance: a taxonomy of taxonomy. IEEE Computer 29(5), 105–108 (1996)
Pradel, M., Gross, T.R.: Automatic testing of sequential and concurrent substitutability. In: International Conference on Software Engineering, ICSE (2013)
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)
Snyder, A.: Encapsulation and inheritance in object-oriented programming languages. In: OOPSLA, pp. 38–45 (1986)
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)
Taivalsaari, A.: On the notion of inheritance. Comp. Surv. 28(3), 438–479 (1996)
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
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)
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)
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)
Waldo, J.: Controversy: The case for multiple inheritance in C++. USENIX Computing Systems 4(2), 157–172 (1991)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)