Publication | Closed Access
Suggesting natural method names to check name consistencies
64
Citations
35
References
2020
Year
Unknown Venue
Terminology ManagementEngineeringVerificationName GenerationSoftware EngineeringSource Code AnalysisSoftware AnalysisNatural Language ProcessingData ScienceComputational LinguisticsProgram FunctionalitySoftware MiningCode GenerationKnowledge DiscoveryTerminology ExtractionComputer ScienceNatural Method NamesCode RepresentationStatic Program AnalysisSoftware DesignFormal Concept AnalysisApi MisusesAutomated ReasoningProgram AnalysisSoftware TestingFormal Methods
Misleading names of the methods in a project or the APIs in a software library confuse developers about program functionality and API usages, leading to API misuses and defects. In this paper, we introduce MNire, a machine learning approach to check the consistency between the name of a given method and its implementation. MNire first generates a candidate name and compares the current name against it. If the two names are sufficiently similar, we consider the method as consistent. To generate the method name, we draw our ideas and intuition from an empirical study on the nature of method names in a large dataset. Our key finding is that high proportions of the tokens of method names can be found in the three contexts of a given method including its body, the interface (the method's parameter types and return type), and the enclosing class' name. Even when such tokens are not there, MNire uses the contexts to predict the tokens due to the high likelihoods of their co-occurrences. Our unique idea is to treat the name generation as an abstract summarization on the tokens collected from the names of the program entities in the three above contexts.
| Year | Citations | |
|---|---|---|
Page 1
Page 1