English

CoSQA+: Pioneering the Multi-Choice Code Search Benchmark with Test-Driven Agents

Software Engineering 2026-02-05 v7 Artificial Intelligence Information Retrieval

Abstract

Semantic code search, retrieving code that matches a given natural language query, is an important task to improve productivity in software engineering. Existing code search datasets face limitations: they rely on human annotators who assess code primarily through semantic understanding rather than functional verification, leading to potential inaccuracies and scalability issues. Additionally, current evaluation metrics often overlook the multi-choice nature of code search. This paper introduces CoSQA+, pairing high-quality queries from CoSQA with multiple suitable codes. We develop an automated pipeline featuring multiple model-based candidate selections and the novel test-driven agent annotation system. Among a single Large Language Model (LLM) annotator and Python expert annotators (without test-based verification), agents leverage test-based verification and achieve the highest accuracy of 93.9%. Through extensive experiments, CoSQA+ has demonstrated superior quality over CoSQA. Models trained on CoSQA+ exhibit improved performance. We publicly release both CoSQA+_all, which contains 412,080 agent-annotated pairs, and CoSQA+_verified, which contains 1,000 human-verified pairs, at https://github.com/DeepSoftwareAnalytics/CoSQA_Plus.

Keywords

Cite

@article{arxiv.2406.11589,
  title  = {CoSQA+: Pioneering the Multi-Choice Code Search Benchmark with Test-Driven Agents},
  author = {Jing Gong and Yanghui Wu and Linxi Liang and Yanlin Wang and Jiachi Chen and Mingwei Liu and Zibin Zheng},
  journal= {arXiv preprint arXiv:2406.11589},
  year   = {2026}
}

Comments

Accepted to TSE 2025. We provide the code and data at https://github.com/DeepSoftwareAnalytics/CoSQA_Plus

R2 v1 2026-06-28T17:08:43.671Z