IEEE Access (Jan 2019)
Code Search Based on Alteration Intent
Abstract
Code search is to retrieve the method according to the user needs. Many people think of the query as the only one to reflect the user needs. So they start with the query and find the synonyms, semantically similar to the query terms, for query expansion. However, they overlook a fact: the retrieved methods still need to be altered because it does not meet the user needs directly. This implies that the alteration made in the retrieved methods also reflects the user needs. In this paper, we start with the alteration intent (the possible alterations after retrieving methods) and propose to predict the alteration intent and use it for query expansion. The experiment results show that our approach outperforms CodeHow, the approach to use APIs for query expansion, by 59.8% with a precision score of 0.815.
Keywords