An Empirical Evaluation of Method Signature Similarity in Java Codebases

TR Number

Date

2024-09-11

Journal Title

Journal ISSN

Volume Title

Publisher

ACM

Abstract

Modern programming languages have transformed software development by providing capabilities of enhancing productivity and reducing code redundancy. One such feature is allowing developers to choose meaningful method names for implementation and functionality. As programs evolve into APIs and libraries, developers often design methods with similar signatures to streamline code management and improve comprehensibility.

In this paper, we conduct a comprehensive study to evaluate the prevalence, usage, and perception of methods with similar signatures, including both conventionally overloaded and textually similar methods. Through analyzing 6.4 million lines of code across 167 well-established Java repositories on GitHub, we statistically assess the occurrence of these methods and their impact on usability and software quality. Additionally, we explore the evolution of these methods through a longitudinal analysis of historical commit snapshots. Our research reveals that both overloaded and textually similar methods are common in leading Java repositories and are primarily driven by specific software design requirements, program logic, and developer’s programming habits. As software matures, development shifts towards maintenance tasks that rarely necessitate design changes. Our longitudinal analysis corroborates this by indicating minimal changes in methods with similar signatures in the later stages of a repository’s life.

Description

Keywords

Citation