Refactoring Codebases through Library Design

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Kovacic, Ziga, Chiu, Justin T., Lee, Celine, Zhao, Wenting, Ellis, Kevin
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866908576560185344
author Kovacic, Ziga
Chiu, Justin T.
Lee, Celine
Zhao, Wenting
Ellis, Kevin
author_facet Kovacic, Ziga
Chiu, Justin T.
Lee, Celine
Zhao, Wenting
Ellis, Kevin
contents Maintainable and general software allows developers to build robust applications efficiently, yet achieving these qualities often requires refactoring specialized solutions into reusable components. This challenge becomes particularly relevant as code agents become used to solve isolated one-off programming problems. We investigate code agents' capacity to refactor code in ways that support growth and reusability. We first investigate what makes a good refactoring, finding via simulation results and a human study that Minimum Description Length best correlates with preferable refactorings. We then present both a benchmark and a method for refactoring: MiniCode, a benchmark where multiple files must be refactored into a shared library, and Librarian, a sample-and-rerank method for generating reusable libraries. We compare Librarian to state-of-the-art library generation methods, and study it on real-world code bases.
format Preprint
id arxiv_https___arxiv_org_abs_2506_11058
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Refactoring Codebases through Library Design
Kovacic, Ziga
Chiu, Justin T.
Lee, Celine
Zhao, Wenting
Ellis, Kevin
Software Engineering
Artificial Intelligence
Maintainable and general software allows developers to build robust applications efficiently, yet achieving these qualities often requires refactoring specialized solutions into reusable components. This challenge becomes particularly relevant as code agents become used to solve isolated one-off programming problems. We investigate code agents' capacity to refactor code in ways that support growth and reusability. We first investigate what makes a good refactoring, finding via simulation results and a human study that Minimum Description Length best correlates with preferable refactorings. We then present both a benchmark and a method for refactoring: MiniCode, a benchmark where multiple files must be refactored into a shared library, and Librarian, a sample-and-rerank method for generating reusable libraries. We compare Librarian to state-of-the-art library generation methods, and study it on real-world code bases.
title Refactoring Codebases through Library Design
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2506.11058