Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

An empirical analysis of the transition from Python 2 to Python 3

Published: 01 April 2019 Publication History

Abstract

Python is one of the most popular and widely adopted programming languages in use today. In 2008 the Python developers introduced a new version of the language, Python 3.0, that was not backward compatible with Python 2, initiating a transitional phase for Python software developers. In this paper, we describe a study that investigates the degree to which Python software developers are making the transition from Python 2 to Python 3. We have developed a Python compliance analyser, PyComply, and have analysed a previously studied corpus of Python applications called Qualitas. We use PyComply to measure and quantify the degree to which Python 3 features are being used, as well as the rate and context of their adoption in the Qualitas corpus. Our results indicate that Python software developers are not exploiting the new features and advantages of Python 3, but rather are choosing to retain backward compatibility with Python 2. Moreover, Python developers are confining themselves to a language subset, governed by the diminishing intersection of Python 2, which is not under development, and Python 3, which is under development with new features being introduced as the language continues to evolve.

References

[1]
Åkerblom B, Stendahl J, Tumlin M, Wrigstad T (2014) Tracing dynamic features in Python programs. In: Working conference on mining software repositories, pp 292-295.
[2]
Benson D (2017) Different C standards: The story of C. http://opensourceforu.com/2017/04/different-c-standards-story-c/.
[3]
Cannon B (2013) Python 3.3: Trust me, it's better than 2.7. Pycon.
[4]
Cannon B (2017) Porting Python 2 code to Python 3. https://docs.python.org/3/howto/pyporting.html, Accessed 04 Apr 2017.
[5]
Chapman C, Stolee KT (2016) Exploring regular expression usage and context in Python. In: International Symposium on software testing and analysis, pp 282-293.
[6]
Chen Z, Chen L, Ma W, Xu B (2016) Detecting code smells in Python programs. In: International Conference on software analysis, testing and evolution, pp 18-23.
[7]
Coghlan N (2012) Python 3 Q&A. http://python-notes.curiousefficiency.org/en/latest/python3/questions_and_answers.html#other-changes, Accessed 03 Apr 2017.
[8]
Destefanis G, Ortu M, Porru S, Swift S, Marchesi M (2016) A statistical comparison of Java and Python software metric properties. In: International Workshop on emerging trends in software metrics, pp 22-28.
[9]
Dyer R, Rajan H, Nguyen HA, Nguyen TN (2014) Mining billions of AST nodes to study actual and potential usage of Java language features. In: International Conference on software engineering, pp 779-790.
[10]
Gee S (2014) Python 2.7 to be maintained until 2020. http://www.i-programmer.info/news/216-python/7179-python-27-to-be-maintained-until-2020.html, Accessed 03 April 2017.
[11]
Gorbovitski M, Liu YA, Stoller SD, Rothamel T, Tekle TK (2010) Alias analysis for optimization of dynamic languages. In: 6th Symposium on dynamic languages, pp 27-42.
[12]
Hora A, Robbes R, Anquetil N, Etien A, Ducasse S, Valente MT (2015) How do developers react to API evolution? the Pharo ecosystem case. In: International Conference on software maintenance and evolution, pp 251-260.
[13]
Kalliamvakou E, Gousios G, Blincoe K, Singer L, German DM, Damian D (2016) An in-depth study of the promises and perils of mining GitHub. Empir Softw Eng 21(5):2035-2071.
[14]
Klint P, Lämmel R, Verhoef C (2005) Toward an engineering discipline for grammarware. ACM Trans Softw Eng Methodol 14(3):331-380.
[15]
Lammel R (2001) Grammar adaptation. In: Formal Methods Europe, LNCS, vol 2021, pp 550-570.
[16]
Lämmel R, Zaytsev V (2009) An introduction to grammar convergence. In: Integrated Formal methods, LNCS, vol 5423, pp 246-260.
[17]
Lin W, Chen Z, Ma W, Chen L, Xu L, Xu B (2016) An empirical study on the characteristics of Python fine-grained source code change types. In: International Conference on software maintenance and evolution, pp 188-199.
[18]
Lindstrom G (2005) Programming with Python. IT Prof 7:10-16.
[19]
Ma W, Chen L, Zhang X, Zhou Y, Xu B (2017) How do developers fix cross-project correlated bugs? In: International Conference on software engineering, pp 381-392.
[20]
Malloy BA, Power JF (2016) Deriving grammar transformations for developing and maintaining multiple parser versions. In: Workshop on Parsing@SLE.
[21]
Malloy BA, Power JF (2017) Quantifying the transition from Python 2 to 3: an empirical study of Python applications. In: ACM/IEEE International symposium on empirical software engineering and measurement.
[22]
Malloy BA, Linde SA, Duffy EB, Power JF (2002a) Testing C++ compilers for ISO language conformance. Dr Dobb's J 27(6):71-80.
[23]
Malloy BA, Power JF, Waldron JT (2002b) Applying software engineering techniques to parser design: the development of a C# parser. In: Conference of the South African institute of computer scientists and information technologists. Port Elizabeth, pp 75-82.
[24]
Malloy BA, Gibbs TH, Power JF (2003) Progression toward conformance for C++ language compilers. Dr Dobb's J 28(11):54-60.
[25]
Memarian K, Matthiesen J, Lingard J, Nienhuis K, Chisnall D, Watson RNM, Sewell P (2016) Into the depths of C: elaborating the de facto standards. In: Programming Language design and implementation, pp 1-15.
[26]
Orrù M, Tempero E, Marchesi M, Tonelli R, Destefanis G (2015a) A curated benchmark collection of Python systems for empirical studies on software engineering. In: International Conference on predictive models and data analytics in software engineering, pp 2:1-2:4.
[27]
Orrù M, Tempero ED, Marchesi M, Tonelli R (2015b) How do Python programs use inheritance? A replication study. In: Asia-Pacific Software engineering conference, pp 309-315.
[28]
Parnin C, Bird C, Murphy-Hill E (2011) Java generics adoption: how new features are introduced, championed, or ignored. In: Working Conference on mining software repositories, pp 3-12.
[29]
Perl 5 Porters (2017) Perl programming documentation. https://perldoc.perl.org/perlpolicy.html, Accessed 18 Dec 2017.
[30]
Power JF, Malloy BA (2004) A metrics suite for grammar-based software. Softw Mainten Evol 16(6):405-426.
[31]
Rajagopal I (2017) 10 awesome features of Python that you can't use because you refuse to upgrade to Python 3. http://www.asmeurer.com/python3-presentation/slides.html#1?utm_source=hashnode.com, Accessed 18 Dec 2017.
[32]
Sharma P, Savarimuthu BTR, Stanger N, Licorish SA, Rainer A (2017) Investigating developers' email discussions during decision-making in Python language evolution. In: International Conference on evaluation and assessment in software engineering. ACM, New York, pp 286-291.
[33]
Sipser M (2012) Introduction to the theory of computation. Cengage Learning.
[34]
Tempero E, Anslow C, Dietrich J, Han T, Li J, Lumpe M, Melton H, Noble J (2010) Qualitas corpus: a curated collection of Java code for empirical studies. In: Asia Pacific Software engineering conference, pp 336-345.
[35]
Toal R, Rivera R, Schneider A, Choe E (2016) Programming language explorations. CRC Press.
[36]
Urma RG (2017) Programming language evolution. Tech. Rep UCAM-CL-TR-902. Univ. of Cambridge, Computer Laboratory.
[37]
Urma RG, Orchard D, Mycroft A (2014) Programming language evolution workshop report. In: Workshop on programming language evolution, pp 1-3.
[38]
Wang B, Chen L, Ma W, Chen Z, Xu B (2015) An empirical study on the impact of Python dynamic features on change-proneness. In: International Conference on software engineering and knowledge engineering, pp 134-139.
[39]
Wikipedia (2017) Perl -- Wikipedia, the free encyclopedia. https://en.wikipedia.org/w/index.php?title=Perl&oldid=815811945, Accessed 21 Dec 2017.
[40]
Zaytsev V (2014) Negotiated grammar evolution. J Object Technol 13(3):1,1-22.

