Class Name Recommendation based on Graph Embedding of Program Elements
This is the presentation for the paper, "Class Name Recommendation based on Graph Embedding of Program Elements" at the 26th Asia-Pacific Software Engineering Conference (APSEC2019).
I'm the first author of this paper.
element Program Elements Program components representing properties or behaviors, such as classes, methods, and fields Introduction | Program Elements & Identifier Names
names greatly affects program comprehension [Takang et al., 1996] 6TFS"DDPVOU*OGP $MBTT"#$ Important Appropriate names enable developers to spend less time on program comprehension [Lawrie et al., 2006]
names by association rule mining [Fukuda et al., 2015] The content of a class is beneficial to recommend class names Low accuracy Embedding is beneficial to recommend identifier names Recommendation is not available before a program element is used somewhere Rule Recommended identifier names by embedding with Skip-gram [Allamanis et al., 2015] ?
Recommendation is available before a method is used Embed a graph that represents the relationships between classes, methods, and fields Introduced heterogeneous graph embedding Higher accuracy than those of homogeneous Basically extends this work DPOOFDU ? XSJUF OFXMJOF [Yonai et al., 2019] Extension inspired by this work [Dong et al., 2017] Proposed | Key Idea
(3) (4) \ ^ N N G Model (1) Extract relationships (2) Learn embedding (3) Obtain embedding of a target class (4) Recommend class names Train Recommend Proposed | Overview
the weighted sum of those of program elements that have relationship with the target Proposed | (2) Learning Embedding : Field : Target class : Class : Method : Weighted sum of program elements related to the target class
the weighted sum of those of program elements that have relationship with the target Proposed | (2) Learning Embedding : Field : Target class : Class : Method : Weighted sum of program elements related to the target class
the weighted sum of those of program elements that have relationship with the target Proposed | (2) Learning Embedding : Field : Target class : Class : Method : Weighted sum of program elements related to the target class
the weighted sum of those of program elements that have relationship with the target Proposed | (2) Learning Embedding : Field : Target class : Class : Method : Weighted sum of program elements related to the target class
the weighted sum of those of program elements that have relationship with the target Proposed | (2) Learning Embedding : Field : Target class : Class : Method : Weighted sum of program elements related to the target class
the weighted sum of those of program elements that have relationship with the target Proposed | (2) Learning Embedding : Field : Target class : Class : Method : Weighted sum of program elements related to the target class
the weighted sum of those of program elements that have relationship with the target Proposed | (2) Learning Embedding : Field : Target class : Class : Method : Weighted sum of program elements related to the target class
the weighted sum of those of program elements that have relationship with the target Proposed | (2) Learning Embedding : Field : Target class : Class : Method : Weighted sum of program elements related to the target class
relation by homogeneous embedding Proposed | Novelty Proposed approach Consider 7 relationships, between class, method, field relations by heterogeneous embedding
Given a code including a target class 2. Obtain the embedding of the target class from owned methods and fields by procedure (2) $PEFJODMVEJOH BUBSHFUDMBTT : Class : Method : Field : Target class Proposed | (3) Obtaining the Embedding of a Target Class
20 large Java projects, such as ElasticSearch, Clojure [Allamanis et al., 2015] The quality of identifier names is assured because many developers maintain for years Experiments | Dataset
class is used l with high accuracy Task Class name recommendation (before a class is used) Criterion The ratio of the recommended names that match partially the actual name within the top-10 Experiments | 1. Recommendation before a class is used
a class is used Task Class name recommendation (after a class is used) Criterion The ratio of the recommended names that match partially the actual name within the top-10 Experiments | 2. Recommendation after a class is used
Class name recommendation (before & after a class is used) Criterion The ratio of the recommended names that match partially the actual name within the top-10 Experiments | 3. Where does the proposed work well?
a class is used and with high accuracy 2. Our approach would work better (1) after a class is used (2) where a class has relations with all types of program elements
before a class is used (2) with high accuracy Accomplishment Proposed a class name recommendation approach based on graph embedding of program elements Future work l Step by step recommendation l Combining another approach such as rule mining Conclusion The code and notebook is available: https://github.com/kuri8ive/apsec2019class