Publication | Closed Access
Method name suggestion with hierarchical attention networks
29
Citations
42
References
2018
Year
Unknown Venue
Software MaintenanceStructured PredictionEngineeringMachine LearningSoftware EngineeringSource Code AnalysisSoftware AnalysisText MiningNatural Language ProcessingComputational LinguisticsLanguage StudiesMachine TranslationSource CodeCode GenerationNlp TaskLinguisticsTerminology ExtractionComputer ScienceCode RepresentationSoftware DesignCode RefactoringHierarchical StructureProgram AnalysisProgram ComprehensionMethod RenameMethod Name Suggestion
Method Rename has been a widely used refactoring operation that improves program comprehension and maintenance. Descriptive method names that summarize functionalities of source code can facilitate program comprehension. Much research has been done to suggest method names through source code summarization. However, unlike natural language, a code snippet consists of basic blocks organized by complicated structures. In this work, we observe a hierarchical structure --- tokens form basic blocks and basic blocks form a code snippet. Based on this observation, we exploit a hierarchical attention network to learn the representation of methods. Specifically, we apply two-level attention mechanism to learn the importance of each token in a basic block and that of a basic block in a method respectively. We evaluated our approach on 10 open source repositories and compared it against three state-of-the-art approaches. The results on these open-source data show the superiority of our hierarchical attention networks in terms of effectiveness.
| Year | Citations | |
|---|---|---|
Page 1
Page 1