skip to main content
10.1145/3661167.3661188acmotherconferencesArticle/Chapter ViewAbstractPublication PageseaseConference Proceedingsconference-collections
short-paper
Open access

A Folklore Confirmation on the Removal of Dead Code

Published: 18 June 2024 Publication History

Abstract

In this folklore-confirmation short paper, we present the results of a study on the removal of dead code. We aim to gather evidence on the impact of dead-method removal on the internal structure of source code and the usage of resources such as compilation time and space to store executable code. To that end, we studied 23 open-source Java desktop applications hosted on GitHub. We cleaned up each of these applications from its dead methods to obtain two versions: one with dead methods (i.e., original version) and another one without them (i.e., cleaned version). For each of these applications, we compared its versions (original and cleaned) to determine whether, and to what extent, the removal of dead methods affects the internal structure of source code and the usage of resources. We observed that, after removing dead methods, the internal structure of source code significantly improves, while the time to compile source code significantly diminishes as well as the space to store executable code.

References

[1]
Victor Basili, Gianluigi Caldiera, and H. Dieter Rombach. 2002. Goal Question Metric (GQM) Approach. John Wiley & Sons, Ltd, 528–532. https://doi.org/10.1002/0471028959.sof142
[2]
Hidde Boomsma, B. V. Hostnet, and Hans-Gerhard Gross. 2012. Dead code elimination for web systems written in PHP: Lessons learned from an industry case. In 2012 28th IEEE International Conference on Software Maintenance (ICSM). 511–515. https://doi.org/10.1109/ICSM.2012.6405314
[3]
William H. Brown, Raphael C. Malveau, Hays W. "Skip" McCormick, and Thomas J. Mowbray. 1998. AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis (1st ed.). John Wiley & Sons, Inc.
[4]
Danilo Caivano, Pietro Cassieri, Simone Romano, and Giuseppe Scanniello. 2021. An Exploratory Study on Dead Methods in Open-source Java Desktop Applications. In Proceedings of the 15th ACM / IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM). ACM, Article 10, 11 pages. https://doi.org/10.1145/3475716.3475773
[5]
Danilo Caivano, Pietro Cassieri, Simone Romano, and Giuseppe Scanniello. 2023. On the spread and evolution of dead methods in Java desktop applications: an exploratory study. Empirical Software Engineering 28, 3 (2023), 64. https://doi.org/10.1007/s10664-023-10303-0
[6]
G. Ann Campbell. 2018. Cognitive Complexity — An Overview and Evaluation. In 2018 IEEE/ACM International Conference on Technical Debt (TechDebt). ACM, 57–58. https://doi.org/10.1145/3194164.3194186
[7]
Pietro Cassieri, Simone Romano, Giuseppe Scanniello, Genoveffa Tortora, and Danilo Caivano. 2022. Do Developers Modify Dead Methods during the Maintenance of Java Desktop Applications?. In Proceedings of the 26th International Conference on Evaluation and Assessment in Software Engineering. ACM, 120–129. https://doi.org/10.1145/3530019.3530032
[8]
Sebastian Eder, Maximilian Junker, Elmar Jürgens, Benedikt Hauptmann, Rudolf Vaas, and Karl-Heinz Prommer. 2012. How much does unused code matter for maintenance?. In 2012 34th International Conference on Software Engineering (ICSE). IEEE, 1102–1111. https://doi.org/10.1109/ICSE.2012.6227109
[9]
Amin Milani Fard and Ali Mesbah. 2013. JSNOSE: Detecting JavaScript Code Smells. In 2013 IEEE 13th International Working Conference on Source Code Analysis and Manipulation (SCAM). IEEE, 116–125. https://doi.org/10.1109/SCAM.2013.6648192
[10]
Martin Fowler. 1999. Refactoring: Improving the Design of Existing Code (1st ed.). Addison-Wesley.
[11]
Roman Haas, Rainer Niedermayr, Tobias Roehm, and Sven Apel. 2020. Is Static Analysis Able to Identify Unnecessary Source Code?ACM Transactions on Software Engineering and Methodology 29, 1, Article 6 (2020), 23 pages. https://doi.org/10.1145/3368267
[12]
Ivano Malavolta, Kishan Nirghin, Gian Luca Scoccia, Simone Romano, Salvatore Lombardi, Giuseppe Scanniello, and Patricia Lago. 2023. JavaScript Dead Code Identification, Elimination, and Empirical Assessment. IEEE Transactions on Software Engineering 49, 7 (2023), 3692–3714. https://doi.org/10.1109/TSE.2023.3267848
[13]
Salvatore Mangiafico. 2023. Summary and Analysis of Extension Program Evaluation in R.
[14]
Mika Mäntylä, Jari Vanhanen, and Casper Lassenius. 2003. A taxonomy and an initial empirical study of bad smells in code. In International Conference on Software Maintenance, 2003. ICSM 2003. Proceedings.IEEE, 381–384. https://doi.org/10.1109/ICSM.2003.1235447
[15]
Diego Marcilio, Rodrigo Bonifácio, Eduardo Monteiro, Edna Canedo, Welder Luz, and Gustavo Pinto. 2019. Are Static Analysis Violations Really Fixed? A Closer Look at Realistic Usage of SonarQube. In 2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC). IEEE, 209–219. https://doi.org/10.1109/ICPC.2019.00040
[16]
Robert C. Martin. 2008. Clean Code: A Handbook of Agile Software Craftsmanship (1st ed.). Prentice Hall.
[17]
Thomas J. McCabe. 1976. A Complexity Measure. IEEE Transactions on Software Engineering SE-2, 4 (1976), 308–320. https://doi.org/10.1109/TSE.1976.233837
[18]
Marvin Muñoz Barón, Marvin Wyrich, and Stefan Wagner. 2020. An Empirical Validation of Cognitive Complexity as a Measure of Source Code Understandability. In Proceedings of the 14th ACM / IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM). ACM, Article 5, 12 pages. https://doi.org/10.1145/3382494.3410636
[19]
Niels Groot Obbink, Ivano Malavolta, Gian Luca Scoccia, and Patricia Lago. 2018. An extensible approach for taming the challenges of JavaScript dead code elimination. In 2018 IEEE 25th International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, 291–401. https://doi.org/10.1109/SANER.2018.8330226
[20]
Simone Romano. 2024. Replication Package of “A Folklore Confirmation on the Removal of Dead Code”. https://doi.org/10.6084/m9.figshare.24417961.v1
[21]
Simone Romano and Giuseppe Scanniello. 2018. Exploring the Use of Rapid Type Analysis for Detecting the Dead Method Smell in Java Code. In 2018 44th Euromicro Conference on Software Engineering and Advanced Applications (SEAA). IEEE, 167–174. https://doi.org/10.1109/SEAA.2018.00035
[22]
Simone Romano, Christopher Vendome, Giuseppe Scanniello, and Denys Poshyvanyk. 2016. Are unreachable methods harmful? Results from a controlled experiment. In 2016 IEEE 24th International Conference on Program Comprehension (ICPC). IEEE, 1–10. https://doi.org/10.1109/ICPC.2016.7503723
[23]
Simone Romano, Christopher Vendome, Giuseppe Scanniello, and Denys Poshyvanyk. 2020. A Multi-Study Investigation into Dead Code. IEEE Transactions on Software Engineering 46, 1 (2020), 71–99. https://doi.org/10.1109/TSE.2018.2842781
[24]
Giuseppe Scanniello. 2011. Source code survival with the Kaplan Meier. In 2011 27th IEEE International Conference on Software Maintenance (ICSM). IEEE, 524–527. https://doi.org/10.1109/ICSM.2011.6080823
[25]
Giuseppe Scanniello. 2014. An Investigation of Object-Oriented and Code-Size Metrics as Dead Code Predictors. In 2014 40th EUROMICRO Conference on Software Engineering and Advanced Applications. IEEE, 392–397. https://doi.org/10.1109/SEAA.2014.67
[26]
Daniel Ståhl, Antonio Martini, and Torvald Mårtensson. 2019. Big Bangs and Small Pops: On Critical Cyclomatic Complexity and Developer Integration Behavior. In 2019 IEEE/ACM 41st International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP). IEEE, 81–90. https://doi.org/10.1109/ICSE-SEIP.2019.00017
[27]
Michele Tufano, Fabio Palomba, Gabriele Bavota, Rocco Oliveto, Massimiliano Di Penta, Andrea De Lucia, and Denys Poshyvanyk. 2017. When and Why Your Code Starts to Smell Bad (and Whether the Smells Go Away). IEEE Transactions on Software Engineering 43, 11 (2017), 1063–1088. https://doi.org/10.1109/TSE.2017.2653105
[28]
Carmine Vassallo, Sebastiano Panichella, Fabio Palomba, Sebastian Proksch, Andy Zaidman, and Harald C. Gall. 2018. Context is king: The developer perspective on the usage of static analysis tools. In 2018 IEEE 25th International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, 38–49. https://doi.org/10.1109/SANER.2018.8330195
[29]
Hernán C. Vázquez, Alexandre Bergel, Santiago Vidal, Jorge A. Díaz Pace, and Claudia Marcos. 2019. Slimming javascript applications: An approach for removing unused functions from javascript libraries. Information and Software Technology 107 (2019), 18–29. https://doi.org/10.1016/j.infsof.2018.10.009
[30]
William C. Wake. 2003. Refactoring Workbook (1st ed.). Addison-Wesley.
[31]
Claes Wohlin, Per Runeson, Martin Hst, Magnus C. Ohlsson, Bjrn Regnell, and Anders Wessln. 2012. Experimentation in Software Engineering. Springer.
[32]
Aiko Yamashita and Leon Moonen. 2013. Do developers care about code smells? An exploratory survey. In 2013 20th Working Conference on Reverse Engineering (WCRE). IEEE, 242–251. https://doi.org/10.1109/WCRE.2013.6671299