Cited By

View all
  • (2024)Tutorial Report on Legacy Software Modernization: A Journey From Non-AI to Generative AI ApproachesProceedings of the 17th Innovations in Software Engineering Conference10.1145/3641399.3641434(1-3)Online publication date: 22-Feb-2024
  • (2024)Deriving modernity signatures of codebases with static analysisJournal of Systems and Software10.1016/j.jss.2024.111973211:COnline publication date: 2-Jul-2024
  • (2024)Quality of interaction-based predictive model for support of online learning in pandemic situationsKnowledge and Information Systems10.1007/s10115-023-01995-366:3(1777-1805)Online publication date: 1-Mar-2024
  • Show More Cited By

Index Terms

  1. An empirical analysis of the transition from Python 2 to Python 3
    Index terms have been assigned to the content through auto-classification.

    Comments

    Information & Contributors

    Information

    Published In

    cover image Empirical Software Engineering
    Empirical Software Engineering  Volume 24, Issue 2
    April 2019
    519 pages

    Publisher

    Kluwer Academic Publishers

    United States

    Publication History

    Published: 01 April 2019

    Author Tags

    1. Compliance
    2. Programming language evolution
    3. Python programming

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)0
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 03 Sep 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Tutorial Report on Legacy Software Modernization: A Journey From Non-AI to Generative AI ApproachesProceedings of the 17th Innovations in Software Engineering Conference10.1145/3641399.3641434(1-3)Online publication date: 22-Feb-2024
    • (2024)Deriving modernity signatures of codebases with static analysisJournal of Systems and Software10.1016/j.jss.2024.111973211:COnline publication date: 2-Jul-2024
    • (2024)Quality of interaction-based predictive model for support of online learning in pandemic situationsKnowledge and Information Systems10.1007/s10115-023-01995-366:3(1777-1805)Online publication date: 1-Mar-2024
    • (2020)A large-scale comparative analysis of Coding Standard conformance in Open-Source Data Science projectsProceedings of the 14th ACM / IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM)10.1145/3382494.3410680(1-11)Online publication date: 5-Oct-2020
    • (2020)A longitudinal study of static analysis warning evolution and the effects of PMD on software quality in Apache open source projectsEmpirical Software Engineering10.1007/s10664-020-09880-125:6(5137-5192)Online publication date: 21-Sep-2020
    • (2019)Analysis and modeling of the governance in general programming languagesProceedings of the 12th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3357766.3359533(179-183)Online publication date: 20-Oct-2019

    View Options

    View options

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media