Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2577080.2582208acmotherconferencesArticle/Chapter ViewAbstractPublication PagesmodularityConference Proceedingsconference-collections
research-article

How do programmers use optional typing?: an empirical study

Published: 22 April 2014 Publication History

Abstract

The recent popularization of dynamically typed languages, such as Ruby and JavaScript, has brought more attention to the discussion about the impact of typing strategies on development. Types allow the compiler to find type errors earlier and potentially improve the readability and maintainability of code. On the other hand, "untyped" code may be easier to change and require less work from programmers. This paper tries to identify the programmers' point of view about these tradeoffs. An analysis of the source code of 6638 projects written in Groovy, a programming language which features optional typing, shows in which scenarios programmers prefer to type or not to type their declarations. Our results show that types are popular in the definition of module interfaces, but are less used in scripts, test classes and frequently changed code. There is no correlation between the size and age of projects and how their constructs are typed. Finally, we also found evidence that the background of programmers influences how they use types.

References

[1]
K. Beck. Test-driven development: by example. Addison-Wesley Professional, 2003.
[2]
K. Bruce. Foundations of object-oriented languages: types and semantics. The MIT Press, 2002.
[3]
M. Bruch, M. Monperrus, and M. Mezini. Learning from examples to improve code completion systems. In Proceedings of the International Symposium on the Foundations of Software Engineering (FSE), 213--222, 2009.
[4]
L. Cardelli. Type systems. ACM Computing Surveys, 28(1), 263--264, 1996.
[5]
M. Chang, B. Mathiske, E. Smith, A. Chaudhuri, A. Gal. M. Bebenita, C. Wimmer, and M. Franz. The impact of optional type information on jit compilation of dynamically typed languages. SIGPLAN Notices, 47(2), 13--24, 2011. Coupling is high for inheritance% interaction coupling, component coupling and inheritance coupling
[6]
S. Chidamber and C. Kemerer. A metrics suite for object oriented design. IEEE Transactions on Software Engineering, 20(6), 476--493, 1994.
[7]
J. Cohen. Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale, NJ: Lawrence Erlbaum, 1988.
[8]
B. Curtis. Five paradigms in the psychology of programming. MMC, 1987.
[9]
M. Daly, V. Sazawal, and J. Foster. An empirical study of static typing in ruby. In Proceedings of the Workshop on Evaluation and Usability of Programming Languages and Tools (PLATEAU), 2009.
[10]
N. Fenton and S. Pfleeger. Software metrics: a rigorous and practical approach. PWS Publishing Co., 1998. Traditional static type systems are very effective for verifying basic interface specifications
[11]
C. Flanagan. Hybrid type checking. ACM SIGPLAN Notices. Vol. 41. No. 1, 2006.
[12]
M. Fowler, Domain-specific languages. Pearson Education, 2010.
[13]
M. Furr et al. Static type inference for Ruby. In Proceedings of the ACM symposium on Applied Computing (ACM SAC), 2009. Use of types in interfaces
[14]
J. Gannon. An experimental evaluation of data type conventions. Communications of the ACM, 20, 8, 584--595, 1977.
[15]
K. Gray. Safe cross-language inheritance. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), pp. 52--75.
[16]
K. Gray. Interoperability in a scripted world: Putting inheritance & prototypes together. In Proceedings of Foundations of Object-Oriented Languages (FOOL), 2011.
[17]
K. Gray, R. Findler, M. Andflatt. Fine-grained interoperability through contracts and mirrors. In Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 231--245, 2005.
[18]
Groovy programming language. http://groovy.codehaus.org/. Accessed in 10/10/2013.
[19]
S. Hanenberg, An experiment about static and dynamic type systems: doubts about the positive impact of static type systems on development time. SIGPLAN Notices, 45(10), 22--35, 2010.
[20]
S. Hanenberg et al. An empirical study on the impact of static typing on software maintainability. Empirical Software Engineering - An International Journal, 1--48, 2013.
[21]
ISO, and IEC FCD. 25000, Software engineering-software product quality requirements and evaluation (SQuaRE) - Guide to SQuaRE. International Organization for Standardization, 2004.
[22]
S. Kleinschmager, S. Hanenberg, R. Robbes, and A. Stefik. Do static type systems improve the maintainability of software systems? An empirical study. In Proceedings of the 20th IEEE International Conference on Program Comprehension (ICPC), 153--162, 2012.
[23]
S. Labovitz, Criteria for selecting a significance level: A note on the sacredness of. 05. The American Sociologist 3.3, 220--222, 1968.
[24]
L. Lamport, and L. Paulson. Should your specification language be typed. ACM Transactions on Programming Languages and Systems, 21(3), 502--526, 1999.
[25]
C. Mayer, S. Hanenberg, R. Robbes, E. Tanter, and A. Stefik. Static type systems (sometimes) have a positive impact on the usability of undocumented software: An empirical evaluation. Technical Report 20120418-005, 2012. Types help on the definition of a contract
[26]
E. Meijer and D. Peter. Static typing where possible, dynamic typing when needed: The end of the cold war between programming languages. In Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2004.
[27]
B. Meyer. Object-oriented software construction, Vol. 2. Prentice hall, 1988.
[28]
L. Meyerovich and A. Rabkin. Empirical analysis of programming language adoption. In Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 1--18, 2013.
[29]
B. Pierce. Types and programming languages. MIT press, 2002.% Unfortunately, dynamically typed programming languages usually do not support the concept of DEC. Therefore we integrated DEC into the programming language Python by using a metaprogramming approach
[30]
R. Plosch. Design by contract for Python. Proceedings of the Asia Pacific Software Engineering Conference (APSEC), 1997.
[31]
L. Prechelt and W. Tichy. A controlled experiment to assess the benefits of procedure argument type checking. IEEE Transactions of Software Engineering, 24(4), 302--312, 1998.
[32]
J. Siek, and W. Taha. Gradual typing for objects. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), 2--27, 2007.
[33]
J. Siek, W. Andtaha. Gradual typing for objects. In Proceedings of European Conference on Object-Oriented Programming (ECOOP), 2--27, 2007.
[34]
A. Takikawa et al. Gradual typing for first-class classes. ACM SIGPLAN Notices. Vol. 47. No. 10. ACM, 2012.
[35]
Tiobe programming community index. http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html. Accessed in 23/09/2013.
[36]
L. Tratt. Dynamically typed languages. Advances in Computers, vol. 77, 149--184, 2009.
[37]
P. Wadler and R. Findler. Well-typed programs can't be blamed. Proceedings of the 18th European Symposium on Programming Languages and Systems (ESOP), 1--16, 2009.
[38]
C. Wohlin et al. Experimentation in software engineering. Springer Publishing Company, 2012.

