arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.00519cs.SEcs.LG
收藏

CoDocBench:软件维护中代码-文档对齐的数据集

CoDocBench: A Dataset for Code-Documentation Alignment in Software Maintenance

University of California, Davis(加州大学戴维斯分校)

Kunal Pai, Premkumar Devanbu, Toufique Ahmed

AI总结:

本文提出CoDocBench数据集,从高质量GitHub项目中挖掘代码与文档同步变更的提交,用于训练和评估软件维护中的代码变更理解与生成任务,并发现现有大模型在这些任务上仍面临挑战。

摘要:

软件维护的核心任务之一是能够理解并开发代码变更。因此,给定一个函数所需新操作的自然语言描述,智能体(人类或AI)可能被要求生成对该函数的一组编辑,以实现所需的新操作;同样,给定对函数的一组编辑,智能体可能被要求生成该函数新工作方式的变更描述。因此,存在训练用于变更相关任务的神经模型的动机。受此启发,我们提供了一个新的、“自然的”、从实际高质量GitHub项目中挖掘的代码与文档耦合变更的大规模数据集,其中每个样本代表一次代码与关联docstring一起变更的提交。我们介绍了收集该数据集的方法,以及一些具有挑战性(但现实)的示例任务,在这些任务中,我们的数据集为学习和评估都提供了机会。我们发现当前模型(具体为Llama-3.1 405B、Mixtral 8×22B)确实发现这些维护相关任务具有挑战性。

英文摘要:

One of the central tasks in software maintenance is being able to understand and develop code changes. Thus, given a natural language description of the desired new operation of a function, an agent (human or AI) might be asked to generate the set of edits to that function to implement the desired new operation; likewise, given a set of edits to a function, an agent might be asked to generate a changed description, of that function's new workings. Thus, there is an incentive to train a neural model for change-related tasks. Motivated by this, we offer a new, "natural", large dataset of coupled changes to code and documentation mined from actual high-quality GitHub projects, where each sample represents a single commit where the code and the associated docstring were changed together. We present the methodology for gathering the dataset, and some sample, challenging (but realistic) tasks where our dataset provides opportunities for both learning and evaluation. We find that current models (specifically Llama-3.1 405B, Mixtral 8$\times$22B) do find these maintenance-related tasks challenging.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