Retrieving Self-Executable and Functionally Correct Code to Improve Source Code Search

Developers need to put lots of time and effort to reuse the code snippets retrieved by the existing code search engines. The reason is that these engines do not provide self-executable, functionally correct and easily understandable code snippets as search results. Developers manually resolve all th...

Full description

Saved in:
Bibliographic Details
Published in2017 24th Asia-Pacific Software Engineering Conference (APSEC) pp. 749 - 750
Main Authors Satter, Abdus, Muntaqeem, M.G., Nahar, Nadia, Sakib, Kazi
Format Conference Proceeding
LanguageEnglish
Published IEEE 01.12.2017
Subjects
Online AccessGet full text

Cover

Loading…
More Information
Summary:Developers need to put lots of time and effort to reuse the code snippets retrieved by the existing code search engines. The reason is that these engines do not provide self-executable, functionally correct and easily understandable code snippets as search results. Developers manually resolve all the dependencies to make the code snippets executable in their development contexts. They have to write and execute the same test cases many times to check the correctness of the code fragments. In this paper, a technique has been proposed that converts each method in a code base into self-executable method (i.e., program slice) by resolving method calls, data and library dependencies. To ensure that the methods are functionally correct, automatic test scripts are generated and executed for each self-executable method based on the branch, statement, and path coverage. The understandability of the code fragments is increased by replacing irrelevant textual keywords with relevant words. All the self-executable code fragments are indexed using traditional Information Retrieval approach. So, when a user query is submitted, the technique will retrieve self-executable and functionally correct code snippets.
DOI:10.1109/APSEC.2017.98