Title :
Query expansion via WordNet for effective code search
Author :
Meili Lu ; Xiaobing Sun ; Shaowei Wang ; Lo, David ; Yucong Duan
Author_Institution :
Sch. of Inf. Eng., Yangzhou Univ., Yangzhou, China
Abstract :
Source code search plays an important role in software maintenance. The effectiveness of source code search not only relies on the search technique, but also on the quality of the query. In practice, software systems are large, thus it is difficult for a developer to format an accurate query to express what really in her/his mind, especially when the maintainer and the original developer are not the same person. When a query performs poorly, it has to be reformulated. But the words used in a query may be different from those that have similar semantics in the source code, i.e., the synonyms, which will affect the accuracy of code search results. To address this issue, we propose an approach that extends a query with synonyms generated from WordNet. Our approach extracts natural language phrases from source code identifiers, matches expanded queries with these phrases, and sorts the search results. It allows developers to explore word usage in a piece of software, helps them quickly identify relevant program elements for investigation or quickly recognize alternative words for query reformulation. Our initial empirical study on search tasks performed on the JavaScript/ECMAScript interpreter and compiler, Rhino, shows that the synonyms used to expand the queries help recommend good alternative queries. Our approach also improves the precision and recall of Conquer, a state-of-the-art query expansion/reformulation technique, by 5% and 8% respectively.
Keywords :
Java; natural language processing; program compilers; program interpreters; public domain software; query formulation; software maintenance; source code (software); Conquer; JavaScript-ECMAScript interpreter; Rhino; WordNet; compiler; natural language phrases; query expansion technique; query quality; query reformulation technique; search technique; software maintenance; source code identifiers; source code search; Conferences; Information retrieval; Natural languages; Software engineering; Software maintenance; Software systems;
Conference_Titel :
Software Analysis, Evolution and Reengineering (SANER), 2015 IEEE 22nd International Conference on
Conference_Location :
Montreal, QC
DOI :
10.1109/SANER.2015.7081874