arrow
Return

XCoS: Explainable Code Search Based on Query Scoping and Knowledge Graph

delete2023-09-29
delete9
delete
OA
AI
C
Chong Wang *
X
Xin Peng
Z
Zhenchang Xing
Y
Yue Zhang
刘明微 cover
刘明微 (Mingwei Liu)
R
Rong Luo
X
Xiujie Meng
DOI:10.1145/3593800delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
When searching code, developers may express additional constraints (e.g., functional constraints and non-functional constraints) on the implementations of desired functionalities in the queries. Existing code search tools treat the queries as a whole and ignore the different implications of different parts of the queries. Moreover, these tools usually return a ranked list of candidate code snippets without any explanations. Therefore, the developers often find it hard to choose the desired results and build confidence on them. In this article, we conduct a developer survey to better understand and address these issues and induct some insights from the survey results. Based on the insights, we propose XCoS, an explainable code search approach based on query scoping and knowledge graph. XCoS extracts a background knowledge graph from general knowledge bases likeWikidata and Wikipedia. Given a code search query, XCoS identifies different parts (i.e., functionalities, functional constraints, nonfunctional constraints) from it and use the expressions of functionalities and functional constraints to search the codebase. It then links both the query and the candidate code snippets to the concepts in the background knowledge graph and generates explanations based on the association paths between these two parts of concepts together with relevant descriptions. XCoS uses an interactive user interface that allows the user to better understand the associations between candidate code snippets and the query from different aspects and choose the desired results. Our evaluation shows that the quality of the extracted background knowledge and the concept linkings in codebase is generally high. Furthermore, the generated explanations are considered complete, concise, and readable, and the approach can help developers find the desired code snippets more accurately and confidently.
Keywords:
Code search
explainability
knowledge
concept

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.2K
Citations:
3.4K

Organization

F
fudan university
Scholars:
11.8W
Papers: 7.7W
Citations: 121
Cited Papers

Cited Papers

No Perisaccadic Mislocalization with Abruptly Cancelled Saccades
err2014-04-16
err0
errOAAI
errJeroen Atsma; Femke Maij; Brian D. Corneil; W. Pieter Medendorp
errShare
errSave
Impact of Metformin Use on Lactate Kinetics in Patients with Severe Sepsis and Septic Shock
err2017-05-01
err0
PREAI
errJoongmin Park; Sung Yeon Hwang; Ik Joon Jo; Kyeongman Jeon; Gee Young Suh; Tae Rim Lee; Hee Yoon; Won Chul Cha; Min Seob Sim; Keumhee Chough Carriere; Seungmin Yeon; Tae Gun Shin
errShare
errSave
Actionable Analytics: Stop Telling Me What It Is; Please Tell Me What To Do
err2021-07-01
err19
PREAI
errTantithamthavorn, Chakkrit; Jiarpakdee, Jirayus; Grundy, John
errShare
errSave
Unusual Photoisomerization Pathway in a Near-Infrared Light Absorbing Enzymerhodopsin
err2022-10-06
err0
PREAI
errMasahiro Sugiura; Kazuki Ishikawa; Kota Katayama; Yuji Sumii; Rei Abe-Yoshizumi; Satoshi P. Tsunoda; Yuji Furutani; Norio Shibata; Leonid S. Brown; Hideki Kandori
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
SQAPlanner: Generating Data-Informed Software Quality Improvement Plans
err2022-08-01
err26
errOAAI
errRajapaksha, Dilini; Tantithamthavorn, Chakkrit; Jiarpakdee, Jirayus; Bergmeir, Christoph; Grundy, John; Buntine, Wray
errShare
errSave
Quantifying the Autophagy-Triggering Effects of Drugs in Cell Spheroids with Live Fluorescence Microscopy
err2014-04-28
err0
PREAI
errNariman Ansari; Stefanie Hardung; Katharina Hötte; Stefanie Rakel; Patrick Antonietti; Donat Kögel; Ernst H. K. Stelzer; Francesco Pampaloni
errShare
errSave
errShare
errSave
researcher View more