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

Is Static Analysis Able to Identify Unnecessary Source Code?

Published: 30 January 2020 Publication History
  • Get Citation Alerts
  • 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.

    References

    [1]
    I. Ahmed, U. A. Mannan, R. Gopinath, and C. Jensen. 2015. An empirical study of design degradation: How software projects get worse over time. In Proceedings of the International Symposium on Empirical Software Engineering and Measurement. IEEE, 1--10.
    [2]
    G. Canfora, L. Cerulo, M. Cimitile, and M. Di Penta. 2014. How changes affect software entropy: An empirical study. Empirical Software Engineering 19, 1 (2014), 1--38.
    [3]
    I. Şora. 2015. A PageRank based recommender system for identifying key classes in software systems. In Proceedings of the International Symposium on Applied Computational Intelligence and Informatics. IEEE, 495--500.
    [4]
    F. Deissenboeck, L. Heinemann, B. Hummel, and E. Juergens. 2010. Flexible architecture conformance assessment with ConQAT. In Proceedings of the International Conference on Software Engineering. ACM, 247--250.
    [5]
    F. Dreier. 2015. Detection of Refactorings. Bachelor’s thesis. Technical University of Munich. Retrieved October 18, 2019 from https://www.cqse.eu/publications/2015-detection-of-refactorings.pdf.
    [6]
    S. Eder, H. Femmer, B. Hauptmann, and M. Junker. 2014. Which features do my users (not) use? In Proceedings of the International Conference on Software Maintenance and Evolution. IEEE, 446--450.
    [7]
    S. Eder, M. Junker, E. Juergens, B. Hauptmann, R. Vaas, and K. H. Prommer. 2012. How much does unused code matter for maintenance? In Proceedings of the International Conference on Software Engineering. IEEE/ACM, 1102--1111.
    [8]
    M. Eichberg, B. Hermann, M. Mezini, and L. Glanz. 2015. Hidden truths in dead software paths. In Proceedings of the Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering. ACM, 474--484.
    [9]
    A. M. Fard and A. Mesbah. 2013. JsNose: Detecting JavaScript code smells. In Proceedings of the International Working Conference on Source Code Analysis and Manipulation. IEEE, 116--125.
    [10]
    T. Gee. 2016. Unused Code Detection in IntelliJ IDEA 2016.3. Retrieved October 18, 2019 from https://www.youtube.com/watch?v=43-JEsM8QDQ.
    [11]
    R. Haas. 2017. Identification of Unnecessary Source Code. Master’s thesis. Technical University of Munich.
    [12]
    L. Heinemann, B. Hummel, and D. Steidl. 2014. Teamscale: Software quality control in real-time. In Proceedings of the International Conference on Software Engineering. ACM, 592--595.
    [13]
    J. Spieler. 2019. UCDetector: Unnecessary Code Detector. Retrieved October 18, 2019 from http://www.ucdetector.org/.
    [14]
    D. Jannach (Ed.). 2011. Recommender Systems: An Introduction. Cambridge University Press.
    [15]
    Y. Jiang, D. Wu, and P. Liu. 2016. JRed: Program customization and bloatware mitigation based on static analysis. In Proceedings of the Annual Computer Software and Applications Conference. IEEE, 12--21.
    [16]
    E. Juergens, F. Deissenboeck, B. Hummel, and S. Wagner. 2009. Do code clones matter? In Proceedings of the International Conference on Software Engineering. IEEE, 485--495.
    [17]
    E. Juergens, M. Feilkas, M. Herrmannsdoerfer, F. Deissenboeck, R. Vaas, and K. H. Prommer. 2011. Feature profiling for evolving systems. In Proceedings of the International Conference on Program Comprehension. IEEE, 171--180.
    [18]
    J. Krinke. 2008. Is cloned code more stable than non-cloned code? In Proceedings of the International Working Conference on Source Code Analysis and Manipulation. IEEE, 57--66.
    [19]
    J. Krinke. 2011. Is cloned code older than non-cloned code? In Proceedings of the International Workshop on Software Clones. IEEE, 28--33.
    [20]
    M. M. Lehman and L. A. Belady (Eds.). 1985. Program Evolution: Processes of Software Change. Academic Press Professional.
    [21]
    S. B. Maurer. 2014. Directed acyclic graphs. In Handbook of Graph Theory. CRC Press, 180--195.
    [22]
    M. Mondal, C. K. Roy, Md. S. Rahman, R. K. Saha, J. Krinke, and K. A. Schneider. 2012. Comparative stability of cloned and non-cloned code: An empirical study. In Proceedings of the Annual Symposium on Applied Computing. ACM, 1227--1234.
    [23]
    R. Moser, W. Pedrycz, and G. Succi. 2008. A comparative analysis of the efficiency of change metrics and static code attributes for defect prediction. In Proceedings of the International Conference on Software Engineering. ACM, 181--190.
    [24]
    J. C. Munson and S. G. Elbaum. 1998. Code churn: A measure for estimating the impact of code change. In Proceedings of the International Conference on Software Maintenance. IEEE, 24--31.
    [25]
    D. L. Parnas. 1994. Software aging. In Proceedings of the International Conference on Software Engineering. IEEE/ACM, 279--287.
    [26]
    N. Redini, R. Wang, A. Machiry, Y. Shoshitaishvili, G. Vigna, and C. Kruegel. 2019. BinTrimmer: Towards static binary debloating through abstract interpretation. In Detection of Intrusions and Malware, and Vulnerability Assessment, Roberto Perdisci, Clémentine Maurice, Giorgio Giacinto, and Magnus Almgren (Eds.). Springer, 482--501.
    [27]
    M. P. Robillard, W. Maalej, R. J. Walker, and T. Zimmermann (Eds.). 2014. Recommendation Systems in Software Engineering. Springer.
    [28]
    P. Runeson and M. Höst. 2008. Guidelines for conducting and reporting case study research in software engineering. Empirical Software Engineering 14, 2 (2008), 131--164.
    [29]
    G. Scanniello. 2014. An investigation of object-oriented and code-size metrics as dead code predictors. In Proceedings of the EUROMICRO Conference on Software Engineering and Advanced Applications. IEEE, 392--397.
    [30]
    H. Sharif, M. Abubakar, A. Gehani, and F. Zaffar. 2018. TRIMMER: Application specialization for code debloating. In Proceedings of the International Conference on Automated Software Engineering. ACM, 329--339.
    [31]
    J. Siegmund, N. Siegmund, and S. Apel. 2015. Views on internal and external validity in empirical software engineering. In Proceedings of the International Conference on Software Engineering. IEEE, 9--19.
    [32]
    D. Steidl, B. Hummel, and E. Juergens. 2012. Using network analysis for recommendation of central software classes. In Proceedings of the Working Conference on Reverse Engineering. IEEE, 93--102.
    [33]
    F. Streitel, D. Steidl, and E. Jürgens. 2014. Dead code detection on class level. Softwaretechnik-Trends 34, 2 (2014).
    [34]
    Unknown. 2019. Reduce your app size. Retrieved October 18, 2019 from https://developer.android.com/topic/performance/reduce-apk-size#remove-unused.
    [35]
    H. Y. Yang, E. Tempero, and H. Melton. 2008. An empirical study into use of dependency injection in Java. In Proceedings of the Australian Conference on Software Engineering. IEEE, 239--247.
    [36]
    A. Zaidman and S. Demeyer. 2008. Automatic identification of key classes in a software system using webmining techniques. Journal of Software Maintenance and Evolution: Research and Practice 20, 6 (2008), 387--417.

    Cited By

    View all
    • (2024)A Folklore Confirmation on the Removal of Dead CodeProceedings of the 28th International Conference on Evaluation and Assessment in Software Engineering10.1145/3661167.3661188(333-338)Online publication date: 18-Jun-2024
    • (2024)Elysia: Optimizing JavaScript Web FrameworkProceedings of the 39th ACM/SIGAPP Symposium on Applied Computing10.1145/3605098.3636068(1789-1796)Online publication date: 8-Apr-2024
    • (2024)SPES: Towards Optimizing Performance-Resource Trade-Off for Serverless Functions2024 IEEE 40th International Conference on Data Engineering (ICDE)10.1109/ICDE60146.2024.00020(165-178)Online publication date: 13-May-2024
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Transactions on Software Engineering and Methodology
    ACM Transactions on Software Engineering and Methodology  Volume 29, Issue 1
    January 2020
    317 pages
    ISSN:1049-331X
    EISSN:1557-7392
    DOI:10.1145/3375995
    • Editor:
    • Mauro Pezzè
    Issue’s Table of Contents
    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].

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 30 January 2020
    Accepted: 01 October 2019
    Revised: 01 September 2019
    Received: 01 March 2019
    Published in TOSEM Volume 29, Issue 1

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Unnecessary code
    2. code centrality
    3. code stability

    Qualifiers

    • Research-article
    • Research
    • Refereed

    Funding Sources

    • Bundesministerium für Bildung und Forschung

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)57
    • Downloads (Last 6 weeks)5
    Reflects downloads up to 12 Aug 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)A Folklore Confirmation on the Removal of Dead CodeProceedings of the 28th International Conference on Evaluation and Assessment in Software Engineering10.1145/3661167.3661188(333-338)Online publication date: 18-Jun-2024
    • (2024)Elysia: Optimizing JavaScript Web FrameworkProceedings of the 39th ACM/SIGAPP Symposium on Applied Computing10.1145/3605098.3636068(1789-1796)Online publication date: 8-Apr-2024
    • (2024)SPES: Towards Optimizing Performance-Resource Trade-Off for Serverless Functions2024 IEEE 40th International Conference on Data Engineering (ICDE)10.1109/ICDE60146.2024.00020(165-178)Online publication date: 13-May-2024
    • (2023)A machine learning approach to predict DevOps readiness and adaptation in a heterogeneous IT environmentFrontiers in Computer Science10.3389/fcomp.2023.12147225Online publication date: 6-Oct-2023
    • (2023)FaaSLight: General Application-level Cold-start Latency Optimization for Function-as-a-Service in Serverless ComputingACM Transactions on Software Engineering and Methodology10.1145/358500732:5(1-29)Online publication date: 22-Feb-2023
    • (2023)Efficacy of Static Analysis Tools for Software Defect Detection on Open-Source Projects2023 International Conference on Computational Science and Computational Intelligence (CSCI)10.1109/CSCI62032.2023.00262(1588-1593)Online publication date: 13-Dec-2023
    • (2023)On the spread and evolution of dead methods in Java desktop applications: an exploratory studyEmpirical Software Engineering10.1007/s10664-023-10303-028:3Online publication date: 14-Apr-2023
    • (2022)Removing dependencies from large software projects: are you really sure?2022 IEEE 22nd International Working Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM55253.2022.00017(105-115)Online publication date: Oct-2022
    • (2022)On Quantifying the Benefits of Dead Code Removal2022 IEEE International Conference on Software Maintenance and Evolution (ICSME)10.1109/ICSME55016.2022.00076(563-563)Online publication date: Oct-2022
    • (2022)Automated evolution of feature logging statement levels using Git histories and degree of interestScience of Computer Programming10.1016/j.scico.2021.102724214:COnline publication date: 1-Feb-2022
    • Show More Cited By

    View Options

    Get Access

    Login options

    Full Access

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    HTML Format

    View this article in HTML Format.

    HTML Format

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media