Daily Arxiv

This page organizes papers related to artificial intelligence published around the world.
This page is summarized using Google Gemini and is operated on a non-profit basis.
The copyright of the paper belongs to the author and the relevant institution. When sharing, simply cite the source.

Refactoring Codebases through Library Design

Created by
  • Haebom

Author

Ziga Kovacic, Justin T. Chiu, Celine Lee, Wenting Zhao, Kevin Ellis

Outline

This paper addresses the problem of refactoring code into reusable components to improve code maintainability and generalizability. This problem becomes particularly important when code agents are used to solve one-off programming problems. This study investigates the ability of code agents to refactor code in a way that supports growth and reusability. Through simulations and human studies, we demonstrate that minimum description length best correlates with preferred refactoring. Furthermore, we present the MiniCode benchmark, which requires refactoring multiple files into shared libraries, and Librarian, a sample and re-ranking method for generating reusable libraries. We compare Librarian with state-of-the-art library generation methods and study it on a real code base.

Takeaways, Limitations

Takeaways:
We found that minimum description length is an important indicator for desirable refactoring.
The MiniCode benchmark provides a new standard for evaluating library refactoring.
The Librarian method provides a practical approach to creating reusable libraries.
We validated Librarian's performance by studying it on a real code base.
Limitations:
Further research is needed to determine whether the results of this study can be generalized to other domains or problems.
There is a need to improve the performance of Librarian and conduct more in-depth comparisons with other methods.
Further research is needed to improve the refactoring capabilities of code agents.
👍