Code-Survey:一种用于分析大规模代码库的LLM驱动方法
Code-Survey: An LLM-Driven Methodology for Analyzing Large-Scale Codebases
AI总结:
本文提出Code-Survey方法,将LLM视为人类参与者,通过设计调查问卷把提交记录和邮件等非结构化数据转化为结构化数据集,并在Linux内核eBPF子系统上构建Linux-bpf数据集进行定量分析,揭示了eBPF的演化模式、功能依赖关系及可靠性与安全性问题。
摘要:
现代软件系统(如Linux内核)属于世界上规模最大、结构最复杂的代码库,它们随着新功能的增加和复杂性的提升而持续演进。由于这些系统的规模庞大,且提交记录、邮件列表讨论等开发工件具有非结构化特性,理解这些系统面临重大挑战。我们提出了Code-Survey,这是首个由LLM驱动的方法,旨在系统性地探索和分析大规模代码库。Code-Survey背后的核心原则是将LLM视为人类参与者,承认软件开发同时也是一种社会活动,从而使既有的社会科学方法得以应用。通过精心设计调查问卷,Code-Survey将提交记录、电子邮件等非结构化数据转化为有组织的、结构化的、可分析的数据集。这使得对复杂软件演化进行定量分析成为可能,并揭示与设计、实现、维护、可靠性和安全性相关的有价值见解。为了证明Code-Survey的有效性,我们将其应用于Linux内核的eBPF子系统。我们构建了Linux-bpf数据集,该数据集包含来自Linux社区的670多个功能和16,000条提交记录。我们的定量分析揭示了关于eBPF演化的重要见解,例如开发模式、功能相互依赖关系以及需要关注可靠性和安全性的领域。这些见解已得到eBPF专家的初步验证。此外,Code-Survey可以直接应用于Linux中的其他子系统以及其他大规模软件项目。通过为系统性分析提供通用工具,Code-Survey有助于更深入地理解复杂软件系统,促进跨多个领域的改进,并支持广泛的实证研究。代码和数据集已开源。
英文摘要:
Modern software systems like the Linux kernel are among the world's largest and most intricate codebases, continually evolving with new features and increasing complexity. Understanding these systems poses significant challenges due to their scale and the unstructured nature of development artifacts such as commits and mailing list discussions. We introduce Code-Survey, the first LLM-driven methodology designed to systematically explore and analyze large-scale codebases. The central principle behind Code-Survey is to treat LLMs as human participants, acknowledging that software development is also a social activity and thereby enabling the application of established social science techniques. By carefully designing surveys, Code-Survey transforms unstructured data, such as commits, emails, into organized, structured, and analyzable datasets. This enables quantitative analysis of complex software evolution and uncovers valuable insights related to design, implementation, maintenance, reliability, and security. To demonstrate the effectiveness of Code-Survey, we apply it to the Linux kernel's eBPF subsystem. We construct the Linux-bpf dataset, comprising over 670 features and 16,000 commits from the Linux community. Our quantitative analysis uncovers important insights into the evolution of eBPF, such as development patterns, feature interdependencies, and areas requiring attention for reliability and security. The insights have been initially validated by eBPF experts. Furthermore, Code-Survey can be directly applied to other subsystems within Linux and to other large-scale software projects. By providing a versatile tool for systematic analysis, Code-Survey facilitates a deeper understanding of complex software systems, enabling improvements across a variety of domains and supporting a wide range of empirical studies. The code and dataset is open-sourced.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。