arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2204.08643cs.SEcs.AIcs.LOcs.PL
收藏

基于实例的静态分析规则综合

Example-based Synthesis of Static Analysis Rules

AWS AI(AWS人工智能)

Pranav Garg, Srinivasan Sengamedu SHS

摘要:

静态分析工具具有针对若干代码质量问题的规则,并且这些规则由专家手动创建。在本文中,我们解决的问题,自动合成的代码质量规则的例子。我们制定的规则合成问题,合成一阶逻辑公式的图形表示的代码。我们提出了一种新的合成算法RhoSynth,它是基于线性规划的图形对齐识别感兴趣的规则的代码元素。我们通过利用开发人员所做的代码更改作为正面和负面示例的来源来引导RhoSynth。我们还解决了规则细化,其中的规则是逐步提高额外的用户提供的例子。我们通过合成30多个Java代码质量规则来验证RhoSynth。这些规则已被部署为公司代码审查系统的一部分,根据实时代码审查期间收集的开发人员反馈,其准确率超过75%。通过与最近的基线比较,我们表明,目前国家的最先进的程序合成方法是无法合成这些规则。

英文摘要:

Static Analysis tools have rules for several code quality issues and these rules are created by experts manually. In this paper, we address the problem of automatic synthesis of code quality rules from examples. We formulate the rule synthesis problem as synthesizing first order logic formulas over graph representations of code. We present a new synthesis algorithm RhoSynth that is based on Integer Linear Programming-based graph alignment for identifying code elements of interest to the rule. We bootstrap RhoSynth by leveraging code changes made by developers as the source of positive and negative examples. We also address rule refinement in which the rules are incrementally improved with additional user-provided examples. We validate RhoSynth by synthesizing more than 30 Java code quality rules. These rules have been deployed as part of a code review system in a company and their precision exceeds 75% based on developer feedback collected during live code-reviews. Through comparisons with recent baselines, we show that current state-of-the-art program synthesis approaches are unable to synthesize most of these rules.

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

↑