SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Mündler, Niels, Müller, Mark Niklas, He, Jingxuan, Vechev, Martin
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866916601795706880
author Mündler, Niels
Müller, Mark Niklas
He, Jingxuan
Vechev, Martin
author_facet Mündler, Niels
Müller, Mark Niklas
He, Jingxuan
Vechev, Martin
contents Rigorous software testing is crucial for developing and maintaining high-quality code, making automated test generation a promising avenue for both improving software quality and boosting the effectiveness of code generation methods. However, while code generation with Large Language Models (LLMs) is an extraordinarily active research area, test generation remains relatively unexplored. We address this gap and investigate the capability of LLM-based Code Agents to formalize user issues into test cases. To this end, we propose a novel benchmark based on popular GitHub repositories, containing real-world issues, ground-truth bug-fixes, and golden tests. We find that LLMs generally perform surprisingly well at generating relevant test cases, with Code Agents designed for code repair exceeding the performance of systems designed specifically for test generation. Further, as test generation is a similar but more structured task than code generation, it allows for a more fine-grained analysis using issue reproduction rate and coverage changes, providing a dual metric for analyzing systems designed for code repair. Finally, we find that generated tests are an effective filter for proposed code fixes, doubling the precision of SWE-Agent. We release all data and code at https://github.com/logic-star-ai/SWT-Bench
format Preprint
id arxiv_https___arxiv_org_abs_2406_12952
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents
Mündler, Niels
Müller, Mark Niklas
He, Jingxuan
Vechev, Martin
Software Engineering
Artificial Intelligence
Machine Learning
Rigorous software testing is crucial for developing and maintaining high-quality code, making automated test generation a promising avenue for both improving software quality and boosting the effectiveness of code generation methods. However, while code generation with Large Language Models (LLMs) is an extraordinarily active research area, test generation remains relatively unexplored. We address this gap and investigate the capability of LLM-based Code Agents to formalize user issues into test cases. To this end, we propose a novel benchmark based on popular GitHub repositories, containing real-world issues, ground-truth bug-fixes, and golden tests. We find that LLMs generally perform surprisingly well at generating relevant test cases, with Code Agents designed for code repair exceeding the performance of systems designed specifically for test generation. Further, as test generation is a similar but more structured task than code generation, it allows for a more fine-grained analysis using issue reproduction rate and coverage changes, providing a dual metric for analyzing systems designed for code repair. Finally, we find that generated tests are an effective filter for proposed code fixes, doubling the precision of SWE-Agent. We release all data and code at https://github.com/logic-star-ai/SWT-Bench
title SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents
topic Software Engineering
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2406.12952