TY - JOUR
T1 - Fusing Code Searchers
AU - Wang, Shangwen
AU - Geng, Mingyang
AU - Lin, Bo
AU - Sun, Zhensu
AU - Wen, Ming
AU - Liu, Yepang
AU - Li, Li
AU - Bissyandé, Tegawendé F.
AU - Mao, Xiaoguang
N1 - Publisher Copyright:
© 2024 IEEE.
PY - 2024
Y1 - 2024
N2 - Code search, which consists in retrieving relevant code snippets from a codebase based on a given query, provides developers with useful references during software development. Over the years, techniques alternatively adopting different mechanisms to compute the relevance score between a query and a code snippet have been proposed to advance the state of the art in this domain, including those relying on information retrieval, supervised learning, and pre-training. Despite that, the usefulness of existing techniques is still compromised since they cannot effectively handle all the diversified queries and code in practice. To tackle this challenge, we present Dancer, a data fusion based code searcher. Our intuition (also the basic hypothesis of this study) is that existing techniques may complement each other because of the intrinsic differences in their working mechanisms. We have validated this hypothesis via an exploratory study. Based on that, we propose to fuse the results generated by different code search techniques so that the advantage of each standalone technique can be fully leveraged. Specifically, we treat each technique as a retrieval system and leverage well-known data fusion approaches to aggregate the results from different systems. We evaluate six existing code search techniques on two large-scale datasets, and exploit eight classic data fusion approaches to incorporate their results. Our experiments show that the best fusion approach is able to outperform the standalone techniques by 35%-550% and 65%-825% in terms of MRR (mean reciprocal rank) on the two datasets, respectively.
AB - Code search, which consists in retrieving relevant code snippets from a codebase based on a given query, provides developers with useful references during software development. Over the years, techniques alternatively adopting different mechanisms to compute the relevance score between a query and a code snippet have been proposed to advance the state of the art in this domain, including those relying on information retrieval, supervised learning, and pre-training. Despite that, the usefulness of existing techniques is still compromised since they cannot effectively handle all the diversified queries and code in practice. To tackle this challenge, we present Dancer, a data fusion based code searcher. Our intuition (also the basic hypothesis of this study) is that existing techniques may complement each other because of the intrinsic differences in their working mechanisms. We have validated this hypothesis via an exploratory study. Based on that, we propose to fuse the results generated by different code search techniques so that the advantage of each standalone technique can be fully leveraged. Specifically, we treat each technique as a retrieval system and leverage well-known data fusion approaches to aggregate the results from different systems. We evaluate six existing code search techniques on two large-scale datasets, and exploit eight classic data fusion approaches to incorporate their results. Our experiments show that the best fusion approach is able to outperform the standalone techniques by 35%-550% and 65%-825% in terms of MRR (mean reciprocal rank) on the two datasets, respectively.
KW - Code search
KW - data fusion
KW - information retrieval
UR - https://www.scopus.com/pages/publications/85194045269
U2 - 10.1109/TSE.2024.3403042
DO - 10.1109/TSE.2024.3403042
M3 - 文章
AN - SCOPUS:85194045269
SN - 0098-5589
VL - 50
SP - 1852
EP - 1866
JO - IEEE Transactions on Software Engineering
JF - IEEE Transactions on Software Engineering
IS - 7
ER -