检测企业应用中的元数据相关缺陷
Detecting Metadata-Related Bugs in Enterprise Applications
AI总结:
本文提出领域特定语言 RSL 和跨文件静态分析工具 MeCheck,用于检测企业应用中 Java 注解与 XML 元数据的误用,实验显示其精确率达 100%、召回率 96%,可有效保障元数据正确使用。
摘要:
在 Java 框架(如 Spring)上构建企业应用(EAs)时,开发人员通常通过元数据(即 Java 注解和 XML 文件)来配置应用组件。开发人员正确使用元数据具有挑战性,因为使用规则可能很复杂,而现有工具提供的帮助有限。当开发人员误用元数据时,企业应用会被错误配置,这些缺陷可能触发错误的运行时行为或引入安全漏洞。为了帮助开发人员正确使用元数据,本文提出了(1)RSL——一种领域专家可以用来规定元数据检查规则的领域特定语言,以及(2)MeCheck——一种接收 RSL 规则和企业应用以检查规则违规的工具。借助 RSL,领域专家(例如 Java 框架的开发人员)可以通过定义 XML 文件、注解和 Java 代码之间的内容一致性来指定元数据检查规则。给定这样的 RSL 规则和待扫描的程序,MeCheck 将规则解释为跨文件静态分析器,这些分析器扫描 Java 和/或 XML 文件以收集信息并查找一致性违规。为了进行评估,我们研究了 Spring 和 JUnit 文档,手动定义了 15 条规则,并创建了包含 115 个开源企业应用的 2 个数据集。第一个数据集包含 45 个企业应用,以及 45 个手动注入缺陷的真实标注。第二个数据集包含 70 个企业应用的多个版本。我们观察到,MeCheck 在第一个数据集中识别缺陷的精确率为 100%,召回率为 96%,F 值为 98%。它在第二个数据集中报告了 156 个缺陷,其中 53 个缺陷已被开发人员修复。我们的评估表明,MeCheck 有助于确保元数据的正确使用。
英文摘要:
When building enterprise applications (EAs) on Java frameworks (e.g., Spring), developers often configure application components via metadata (i.e., Java annotations and XML files). It is challenging for developers to correctly use metadata, because the usage rules can be complex and existing tools provide limited assistance. When developers misuse metadata, EAs become misconfigured, which defects can trigger erroneous runtime behaviors or introduce security vulnerabilities. To help developers correctly use metadata, this paper presents (1) RSL -- a domain-specific language that domain experts can adopt to prescribe metadata checking rules, and (2) MeCheck -- a tool that takes in RSL rules and EAs to check for rule violations. With RSL, domain experts (e.g., developers of a Java framework) can specify metadata checking rules by defining content consistency among XML files, annotations, and Java code. Given such RSL rules and a program to scan, MeCheck interprets rules as cross-file static analyzers, which analyzers scan Java and/or XML files to gather information and look for consistency violations. For evaluation, we studied the Spring and JUnit documentation to manually define 15 rules, and created 2 datasets with 115 open-source EAs. The first dataset includes 45 EAs, and the ground truth of 45 manually injected bugs. The second dataset includes multiple versions of 70 EAs. We observed that MeCheck identified bugs in the first dataset with 100% precision, 96% recall, and 98% F-score. It reported 156 bugs in the second dataset, 53 of which bugs were already fixed by developers. Our evaluation shows that MeCheck helps ensure the correct usage of metadata.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。