Advertisement

Empirical Software Engineering

, Volume 18, Issue 6, pp 1156–1194 | Cite as

How (and why) developers use the dynamic features of programming languages: the case of smalltalk

  • Oscar CallaúEmail author
  • Romain Robbes
  • Éric Tanter
  • David Röthlisberger
Article

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.

Keywords

Dynamic languages Static analysis Smalltalk Reflection 

Notes

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.

References

  1. 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–1022Google Scholar
  2. 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–230Google Scholar
  3. 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 DarmstadtGoogle Scholar
  4. 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–250Google Scholar
  5. 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 98Google Scholar
  6. 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–10Google Scholar
  7. Goldberg A, Robson D (1983) Smalltalk-80: the language and its implementation. Addison-WesleyGoogle Scholar
  8. 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–25Google Scholar
  9. Knuth DE (1971) An empirical study of fortran programs. Softw Pract Exp 1(2):105–133CrossRefzbMATHGoogle Scholar
  10. 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–312Google Scholar
  11. 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–111Google Scholar
  12. 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. SpringerGoogle Scholar
  13. 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–582Google Scholar
  14. Melton H, Tempero ED (2007) An empirical study of cycles among classes in java. Empir Software Eng 12(4):389–415CrossRefGoogle Scholar
  15. 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–12Google Scholar
  16. 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–12Google Scholar
  17. 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–78Google Scholar
  18. 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–149Google Scholar
  19. 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–100Google Scholar
  20. 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–691Google Scholar
  21. Triola M (2006) Elementary statistics, 10th edn. Addison-WesleyGoogle Scholar
  22. 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 16Google Scholar
  23. 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. SpringerGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2012

Authors and Affiliations

  • Oscar Callaú
    • 1
    Email author
  • Romain Robbes
    • 1
  • Éric Tanter
    • 1
  • David Röthlisberger
    • 1
  1. 1.PLEIAD Laboratory, Computer Science Department (DCC)University of ChileSantiagoChile

Personalised recommendations