paperbot · PL 论文追踪

全部论文 待读 收藏

P2 V2: Fast Detection of Configuration Drift in Python

V2:Python 中配置漂移的快速检测
ASE 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)2019匹配度 2/10 · 论文关注 Python 代码片段因依赖破坏性变更导致的配置漂移检测与修复,属于软件工程/依赖管理与修复方向,不涉及 LLM/Agent 程序分析、浮点程序分析或贝叶斯程序分析,与用户核心研究方向仅弱相关。引用 1 inbox
Eric Horton, Chris Parnin
crossref: 2026-09-12

AI 速览

一句话:V2 用反馈导向搜索检测 Python 代码片段因依赖破坏性变更而产生的配置漂移,并给出修复补丁。

代码片段被广泛使用却难以复用,原因之一是它们往往缺少配套的环境配置,而且大多缺乏维护,使得片段与当前可能的依赖配置之间产生漂移,逐渐过时。已有工作指出,验证并检测过时代码片段是代码复用最重要的考量,但要判定一个片段是“仍然正确、只是过时”并不简单:最好情况下破坏性变更有所记录,最坏情况下则需穷举搜索历史依赖版本。本文提出 V2,通过检测离散的配置漂移实例来判断片段是否过时,即片段使用的 API 后来经历了破坏性变更。每个漂移实例由一个验证阶段遇到的失败以及一个配置补丁(依赖版本变更)来刻画,该补丁可修复底层故障。V2 采用反馈导向搜索探索片段可能的配置空间,从而减少需要验证的潜在环境配置数量。在来自先前研究的公开 Python 片段语料上运行,V2 共识别出 248 个配置漂移实例。

问题
代码片段常缺少配套环境配置且疏于维护,导致其与最新依赖版本之间出现配置漂移;判定一个片段是否“正确但过时”很困难,最坏情况需要穷举历史依赖版本。
方法
V2 通过反馈导向搜索探索代码片段可能的依赖配置空间,检测离散的配置漂移实例,每个实例由验证时遇到的失败和修复该故障的依赖版本变更补丁来刻画,从而减少需要验证的配置数量。
评估
在先前研究提供的公开 Python 代码片段语料上运行 V2,共识别出 248 个配置漂移实例。
原文摘要(Abstract)

Code snippets are prevalent, but are hard to reuse because they often lack an accompanying environment configuration. Most are not actively maintained, allowing for drift between the most recent possible configuration and the code snippet as the snippet becomes out-of-date over time. Recent work has identified the problem of validating and detecting out-of-date code snippets as the most important consideration for code reuse. However, determining if a snippet is correct, but simply out-of-date, is a non-trivial task. In the best case, breaking changes are well documented, allowing developers to manually determine when a code snippet contains an out-of-date API usage. In the worst case, determining if and when a breaking change was made requires an exhaustive search through previous dependency versions. We present V2, a strategy for determining if a code snippet is out-of-date by detecting discrete instances of configuration drift, where the snippet uses an API which has since undergone a breaking change. Each instance of configuration drift is classified by a failure encountered during validation and a configuration patch, consisting of dependency version changes, which fixes the underlying fault. V2 uses feedback-directed search to explore the possible configuration space for a code snippet, reducing the number of potential environment configurations that need to be validated. When run on a corpus of public Python snippets from prior research, V2 identifies 248 instances of configuration drift.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot5320,
  title = {V2: Fast Detection of Configuration Drift in Python},
  author = {Eric Horton and Chris Parnin},
  booktitle = {ASE},
  year = {2019},
  doi = {10.1109/ase.2019.00052}
}