Abstract
The dynamic and reflective features of programming languages are powerful constructs that programmers often mention as extremely useful. However, the ability to modify a program at runtime can be both a boon—in terms of flexibility—, and a curse—in terms of tool support. For instance, usage of these features hampers the design of type systems, the accuracy of static analysis techniques, or the introduction of optimizations by compilers. In this paper, we perform an empirical study of a large Smalltalk codebase—often regarded as the poster-child in terms of availability of these features—, in order to assess how much these features are actually used in practice, whether some are used more than others, and in which kinds of projects. In addition, we performed a qualitative analysis of a representative sample of usages of dynamic features in order to uncover (1) the principal reasons that drive people to use dynamic features, and (2) whether and how these dynamic feature usages can be removed or converted to safer usages. These results are useful to make informed decisions about which features to consider when designing language extensions or tool support.
Similar content being viewed by others
Notes
Available at http://www.squeaksource.com/ff.
All subclasses of TestCase are considered to represent tests, no matter how the rest of the project is categorized.
In Smalltalk the root superclass is nil.
References
Aldrich J, Sunshine J, Saini D, Sparks Z (2009) Typestate-oriented programming. In: OOPSLA ’09: proceeding of the 24th ACM SIGPLAN conference companion on Object oriented programming systems languages and applications, New York, NY, USA. ACM, pp 1015–1022
Bracha G, Griswold D (1993) Strongtalk: typechecking Smalltalk in a production environment. In: OOPSLA ’93: proceedings of the 8th international conference on object-oriented programming systems, languages and applications, pp 215–230
Bodden E, Sewe A, Sinschek J, Mezini M, Oueslati H (2010) Taming reflection (extended version): static analysis in the presence of reflection and custom class loaders. Technical report, TU Darmstadt
Bodden E, Sewe A, Sinschek J, Mezini M, Oueslati H (2011) Taming reflection: aiding static analysis in the presence of reflection and custom class loaders. In: ICSE ’11: proceedings of the 33rd ACM/IEEE international conference on software engineering. ACM Press, pp 241–250
Erdös K, Sneed HM (1998) Partial comprehension of complex programs (enough to perform maintenance). In: IWPC ’98: proceedings of the 6th international workshop on program comprehension, Washington, DC, USA. IEEE Computer Society, p 98
Grechanik M, McMillan C, DeFerrari L, Comi M, Crespi S, Poshyvanyk D, Fu C, Xie Q, Ghezzi C (2010) An empirical investigation into a large-scale java open source code repository. In: ESEM ’10: proceedings of the 4th international symposium on empirical software engineering and measurement, pp 1–10
Goldberg A, Robson D (1983) Smalltalk-80: the language and its implementation. Addison-Wesley
Holkner A, Harland J (2009) Evaluating the dynamic behaviour of python applications. In: ACSC ’09: proceedings of the 32nd Australasian computer science conference, pp 17–25
Knuth DE (1971) An empirical study of fortran programs. Softw Pract Exp 1(2):105–133
Lungu M, Robbes R, Lanza M (2010) Recovering inter-project dependencies in software ecosystems. In: ASE’10: proceedings of the 25th IEEE/ACM international conference on Automated Software Engineering, ASE ’10, pp 309–312
Malayeri D, Aldrich J (2009) Is structural subtyping useful? An empirical study. In: ESOP ’09: proceedings of the 18th European symposium on programming languages and systems, pp 95–111
Mezini M (ed) (2011) Proceedings of the 25th European Conference on Object-Oriented Programming (ECOOP 2011). Lecture notes in computer science, Lancaster, UK, vol 6813. Springer
Muschevici R, Potanin A, Tempero ED, Noble J (2008) Multiple dispatch in practice. In: OOPSLA ’08: proceedings of the 23rd ACM international conference on object-oriented programming, systems, languages, and applications, pp 563–582
Melton H, Tempero ED (2007) An empirical study of cycles among classes in java. Empir Software Eng 12(4):389–415
Parnin C, Bird C, Murphy-Hill ER (2011) Java generics adoption: how new features are introduced, championed, or ignored. In: MSR 2011: proceedings of the 8th international working conference on mining software repositories, pp 3–12
Richards G, Lebresne S, Burg B, Vitek J (2010) An analysis of the dynamic behavior of Javascript programs. In: PLDI ’10: proceedings of the 31st ACM conference on programming language design and implementation, pp 1–12
Richards G, Lebresne S, Burg B, Vitek J (2011) The eval that men do: a large-scale study of the use of eval in Javascript applications. In: Mezini M (ed) Proceedings of the 25th European Conference on Object-Oriented Programming (ECOOP 2011). Lecture Notes in Computer Science, Lancaster, UK, vol 6813. Springer, pp 52–78
Schärli N, Black A, Ducasse S (2004) Object-oriented encapsulation for dynamically-typed languages. In: Proceedings of the 19th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2004), Vancouver, British Columbia, Canada. ACM Press, pp 130–149
Tempero ED (2009) How fields are used in Java: an empirical study. In: ASWEC ’09: proceedings of the 20th Australian software engineering conference, pp 91–100
Tempero ED, Noble J, Melton H (2008) How do Java programs use inheritance? An empirical study of inheritance in Java software. In: ECOOP ’08: proceedings of the 22nd European conference on object-oriented programming, pp 667–691
Triola M (2006) Elementary statistics, 10th edn. Addison-Wesley
Van Rysselberghe F, Demeyer S (2007) Studying versioning information to understand inheritance hierarchy changes. In: MSR ’07: proceedings of the 4th international workshop on mining software repositories, p 16
Wolff R, Garcia R (2011) Éric Tanter, and Jonathan Aldrich. Gradual typestate. In: Mezini M (ed) Proceedings of the 25th European Conference on Object-Oriented Programming (ECOOP 2011). Lecture notes in computer science, Lancaster, UK, vol 6813. Springer
Acknowledgements
We thank the anonymous reviewers for their helpful comments. Romain Robbes is partially funded by FONDECYT Project 11110463, Chile. Éric Tanter is partially funded by FONDECYT Project 1110051, Chile. David Röthlisberger is funded by the Swiss National Science Foundation, SNF Project No. PBBEP2_135018.
Author information
Authors and Affiliations
Corresponding author
Additional information
Editor: Tao Xie, Thomas Zimmermann and Arie van Deursen
Rights and permissions
About this article
Cite this article
Callaú, O., Robbes, R., Tanter, É. et al. How (and why) developers use the dynamic features of programming languages: the case of smalltalk. Empir Software Eng 18, 1156–1194 (2013). https://doi.org/10.1007/s10664-012-9203-2
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10664-012-9203-2