{"title":"ASTSDL: predicting the functionality of incomplete programming code via an AST-sequence-based deep learning model","authors":"Yaoshen Yu, Zhiqiu Huang, Guohua Shen, Weiwei Li, Yichao Shao","doi":"10.1007/s11432-021-3665-1","DOIUrl":null,"url":null,"abstract":"<p>Code recommendation systems have been widely used in helping developers implement unfamiliar programming tasks. Many existing code recommenders or code search engines can retrieve relevant code rapidly with high accuracy, however, they cannot recommend any code outside similar ones. We propose an approach to predict the functionality of incomplete programming code by using syntactical information, and providing a list of potential functionalities to guess what the developers want, in order to increase the diversity of recommendations. In this paper, we propose a deep learning model called ASTSDL, which uses a sequence-based representation of source code to predict functionality. We extract syntactical information from the abstract syntax tree (AST) of the source code, apply a deep learning model to capture the syntactic and sequential information, and predict the functionality of the source code fragments. The experimental results demonstrate that ASTSDL can effectively predict the functionality of incomplete code with an accuracy above 84% in the top-10 list, even if there is only half of the complete code.</p>","PeriodicalId":21618,"journal":{"name":"Science China Information Sciences","volume":"78 1","pages":""},"PeriodicalIF":7.3000,"publicationDate":"2023-12-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Science China Information Sciences","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.1007/s11432-021-3665-1","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0
Abstract
Code recommendation systems have been widely used in helping developers implement unfamiliar programming tasks. Many existing code recommenders or code search engines can retrieve relevant code rapidly with high accuracy, however, they cannot recommend any code outside similar ones. We propose an approach to predict the functionality of incomplete programming code by using syntactical information, and providing a list of potential functionalities to guess what the developers want, in order to increase the diversity of recommendations. In this paper, we propose a deep learning model called ASTSDL, which uses a sequence-based representation of source code to predict functionality. We extract syntactical information from the abstract syntax tree (AST) of the source code, apply a deep learning model to capture the syntactic and sequential information, and predict the functionality of the source code fragments. The experimental results demonstrate that ASTSDL can effectively predict the functionality of incomplete code with an accuracy above 84% in the top-10 list, even if there is only half of the complete code.
期刊介绍:
Science China Information Sciences is a dedicated journal that showcases high-quality, original research across various domains of information sciences. It encompasses Computer Science & Technologies, Control Science & Engineering, Information & Communication Engineering, Microelectronics & Solid-State Electronics, and Quantum Information, providing a platform for the dissemination of significant contributions in these fields.