Is Static Analysis Able to Identify Unnecessary Source Code?

Author:

Haas Roman1ORCID,Niedermayr Rainer2,Roehm Tobias3,Apel Sven4ORCID

Affiliation:

1. CQSE GmbH, Munich, Germany

2. University of Stuttgart, CQSE GmbH, Germany

3. CQSE GmbH, Stuttgart, Germany

4. Saarland University, Saarbrücken, Germany

Abstract

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.

Funder

Bundesministerium für Bildung und Forschung

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Cited by 15 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. A Folklore Confirmation on the Removal of Dead Code;Proceedings of the 28th International Conference on Evaluation and Assessment in Software Engineering;2024-06-18

2. SPES: Towards Optimizing Performance-Resource Trade-Off for Serverless Functions;2024 IEEE 40th International Conference on Data Engineering (ICDE);2024-05-13

3. Elysia: Optimizing JavaScript Web Framework;Proceedings of the 39th ACM/SIGAPP Symposium on Applied Computing;2024-04-08

4. Efficacy of Static Analysis Tools for Software Defect Detection on Open-Source Projects;2023 International Conference on Computational Science and Computational Intelligence (CSCI);2023-12-13

5. A machine learning approach to predict DevOps readiness and adaptation in a heterogeneous IT environment;Frontiers in Computer Science;2023-10-06

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3