Synthesizing Code Quality Rules from Examples

被引:1
|
作者
Garg, Pranav [1 ]
Sengamedu, Srinivasan H. [2 ]
机构
[1] Amazon Web Serv, 7 34th St, New York, NY 10001 USA
[2] Amazon, 2250 7th Ave, Seattle, WA 98121 USA
来源
关键词
Program Synthesis; GRAPH;
D O I
10.1145/3563350
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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 Amazon CodeGuru Reviewer and their precision exceeds 75% based on developer feedback collected during live code-reviews within Amazon. Through comparisons with recent baselines, we show that current state-of-the-art program synthesis approaches are unable to synthesize most of these rules.
引用
收藏
页数:31
相关论文
共 50 条
  • [1] Synthesizing Extraction Rules from User Examples with SEER
    Hanafi, Maeda F.
    Abouzied, Azza
    Chiticariu, Laura
    Li, Yunyao
    [J]. SIGMOD'17: PROCEEDINGS OF THE 2017 ACM INTERNATIONAL CONFERENCE ON MANAGEMENT OF DATA, 2017, : 1687 - 1690
  • [2] Synthesizing Entity Matching Rules by Examples
    Singh, Rohit
    Meduri, Venkata Vamsikrishna
    Elmagarmid, Ahmed
    Madden, Samuel
    Papotti, Paolo
    Quiane-Ruiz, Jorge-Arnulfo
    Solar-Lezama, Armando
    Tang, Nan
    [J]. PROCEEDINGS OF THE VLDB ENDOWMENT, 2017, 11 (02): : 189 - 202
  • [3] Synthesizing Argumentation Frameworks from Examples
    Niskanen, Andreas
    Wallner, Johannes P.
    Jarvisalo, Matti
    [J]. ECAI 2016: 22ND EUROPEAN CONFERENCE ON ARTIFICIAL INTELLIGENCE, 2016, 285 : 551 - 559
  • [4] Synthesizing argumentation frameworks from examples
    Niskanen, Andreas
    Wallner, Johannes P.
    Järvisalo, Matti
    [J]. Journal of Artificial Intelligence Research, 2019, 66 : 503 - 554
  • [5] Synthesizing Pattern Programs from Examples
    So, Sunbeom
    Oh, Hakjoo
    [J]. PROCEEDINGS OF THE TWENTY-SEVENTH INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE, 2018, : 1618 - 1624
  • [6] Synthesizing Argumentation Frameworks from Examples
    Niskanen, Andreas
    Wallner, Johannes P.
    Jarvisalo, Matti
    [J]. JOURNAL OF ARTIFICIAL INTELLIGENCE RESEARCH, 2019, 66 : 503 - 554
  • [7] SYNTHESIZING A COLOR ALGORITHM FROM EXAMPLES
    HURLBERT, AC
    POGGIO, TA
    [J]. SCIENCE, 1988, 239 (4839) : 482 - 485
  • [8] NoFAQ: Synthesizing Command Repairs from Examples
    D'Antoni, Loris
    Singh, Rishabh
    Vaughn, Michael
    [J]. ESEC/FSE 2017: PROCEEDINGS OF THE 2017 11TH JOINT MEETING ON FOUNDATIONS OF SOFTWARE ENGINEERING, 2017, : 582 - 592
  • [9] Synthesizing Software Verifiers from Proof Rules
    Grebenshchikov, Sergey
    Lopes, Nuno P.
    Popeea, Corneliu
    Rybalchenko, Andrey
    [J]. ACM SIGPLAN NOTICES, 2012, 47 (06) : 405 - 416
  • [10] A Method To Generate Rules From Examples
    Sasao, Tsutomu
    [J]. 2022 IEEE 52ND INTERNATIONAL SYMPOSIUM ON MULTIPLE-VALUED LOGIC (ISMVL 2022), 2022, : 176 - 181