Intelligent Code Completion with Bayesian Networks

被引:54
作者
Proksch, Sebastian [1 ]
Lerch, Johannes [1 ]
Mezini, Mira [1 ]
机构
[1] Tech Univ Darmstadt, D-64289 Darmstadt, Germany
关键词
Algorithms; Experimentation; Measurement; Performance; Content assist; code completion; integrated development environments; machine learning; evaluation; code recommender; productivity; RECOMMENDATION;
D O I
10.1145/2744200
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code completion is an integral part of modern Integrated Development Environments (IDEs). Developers often use it to explore Application Programming Interfaces (APIs). It is also useful to reduce the required amount of typing and to help avoid typos. Traditional code completion systems propose all type-correct methods to the developer. Such a list is often very long with many irrelevant items. More intelligent code completion systems have been proposed in prior work to reduce the list of proposed methods to relevant items. This work extends one of these existing approaches, the Best Matching Neighbor (BMN) algorithm. We introduce Bayesian networks as an alternative underlying model, use additional context information for more precise recommendations, and apply clustering techniques to improve model sizes. We compare our new approach, Pattern-based Bayesian Networks (PBN), to the existing BMN algorithm. We extend previously used evaluation methodologies and, in addition to prediction quality, we also evaluate model size and inference speed. Our results show that the additional context information we collect improves prediction quality, especially for queries that do not contain method calls. We also show that PBN can obtain comparable prediction quality to BMN, while model size and inference speed scale better with large input sizes.
引用
收藏
页数:31
相关论文
共 31 条
[1]  
Nguyen AT, 2012, PROC INT CONF SOFTW, P69, DOI 10.1109/ICSE.2012.6227205
[2]  
[Anonymous], 2003, Agile Software Development: Principles, Patterns, and Practices
[3]  
[Anonymous], 1993, Usability Engineering, Vfirst, P165
[4]  
[Anonymous], IJCAI 2001 WORKSHOP
[5]   Learning from Examples to Improve Code Completion Systems [J].
Bruch, Marcel ;
Monperrus, Martin ;
Mezini, Mira .
7TH JOINT MEETING OF THE EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND THE ACM SIGSOFT SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2009, :213-222
[6]  
Bruch Marcel., 2006, P 4 OOPSLA WORKSHOP, P55, DOI [10.1145/1188835.1188847, DOI 10.1145/1188835.1188847]
[7]  
Bruch Marcel, 2008, P INT WORKSH REC SYS
[8]  
Buse RPL, 2012, PROC INT CONF SOFTW, P782, DOI 10.1109/ICSE.2012.6227140
[9]  
Chapelle Olivier, 2009, P 18 INT C WORLD WID, P1, DOI [DOI 10.1145/1526709.1526711, 10.1145/1526709, DOI 10.1145/1526709]
[10]  
Chen S.F., 1996, P ACL