Is Static Analysis Able to Identify Unnecessary Source Code?

被引:13
|
作者
Haas, Roman [1 ]
Niedermayr, Rainer [1 ,2 ]
Roehm, Tobias [1 ]
Apel, Sven [3 ]
机构
[1] CQSE GmbH, Munich, Germany
[2] Univ Stuttgart, Stuttgart, Germany
[3] Saarland Univ, Saarbrucken, Germany
关键词
Unnecessary code; code stability; code centrality;
D O I
10.1145/3368267
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Grown software systems often contain code that is not necessary anymore. Such unnecessary code wastes resources during development and maintenance, for example, when preparing code for migration or certification. Running a profiler may reveal code that is not used in production, but it is often time-consuming to obtain representative data in this way. We investigate to what extent a static analysis approach, which is based on code stability and code centrality, is able to identify unnecessary code and whether its recommendations are relevant in practice. To study the feasibility and usefulness of our approach, we conducted a study involving 14 open-source and closed-source software systems. As there is no perfect oracle for unnecessary code, we compared recommendations for unnecessary code with historical cleanups, runtime usage data, and feedback from 25 developers of five software projects. Our study shows that recommendations generated from stability and centrality information point to unnecessary code that cannot be identified by dead code detectors. Developers confirmed that 34% of recommendations were indeed unnecessary and deleted 20% of the recommendations shortly after our interviews. Overall, our results suggest that static analysis can provide quick feedback on unnecessary code and is useful in practice.
引用
收藏
页数:23
相关论文
共 50 条
  • [1] Poster: Recommending Unnecessary Source Code Based on Static Analysis
    Haas, Roman
    Niedermayr, Rainer
    Roehm, Tobias
    Apel, Sven
    [J]. 2019 IEEE/ACM 41ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS (ICSE-COMPANION 2019), 2019, : 274 - 275
  • [2] Integration of Static and Dynamic Code Analysis for Understanding Legacy Source Code
    Kirchmayr, Wilhelm
    Moser, Michael
    Nocke, Ludwig
    Pichler, Josef
    Tober, Rudolf
    [J]. 32ND IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2016), 2016, : 543 - 552
  • [3] From Source Code Analysis to Static Software Testing
    Wang Wei
    Han Lilong
    Meng Yunxiu
    Bai He
    [J]. PROCEEDINGS OF 2014 IEEE WORKSHOP ON ADVANCED RESEARCH AND TECHNOLOGY IN INDUSTRY APPLICATIONS (WARTIA), 2014, : 1280 - 1283
  • [4] A Proposal for Source Code Assessment Through Static Analysis
    de Souza, Ricardo Lemos
    Ferreira, Fabiana Zaffalon
    Botelho, Silvia da Silva
    [J]. 2020 IEEE FRONTIERS IN EDUCATION CONFERENCE (FIE 2020), 2020,
  • [5] An Effective Visual System for Static Analysis of Source Code
    Wan, Ying
    Tan, Chuanqi
    Wang, Zhigang
    Wang, Guoqiang
    Hong, Xiaojin
    [J]. MATERIALS SCIENCE AND INFORMATION TECHNOLOGY, PTS 1-8, 2012, 433-440 : 5453 - +
  • [6] Static analysis of source code written by novice programmers
    Delev, Tomche
    Gjorgjevikj, Dejan
    [J]. PROCEEDINGS OF 2017 IEEE GLOBAL ENGINEERING EDUCATION CONFERENCE (EDUCON2017), 2017, : 824 - 830
  • [7] STATIC ANALYSIS OF PROGRAM SOURCE CODE USING EDSA
    VANEK, LI
    CULP, MN
    [J]. CONFERENCE ON SOFTWARE MAINTENANCE - 1989, PROCEEDINGS, 1989, : 192 - 199
  • [8] On Development of a Framework for Massive Source Code Analysis Using Static Code Analyzers
    Chistyakov, Alexander
    Pripadchev, Artem
    Radchenko, Irina
    [J]. CEE-SECR'17: PROCEEDINGS OF THE 13TH CENTRAL & EASTERN EUROPEAN SOFTWARE ENGINEERING CONFERENCE IN RUSSIA, 2017,
  • [9] An Approach for Detecting Unnecessary Cyclomatic Complexity on Source Code
    Campos Junior, H. S.
    Martins Filho, L. R. V.
    Araujo, M. A. P.
    [J]. IEEE LATIN AMERICA TRANSACTIONS, 2016, 14 (08) : 3777 - 3783
  • [10] JxPlatform: A Tool Platform for Static Analysis of Java Source Code
    Maruyama, Katsuhisa
    [J]. Computer Software, 2024, 41 (04) : 28 - 48