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 条
[11]   NEAREST NEIGHBOR PATTERN CLASSIFICATION [J].
COVER, TM ;
HART, PE .
IEEE TRANSACTIONS ON INFORMATION THEORY, 1967, 13 (01) :21-+
[12]   Complete Completion using Types and Weights [J].
Gvero, Tihomir ;
Kuncak, Viktor ;
Kuraj, Ivan ;
Piskac, Ruzica .
ACM SIGPLAN NOTICES, 2013, 48 (06) :27-38
[13]   Identifier-Based Context-Dependent API Method Recommendation [J].
Heinemann, Lars ;
Bauer, Veronika ;
Herrmannsdoerfer, Markus ;
Hummel, Benjamin .
2012 16TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING (CSMR), 2012, :31-40
[14]  
Hindle A, 2012, PROC INT CONF SOFTW, P837, DOI 10.1109/ICSE.2012.6227135
[15]  
Li Z., 2005, P 10 EUR SOFTW ENG C, V30, P306, DOI [DOI 10.1145/1081706.1081755, 10.1145/1095430.1081755]
[16]  
Livshits V.B., 2005, ACM SIGSOFT Software Engineering Notes, P296, DOI DOI 10.1145/1081706.1081754
[17]  
McCallum A., 2000, Proceedings. KDD-2000. Sixth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, P169, DOI 10.1145/347090.347123
[18]  
Michail A., 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium, P167, DOI 10.1109/ICSE.2000.870408
[19]  
Monperrus M, 2010, LECT NOTES COMPUT SC, V6183, P2, DOI 10.1007/978-3-642-14107-2_2
[20]  
Nagappan M, 2013, Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2013, page, P466, DOI [DOI 10.1145/2491411.2491415, 10.1145/2491411.2491415]