Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1109/ICSE-C.2017.81acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Statistical translation of English texts to API code templates

Published: 20 May 2017 Publication History

Abstract

We develop T2Api, a context-sensitive, graph-based statistical translation approach that takes as input an English description of a programming task and synthesizes the corresponding API code template for the task. We train T2Api to statistically learn the alignments between English and APIs and determine the relevant API elements. The training is done on StackOverflow, which is a bilingual corpus on which developers discuss programming problems in two types of language: English and programming language. T2Api considers both the context of the words in the input query and the context of API elements that often go together in the corpus. The derived API elements with their relevance scores are assembled into an API usage by GraSyn, our novel graph-based API synthesis algorithm that generates a graph representing an API usage from a large code corpus. Importantly, it is capable of generating new API usages from previously seen sub-usages.

References

[1]
E. Duala-Ekoko and M. P. Robillard, "Asking and answering questions about unfamiliar APIs: An exploratory study," in Proceedings of the 34th International Conference on Software Engineering, ser. ICSE'12. IEEE Press, 2012, pp. 266--276.
[2]
E. Duala-Ekoko and M. P. Robillard, "Using structure-based recommendations to facilitate discoverability in APIs," in Proceedings of the 25th European Conference on Object-oriented Programming, ser. ECOOP'11. Springer-Verlag, 2011, pp. 79--104.
[3]
X. Gu, H. Zhang, D. Zhang, and S. Kim, "Deep API Learning," in Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, ser. FSE 2016. ACM, 2016, pp. 631--642.
[4]
C. McMillan, M. Grechanik, D. Poshyvanyk, Q. Xie, and C. Fu, "Portfolio: Finding relevant functions and their usage," in Proceedings of the 33rd International Conference on Software Engineering, ser. ICSE'11. ACM, 2011, pp. 111--120.
[5]
C. McMillan, D. Poshyvanyk, and M. Grechanik, "Recommending Source Code Examples via API Call Usages and Documentation," in Proceedings of the 2nd International Workshop on Recommendation Systems for Software Engineering, ser. RSSE '10. ACM, 2010, pp. 21--25.
[6]
W. Zheng, Q. Zhang, and M. Lyu, "Cross-library API recommendation using Web search engines," in Proceedings of the 19th ACM SIGSOFT Symposium and the 13th European Conference on Foundations of Software Engineering, ser. ESEC/FSE '11. ACM, 2011, pp. 480--483.
[7]
W.-K. Chan, H. Cheng, and D. Lo, "Searching Connected API Subgraph via Text Phrases," in Proceedings of the 20th International Symposium on the Foundations of Software Engineering, ser. FSE '12. ACM, 2012, pp. 10:1--10:11.
[8]
R. P. L. Buse and W. Weimer, "Synthesizing API Usage Examples," in Proceedings of the 34th International Conference on Software Engineering, ser. ICSE '12. IEEE Press, 2012, pp. 782--792.
[9]
M. Raghothaman, Y. Wei, and Y. Hamadi, "Swim: Synthesizing what i mean: Code search and idiomatic snippet synthesis," in Proceedings of the 38th International Conference on Software Engineering, ser. ICSE'16. ACM, 2016, pp. 357--367.
[10]
T. Gvero and V. Kuncak, "Synthesizing Java expressions from free-form queries," in Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, ser. OOPSLA 2015. ACM, 2015, pp. 416--432.
[11]
A. Desai, S. Gulwani, V. Hingorani, N. Jain, A. Karkare, M. Marron, S. R, and S. Roy, "Program synthesis using natural language," in Proceedings of the 38th International Conference on Software Engineering, ser. ICSE'16. ACM, 2016, pp. 345--356.
[12]
A. T. Nguyen and T. N. Nguyen, "Graph-based statistical language model for code," in Proceedings of the 37th International Conference on Software Engineering - Volume 1, ser. ICSE '15. IEEE Press, 2015, pp. 858--868.
[13]
P. F. Brown, V. J. D. Pietra, S. A. D. Pietra, and R. L. Mercer, "The mathematics of statistical machine translation: parameter estimation," Comput. Linguist., vol. 19, no. 2, pp. 263--311, Jun. 1993.
[14]
P. Koehn, F. J. Och, and D. Marcu, "Statistical phrase-based translation," in Proceedings of the 2003 Conference of the North American Chapter of the Association for Computational Linguistics on Human Language Technology - Volume 1, ser. NAACL '03. Association for Computational Linguistics, 2003, pp. 48--54.
[15]
T. Nguyen, P. C. Rigby, A. T. Nguyen, M. Karanfil, and T. N. Nguyen, "T2API: Synthesizing API Code Usage Templates from English Texts with Statistical Translation," in Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, ser. FSE 2016. ACM, 2016, pp. 1013--1017.
[16]
"T2APIDemo," https://www.youtube.com/watch?v=Q8Kec6MHGY0&feature=youtu.be.

Cited By

View all
  • (2022)Heterogeneous Graph Neural Networks for Software Effort EstimationProceedings of the 16th ACM / IEEE International Symposium on Empirical Software Engineering and Measurement10.1145/3544902.3546248(103-113)Online publication date: 19-Sep-2022
  • (2021)A Systematic Review of API Evolution LiteratureACM Computing Surveys10.1145/347013354:8(1-36)Online publication date: 4-Oct-2021
  • (2020)CPCProceedings of the ACM/IEEE 42nd International Conference on Software Engineering10.1145/3377811.3380427(1359-1371)Online publication date: 27-Jun-2020
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE-C '17: Proceedings of the 39th International Conference on Software Engineering Companion
May 2017
558 pages
ISBN:9781538615898

Sponsors

Publisher

IEEE Press

Publication History

Published: 20 May 2017

Check for updates

Author Tags

  1. API usage synthesis
  2. statistical machine translation
  3. text-to-code translation

Qualifiers

  • Research-article

Conference

ICSE '17
Sponsor:

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2022)Heterogeneous Graph Neural Networks for Software Effort EstimationProceedings of the 16th ACM / IEEE International Symposium on Empirical Software Engineering and Measurement10.1145/3544902.3546248(103-113)Online publication date: 19-Sep-2022
  • (2021)A Systematic Review of API Evolution LiteratureACM Computing Surveys10.1145/347013354:8(1-36)Online publication date: 4-Oct-2021
  • (2020)CPCProceedings of the ACM/IEEE 42nd International Conference on Software Engineering10.1145/3377811.3380427(1359-1371)Online publication date: 27-Jun-2020
  • (2020)The classification and propagation of program commentsProceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering10.1145/3324884.3418913(1394-1396)Online publication date: 21-Dec-2020
  • (2019)Cleaning StackOverflow for machine translationProceedings of the 16th International Conference on Mining Software Repositories10.1109/MSR.2019.00021(79-83)Online publication date: 26-May-2019
  • (2018)API method recommendation without worrying about the task-API knowledge gapProceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering10.1145/3238147.3238191(293-304)Online publication date: 3-Sep-2018
  • (2018)Complementing global and local contexts in representing API descriptions to improve API retrieval tasksProceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3236024.3236036(551-562)Online publication date: 26-Oct-2018

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media