code recommendation systems have been widely used in helping developers implement unfamiliar programming *** existing code recommenders or code search engines can retrieve relevant code rapidly with high accuracy,howe...
详细信息
code recommendation systems have been widely used in helping developers implement unfamiliar programming *** existing code recommenders or code search engines can retrieve relevant code rapidly with high accuracy,however,they cannot recommend any code outside similar *** 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 *** this paper,we propose a deep learning model called ASTSDL,which uses a sequencebased representation of source code to predict *** 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 *** 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.
code search is a common activity in software development, and code-to-code search can benefit in a wide range of use-case scenarios. code-to-code search uses a code fragment as the query for searching similar code fra...
详细信息
code search is a common activity in software development, and code-to-code search can benefit in a wide range of use-case scenarios. code-to-code search uses a code fragment as the query for searching similar code fragments from large corpora. The results of a search can be applied to some software engineering tasks, such as search-based code recommendation, data-driven program repairing, and software plagiarism detection. To be put into daily use, the code-to-code search needs to find similar code fragments accurately and efficiently in a large dataset. Some search engines can locate exactly similar code, but are not able to search syntactical clones. Therefore, we propose ASTENS-BWA, a novel approach for searching syntactic similar code regions between code fragments via a tree-based sequence alignment. Source code has been transformed into a tree-based sequence that contains the structure information, and a sequence alignment algorithm has been applied to find similar regions. We evaluate ASTENS-BWA on three different tasks, the results demonstrate that our approach can find syntactical similar regions for programming code and retrieve similar code fragments fast and with high accuracy. As a code clone detection tool, ASTENS-BWA can report clone pairs in a high recall, but it needs manually check to reduce the false alarms. ASTENS-BWA is scalable and can report cloned code fragments in seconds for a code corpus of million lines of code. (C) 2022 Elsevier B.V. All rights reserved.
暂无评论