Cited By

View all
  • (2021)Where to Start: Studying Type Annotation Practices in Python2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)10.1109/ASE51524.2021.9678947(529-541)Online publication date: Dec-2021
  • (2020)The behavior of gradual types: a user studyACM SIGPLAN Notices10.1145/3393673.327694753:8(1-12)Online publication date: 6-Apr-2020
  • (2018)The behavior of gradual types: a user studyProceedings of the 14th ACM SIGPLAN International Symposium on Dynamic Languages10.1145/3276945.3276947(1-12)Online publication date: 24-Oct-2018
  • Show More Cited By

Index Terms

  1. How do programmers use optional typing?: an empirical study

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    MODULARITY '14: Proceedings of the 13th international conference on Modularity
    April 2014
    264 pages
    ISBN:9781450327725
    DOI:10.1145/2577080
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    • AOSA: Aspect-Oriented Software Association

    In-Cooperation

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 22 April 2014

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. groovy
    2. static analysis
    3. type systems

    Qualifiers

    • Research-article

    Funding Sources

    Conference

    MODULARITY '14
    Sponsor:
    • AOSA

    Acceptance Rates

    MODULARITY '14 Paper Acceptance Rate 21 of 60 submissions, 35%;
    Overall Acceptance Rate 41 of 139 submissions, 29%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)8
    • Downloads (Last 6 weeks)2
    Reflects downloads up to 28 Dec 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2021)Where to Start: Studying Type Annotation Practices in Python2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)10.1109/ASE51524.2021.9678947(529-541)Online publication date: Dec-2021
    • (2020)The behavior of gradual types: a user studyACM SIGPLAN Notices10.1145/3393673.327694753:8(1-12)Online publication date: 6-Apr-2020
    • (2018)The behavior of gradual types: a user studyProceedings of the 14th ACM SIGPLAN International Symposium on Dynamic Languages10.1145/3276945.3276947(1-12)Online publication date: 24-Oct-2018
    • (2018)Mining inline cache data to order inferred types in dynamic languagesScience of Computer Programming10.1016/j.scico.2017.11.003161:C(105-121)Online publication date: 1-Sep-2018
    • (2018)Recognizing Potential Runtime Types from Python DocstringsSoftware Analysis, Testing, and Evolution10.1007/978-3-030-04272-1_5(68-84)Online publication date: 20-Nov-2018
    • (2017)Exploiting type hints in method argument names to improve lightweight type inferenceProceedings of the 25th International Conference on Program Comprehension10.1109/ICPC.2017.33(77-87)Online publication date: 20-May-2017
    • (2017)Empirical, Human-Centered Evaluation of Programming and Programming Language Constructs: Controlled ExperimentsGrand Timely Topics in Software Engineering10.1007/978-3-319-60074-1_3(45-72)Online publication date: 29-Jun-2017
    • (2016)Type unsoundness in practice: an empirical study of DartACM SIGPLAN Notices10.1145/3093334.298922752:2(13-24)Online publication date: 1-Nov-2016
    • (2016)Type unsoundness in practice: an empirical study of DartProceedings of the 12th Symposium on Dynamic Languages10.1145/2989225.2989227(13-24)Online publication date: 1-Nov-2016
    • (2015)An empirical investigation of the effects of type systems and code completion on API usability using TypeScript and JavaScript in MS visual studioACM SIGPLAN Notices10.1145/2936313.281672051:2(154-167)Online publication date: 21-Oct-2015
    • Show More Cited By

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media