Cited By

View all
  • (2024)A Confirmation Study on the Removal of Dead Code from Java Desktop Applications2024 50th Euromicro Conference on Software Engineering and Advanced Applications (SEAA)10.1109/SEAA64295.2024.00041(222-225)Online publication date: 28-Aug-2024

Index Terms

  1. A Folklore Confirmation on the Removal of Dead Code

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    EASE '24: Proceedings of the 28th International Conference on Evaluation and Assessment in Software Engineering
    June 2024
    728 pages
    ISBN:9798400717017
    DOI:10.1145/3661167
    Permission to make digital or hard copies of part or all 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 third-party components of this work must be honored. For all other uses, contact the Owner/Author.

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 18 June 2024

    Check for updates

    Author Tags

    1. Dead code
    2. Optimization
    3. Refactoring

    Qualifiers

    • Short-paper
    • Research
    • Refereed limited

    Conference

    EASE 2024

    Acceptance Rates

    Overall Acceptance Rate 71 of 232 submissions, 31%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)238
    • Downloads (Last 6 weeks)48
    Reflects downloads up to 05 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)A Confirmation Study on the Removal of Dead Code from Java Desktop Applications2024 50th Euromicro Conference on Software Engineering and Advanced Applications (SEAA)10.1109/SEAA64295.2024.00041(222-225)Online publication date: 28-Aug-2024

    View Options

    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

    Login options

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media