HackerPapers

arXiv:2309.12499cs.SE

CodePlan: Repository-level Coding using LLMs and Planning

Ramakrishna Bairi, Atharv Sonwane, Aditya Kanade, Vageesh D C, Arun Iyer, Suresh Parthasarathy, Sriram Rajamani, B. Ashok, Shashank Shet

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

Software engineering activities such as package migration, fixing errors reports from static analysis or testing, and adding type annotations or other specifications to a codebase, involve pervasively editing the entire repository of code. We formulate these activities as repository-level coding tasks. Recent tools like GitHub Copilot, which are powered by Large Language Models (LLMs), have succeeded in offering high-quality solutions to localized coding problems. Repository-level coding tasks are more involved and cannot be solved directly using LLMs, since code within a repository is inter-dependent and the entire repository may be too large to fit into the prompt. We frame repository-level coding as a planning problem and present a task-agnostic framework, called CodePlan to solve it. CodePlan synthesizes a multi-step chain of edits (plan), where each step results in a call to an LLM on a code location with context derived from the entire repository, previous code changes and task-specific instructions. CodePlan is based on a novel combination of an incremental dependency analysis, a change may-impact analysis and an adaptive planning algorithm. We evaluate the effectiveness of CodePlan on two repository-level tasks: package migration (C#) and temporal code edits (Python). Each task is evaluated on multiple code repositories, each of which requires inter-dependent changes to many files (between 2-97 files). Coding tasks of this level of complexity have not been automated using LLMs before. Our results show that CodePlan has better match with the ground truth compared to baselines. CodePlan is able to get 5/6 repositories to pass the validity checks (e.g., to build without errors and make correct code edits) whereas the baselines (without planning but with the same type of contextual information as CodePlan) cannot get any of the repositories to pass them.

arXiv comments
Journal reference
DOI
Subjects
cs.SESoftware Engineering

On Hacker News

Linked by 1 identifiable commenter in 4 comments across 2 threads, from Sep 2023 to Sep 2023. Found in 4 HN submissions from Sep 2023 to May 2024. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • https://arxiv.org/abs/2309.12499

      famouswafflesView on HNParent context

    • >And it is not true that computing power will continue to reduce; Moore's Law has been dead for some time now, and if incremental growth in LLMs require exponential growth in computing power the marginal difference won't matter. This is a lot of unfounded assumptions. You don't…

      famouswafflesView on HNParent context

    • >It can't even generate flashcards from a textbook chapter, because it can't load the entire chapter into memory. Heck, it doesn't even know what textbook I'm talking about; I have to provide the content! Okay...? That's a context window problem. and you could manage it if you…

      famouswafflesView on HNParent context

Submitted to Hacker News

  • Show HN: Bumpgen – upgrade NPM packages using AI

    Hey HN, we are building bumpgen (https://github.com/xeol-io/bumpgen/) to remove the toil of fixing breaking changes during version bumps. bumpgen bumps your npm package version then generates the fixes to potential breaking changes. There were some interesting challenges we encountered using an LLM to fix breaking changes: [1] Finding the breaking changes → know how is a dependency used through the codebase [2] Knowing how to fix the a breaking change → know how the dependency has changed from…

  • Show HN: I built an AI agent that upgrades NPM packages

    Hi HN, I built a tool [1] that resolves breaking changes when you upgrade npm packages. I know keeping my dependencies updated is good hygiene but I really have no motivations to do them. The time to fix breaking changes then validate them makes the ROI lopsided. Automating these helps me reduce the barrier to a good habit. It works on typescript and tsx projects. BYOK (bring your own GPT-4 key) for the codegen. MIT license. How does it work? - Bumps the package version, builds your project…

  • CodePlan: Repository-level Coding using LLMs and Planning
  • Show HN: Can AI keep my code up-to-date?

    Hey HN, We are open sourcing (https://github.com/xeol-io/bumpgen/), a tool that uses an LLM to upgrade your dependencies to their newer versions. We are building this for our customers (security teams) who need to upgrade their dependencies for security and compliance but lack engineering resources. Most patching tend to be painless but major version upgrades will cause breaking changes that require engineers to fix. We want bumpgen to reduce this engineering cost to security. It has been an…

Connected through shared HN threads, not inferred similarity or a recommendation.