菜单

关于 🐙 GitHub
arXiv 提交日期: 2026-05-20
📄 Abstract - Quality and Security Signals in AI-Generated Python Refactoring Pull Requests

As AI agents increasingly contribute to code development and maintenance, there is still limited empirical evidence on the quality and risk characteristics of their changes in real-world projects, particularly for refactoring-oriented contributions. It remains unclear how agent-authored refactoring edits affect maintainability, code quality, and security once merged into GitHub repositories. To address this gap, we conduct an empirical study of Python refactoring pull requests (PRs) from the AIDev dataset. We analyze agentic refactoring PRs using PyQu, an ML-based quality assessment tool for Python, to quantify changes across five quality attributes, and we complement PyQu with domain-independent static analysis (Pylint and Bandit) to measure code quality and security issues before and after each change. Our results show that, on average, agentic commits improve a quality attribute in 22.5% of the studied changes, with usability improving most frequently (36.5%). At the same time, 24.17% of modified files introduce new Pylint issues predominantly convention level violations such as long lines-while 4.7% introduce new Bandit findings. From the observed diffs, we derive a taxonomy of 24 recurring change operations and map them to the lint and security findings they most commonly affect. Despite these mixed outcomes, developer acceptance is high: 73.5% of the analyzed PRs are merged, including cases that introduce new lint or security findings, often alongside the removal of existing issues. Overall, these findings highlight both the promise and current limitations of agentic refactoring, and motivate stronger tool-in-the-loop quality and security gating for AI-driven development workflows.

顶级标签: llm machine learning model evaluation
详细标签: code refactoring code quality security analysis pull requests empirical study 或 搜索:

AI生成Python重构拉取请求中的质量与安全信号 / Quality and Security Signals in AI-Generated Python Refactoring Pull Requests


1️⃣ 一句话总结

这项研究分析了AI代理人提交的Python代码重构请求,发现它们平均能改善约22.5%的代码质量(尤其是易用性),但同时也会引入少量新的代码规范问题(如过长代码行)和安全缺陷,不过开发者仍高度接受这类修改,超过七成的重构请求被合并到项目中。

源自 arXiv: 2605.21453