T2API: Synthesizing API Code Usage Templates from English Texts with Statistical Translation

被引:35
作者
Thanh Nguyen [1 ]
Rigby, Peter C. [2 ]
Anh Tuan Nguyen [1 ]
Karanfil, Mark [2 ]
Nguyen, Tien N. [3 ]
机构
[1] Iowa State Univ, Ames, IA 50011 USA
[2] Concordia Univ, Montreal, PQ, Canada
[3] Univ Texas Dallas, Richardson, TX 75083 USA
来源
FSE'16: PROCEEDINGS OF THE 2016 24TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON FOUNDATIONS OF SOFTWARE ENGINEERING | 2016年
关键词
Text-to-Code Translation; API Usage Synthesis; Graph-based Statistical Machine Translation;
D O I
10.1145/2950290.2983931
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
In this work, we develop T2API, a statistical machine translation-based tool that takes a given English description of a programming task as a query, and synthesizes the API usage template for the task by learning from training data. T2API works in two steps. First, it derives the API elements relevant to the task described in the input by statistically learning from a StackOverflow corpus of text descriptions and corresponding code. To infer those API elements, it also considers the context of the words in the textual input and the context of API elements that often go together in the corpus. The inferred API elements with their relevance scores are ensembled into an API usage by our novel API usage synthesis algorithm that learns the API usages from a large code corpus via a graph-based language model. Importantly, T2API is capable of generating new API usages from smaller, previously-seen usages.
引用
收藏
页码:1013 / 1017
页数:5
相关论文
共 28 条
[1]  
Allamanis M., 2015, P 32 INT C MACH LEAR
[2]   Suggesting Accurate Method and Class Names [J].
Allamanis, Miltiadis ;
Barr, Earl T. ;
Bird, Christian ;
Sutton, Charles .
2015 10TH JOINT MEETING OF THE EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND THE ACM SIGSOFT SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (ESEC/FSE 2015) PROCEEDINGS, 2015, :38-49
[3]   Learning Natural Coding Conventions [J].
Allamanis, Miltiadis ;
Barr, Earl T. ;
Bird, Christian ;
Sutton, Charles .
22ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (FSE 2014), 2014, :281-293
[4]  
Allamanis M, 2013, IEEE WORK CONF MIN S, P207, DOI 10.1109/MSR.2013.6624029
[5]  
[Anonymous], P 37 INT C SOFTW ENG
[6]  
[Anonymous], 2010, Statistical Machine Translation
[7]  
[Anonymous], 2007, P 22 IEEE ACM INT C
[8]  
Bacchelli A., 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering, P476, DOI 10.1109/ASE.2011.6100103
[9]  
Bajracharya S., 2006, COMP 21 ACM SIGPLAN, P681, DOI DOI 10.1145/1176617.1176671
[10]   When, How, and Why Developers (Do Not) Test in Their IDEs [J].
Beller, Moritz ;
Gousios, Georgios ;
Panichella, Annibale ;
Zaidman, Andy .
2015 10TH JOINT MEETING OF THE EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND THE ACM SIGSOFT SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (ESEC/FSE 2015) PROCEEDINGS, 2015, :179-190