AutoTest:基于测试用例的演化式代码解决方案选择
AutoTest: Evolutionary Code Solution Selection with Test Cases
AI总结:
本研究提出 AutoTest 技术,结合自动化测试用例生成与代码执行,利用演化遗传算法优化多候选代码解决方案的选择,在 HumanEval 基准上 pass@1 较基线提升约 10%。
摘要:
随着代码生成技术的发展,从多个候选解决方案中选择正确的代码解决方案已成为一项关键任务。本研究提出了一种新技术 AutoTest,它将自动化测试用例生成与代码解决方案执行相结合,利用演化遗传算法优化选择过程。首先,AutoTest 利用大型预训练语言模型(如 codegen-16B、code-davinci-002 和 incoder-6B)提供代码解决方案及其对应的测试用例。然后,通过执行代码解决方案并评估其在测试用例上的表现,形成共识集。通过基于演化遗传算法的选择、突变和交叉机制,并调整 alpha 和 beta 参数,实现细粒度排序。最后,选出最佳代码解决方案。AutoTest 在 HumanEval 基准测试中表现出显著的性能提升。HumanEval 数据集包含 164 个编程问题,AutoTest 在 pass@1 分数上比基线方法提高了约 10%。
英文摘要:
With the development of code generation techniques, selecting the correct code solution from multiple candidate solutions has become a crucial task. This study proposes AutoTest, a novel technique that combines automated test case generation with code solution execution to optimize the selection process using an evolutionary genetic algorithm. Firstly, AutoTest utilizes large pre-trained language models such as codegen-16B, code-davinci-002, and incoder-6B to provide code solutions and their corresponding test cases. Then, by executing the code solutions and evaluating their performance on the test cases, a consensus set is formed. Fine-grained ranking is achieved through the selection, mutation, and crossover mechanisms based on the evolutionary genetic algorithm, with the adjustment of alpha and beta parameters. Finally, the best code solution is chosen. AutoTest demonstrates significant performance improvements on the HumanEval benchmark test. The HumanEval dataset consists of 164 programming problems, and AutoTest achieves approximately a 10% improvement over the baseline method in terms of pass@1 score.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。