arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.18293cs.CRcs.AIcs.SE
收藏

PrivacyPR:用于基准测试隐私感知代码审查的真实隐私修复数据集

PrivacyPR: A Dataset of Real-World Privacy Fixes for Benchmarking Privacy-Aware Code Review

Hua Yang, Aditya Bhardwaj, Shidong Pan, Bowen Xu

AI总结:

研究人员构建了包含4131个GitHub PR的PrivacyPR数据集,用于隐私感知代码审查基准测试,实验发现编码智能体检测隐私缺陷的能力受审查意图影响,明确要求检查隐私时检测率大幅提升。

摘要:

编码智能体越来越多地审查代码,但它们是否能发现GDPR等法律要求软件避免的隐私缺陷仍未得到充分验证,部分原因是很少有数据集将真实隐私缺陷与其已接受的修复及审查上下文关联起来。我们提出PrivacyPR,这是一个包含4131个合并GitHub拉取请求(PR)的数据集,来自1469个存储库,创建于2018年6月至2024年1月之间。每个PR包含其提交内容、差异、审查讨论以及由大语言模型(LLM)生成的隐私相关性、修复类型和GDPR原则标签。PrivacyPR提供1169个高置信度隐私修复和1643个非修复PR,同时包含Verified(手动检查的250个隐私修复和250个非修复PR的划分)以及Small(用于评估的100+100子集)。在Verified上,标注者对LLM的GDPR原则分配的认同率为72%。除了支持对隐私缺陷如何产生和修复的实证研究外,PrivacyPR还为基于真实开发者接受的修复进行隐私感知代码审查提供了基准。其评估工具会撤销每个修复以重新引入缺陷。在Small上,两个编码智能体在通用审查提示下仅检测到42-51%的缺陷,但在被明确要求检查隐私时检测率为88-91%,同时标记了11-15%的非修复PR。这些结果表明,编码智能体可以检测隐私缺陷,但检测效果强烈依赖于审查意图,且存在误报。数据、代码、审查、判断结果以及可扩展的评估工具可在该httpsURL公开获取。

英文摘要:

Coding agents increasingly review code, yet whether they catch the privacy defects that laws such as the GDPR require software to avoid remains largely untested, partly because few datasets connect real privacy defects to their accepted fixes and review context. We present PrivacyPR, a dataset of 4,131 merged GitHub pull requests (PRs) from 1,469 repositories, created between June 2018 and January 2024. Each PR includes its commits, diffs, review discussion, and LLM-generated labels for privacy relevance, fix type, and GDPR principles. PrivacyPR provides 1,169 high-confidence privacy fixes and 1,643 non-fix PRs, together with Verified, a manually checked split of 250 privacy fixes and 250 non-fix PRs, and Small, a 100 + 100 subset for evaluation. On Verified, both annotators endorsed 72% of the LLM's GDPR-principle assignments. Beyond supporting empirical study of how privacy defects arise and are fixed, PrivacyPR provides a benchmark for privacy-aware code review on real, developer-accepted fixes. Its evaluation harness reverts each fix to reintroduce the defect. On Small, two coding agents detect only 42-51% of defects under a generic review prompt, but 88-91% when explicitly asked to check privacy, while flagging 11-15% of non-fix PRs. These results show that privacy defects can be detected by coding agents, but that detection depends strongly on review intent and comes with false alarms. Data, code, reviews, judge verdicts, and an extensible evaluation harness are publicly available at https://doi.org/10.5281/zenodo.23744765.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