An Empirical Study for Common Language Features Used in Python']Python Projects

被引:16
|
作者
Peng, Yun [1 ]
Zhang, Yu [1 ]
Hu, Mingzhe [1 ]
机构
[1] Univ Sci & Technol China, Lab Intelligent Networking & Knowledge Engn LINKE, Hefei, Peoples R China
基金
中国国家自然科学基金;
关键词
D O I
10.1109/SANER50967.2021.00012
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
As a dynamic programming language, Python is widely used in many fields. For developers, various language features affect programming experience. For researchers, they affect the difficulty of developing tasks such as bug finding and compilation optimization. Former research has shown that programs with Python dynamic features are more change-prone. However, we know little about the use and impact of Python language features in real-world Python projects. To resolve these issues, we systematically analyze Python language features and propose a tool named PYSCAN to automatically identify the use of 22 kinds of common Python language features in 6 categories in Python source code. We conduct an empirical study on 35 popular Python projects from eight application domains, covering over 4.3 million lines of code, to investigate the the usage of these language features in the project. We find that single inheritance, decorator, keyword argument, for loops and nested classes are top 5 used language features. Meanwhile different domains of projects may prefer some certain language features. For example, projects in DevOps use exception handling frequently. We also conduct in-depth manual analysis to dig extensive using patterns of frequently but differently used language features: exceptions, decorators and nested classes/functions. We find that developers care most about ImportError when handling exceptions. With the empirical results and in-depth analysis, we conclude with some suggestions and a discussion of implications for three groups of persons in Python community: Python designers, Python compiler designers and Python developers.
引用
收藏
页码:24 / 35
页数:12
相关论文
共 50 条
  • [1] An Empirical Study of Dynamic Types for Python']Python Projects
    Xia, Xinmeng
    He, Xincheng
    Yan, Yanyan
    Xu, Lei
    Xu, Baowen
    [J]. SOFTWARE ANALYSIS, TESTING, AND EVOLUTION, SATE 2018, 2018, 11293 : 85 - 100
  • [2] An Empirical Study of Type-Related Defects in Python']Python Projects
    Khan, Faizan
    Chen, Boqi
    Varro, Daniel
    McIntosh, Shane
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (08) : 3145 - 3158
  • [3] Are there any Unit Tests? An Empirical Study on Unit Testing in Open Source Python']Python Projects
    Trautsch, Fabian
    Grabowski, Jens
    [J]. 2017 10TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION (ICST), 2017, : 207 - 218
  • [4] Empirical Study of Python']Python Call Graph
    Li, Yu
    [J]. 34TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2019), 2019, : 1274 - 1276
  • [5] An Empirical Study of Flaky Tests in Python']Python
    Gruber, Martin
    Lukasczyk, Stephan
    Krois, Florian
    Fraser, Gordon
    [J]. 2021 14TH IEEE CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION (ICST 2021), 2021, : 148 - 158
  • [6] An Empirical Study on Bugs in Python']Python Interpreters
    Wang, Ziyuan
    Bu, Dexin
    Sun, Aiyue
    Gou, Shanyi
    Wang, Yong
    Chen, Lin
    [J]. IEEE TRANSACTIONS ON RELIABILITY, 2022, 71 (02) : 716 - 734
  • [7] Quantifying the Transition from Python']Python 2 to 3: An Empirical Study of Python']Python Applications
    Malloy, Brian A.
    Power, James F.
    [J]. 11TH ACM/IEEE INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING AND MEASUREMENT (ESEM 2017), 2017, : 314 - 323
  • [8] An empirical study of fault localization in Python']Python programs
    Rezaalipour, Mohammad
    Furia, Carlo A.
    [J]. EMPIRICAL SOFTWARE ENGINEERING, 2024, 29 (04)
  • [9] The Evolution of Type Annotations in Python']Python: An Empirical Study
    Di Grazia, Luca
    Pradel, Michael
    [J]. PROCEEDINGS OF THE 30TH ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2022, 2022, : 209 - 220
  • [10] On the Security of Python']Python Virtual Machines: An Empirical Study
    Lin, Xinrong
    Hua, Baojian
    Fan, Qiliang
    [J]. 2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2022), 2022, : 223 - 234