GDPR-Bench-Android:一个用于评估Android中自动化GDPR合规性检测的基准
GDPR-Bench-Android: A Benchmark for Evaluating Automated GDPR Compliance Detection in Android
AI总结:
本文提出首个用于评估Android应用中自动化GDPR合规性检测的综合基准GDPR-Bench-Android,包含1951个违规实例,并基于多粒度违规定位和多标签分类任务评估了11种方法,揭示了不同自动化范式的任务依赖性优势。
摘要:
自动化检测源代码中违反欧盟通用数据保护条例(GDPR)的行为是一个关键但尚未充分探索的挑战。我们引入了GDPR-Bench-Android,这是第一个用于评估Android应用中各种自动化GDPR合规性检测方法的综合基准。它包含来自15个开源存储库的1951个手动标注的违规实例,涵盖了文件、模块和行级粒度的23项GDPR条款。为了实现多范式评估,我们提出了Formal-AST,这是一种新颖的源代码原生形式化方法,可作为确定性基线。我们定义了两个任务:(1)多粒度违规定位,通过Accuracy@k进行评估;(2)代码片段级多标签分类,通过macro-F1和其他分类指标进行评估。我们对11种方法进行了基准测试,包括八种最先进的LLM、我们的Formal-AST分析器、一种检索增强(RAG)方法和一种智能体(ReAct)方法。我们的研究结果表明,没有单一范式在所有任务中表现最佳。对于任务1,ReAct智能体实现了最高的文件级Accuracy@1(17.38%),而Qwen2.5-72B LLM在行级上领先(61.60%),这与Formal-AST方法的1.86%形成鲜明对比。对于困难的多标签任务2,Claude-Sonnet-4.5 LLM取得了最佳的Macro-F1(5.75%),而RAG方法产生了最高的Macro-Precision(7.10%)。这些结果突出了不同自动化方法的任务依赖性优势,并强调了我们的基准在诊断其能力方面的价值。所有资源可在以下网址获取:https://github.com/Haoyi-Zhang/GDPR-Bench-Android。
英文摘要:
Automating the detection of EU General Data Protection Regulation (GDPR) violations in source code is a critical but underexplored challenge. We introduce \textbf{GDPR-Bench-Android}, the first comprehensive benchmark for evaluating diverse automated methods for GDPR compliance detection in Android applications. It contains \textbf{1951} manually annotated violation instances from \textbf{15} open-source repositories, covering 23 GDPR articles at file-, module-, and line-level granularities. To enable a multi-paradigm evaluation, we contribute \textbf{Formal-AST}, a novel, source-code-native formal method that serves as a deterministic baseline. We define two tasks: (1) \emph{multi-granularity violation localization}, evaluated via Accuracy@\textit{k}; and (2) \emph{snippet-level multi-label classification}, assessed by macro-F1 and other classification metrics. We benchmark 11 methods, including eight state-of-the-art LLMs, our Formal-AST analyzer, a retrieval-augmented (RAG) method, and an agentic (ReAct) method. Our findings reveal that no single paradigm excels across all tasks. For Task 1, the ReAct agent achieves the highest file-level Accuracy@1 (17.38%), while the Qwen2.5-72B LLM leads at the line level (61.60%), in stark contrast to the Formal-AST method's 1.86%. For the difficult multi-label Task 2, the Claude-Sonnet-4.5 LLM achieves the best Macro-F1 (5.75%), while the RAG method yields the highest Macro-Precision (7.10%). These results highlight the task-dependent strengths of different automated approaches and underscore the value of our benchmark in diagnosing their capabilities. All resources are available at: https://github.com/Haoyi-Zhang/GDPR-Bench-Android.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。