{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,1,29]],"date-time":"2026-01-29T23:51:20Z","timestamp":1769730680156,"version":"3.49.0"},"reference-count":63,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA2","license":[{"start":{"date-parts":[[2022,10,31]],"date-time":"2022-10-31T00:00:00Z","timestamp":1667174400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2022,10,31]]},"abstract":"<jats:p>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.<\/jats:p>","DOI":"10.1145\/3563350","type":"journal-article","created":{"date-parts":[[2022,10,31]],"date-time":"2022-10-31T20:23:35Z","timestamp":1667247815000},"page":"1757-1787","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":5,"title":["Synthesizing code quality rules from examples"],"prefix":"10.1145","volume":"6","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-0575-6320","authenticated-orcid":false,"given":"Pranav","family":"Garg","sequence":"first","affiliation":[{"name":"AWS, USA"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-1847-8398","authenticated-orcid":false,"given":"Srinivasan H.","family":"Sengamedu","sequence":"additional","affiliation":[{"name":"Amazon, USA"}]}],"member":"320","published-online":{"date-parts":[[2022,10,31]]},"reference":[{"key":"e_1_2_2_1_1","volume-title":"30th USENIX Security Symposium, USENIX Security 2021","author":"Ahmadi Mansour","year":"2021","unstructured":"Mansour Ahmadi , Reza Mirzazade Farkhani , Ryan Williams , and Long Lu . 2021 . Finding Bugs Using Your Own Code: Detecting Functionally-similar yet Inconsistent Code . In 30th USENIX Security Symposium, USENIX Security 2021 , August 11-13, 2021, Michael Bailey and Rachel Greenstadt (Eds.). USENIX Association , 2025\u20132040. https:\/\/www.usenix.org\/conference\/usenixsecurity21\/presentation\/ahmadi Mansour Ahmadi, Reza Mirzazade Farkhani, Ryan Williams, and Long Lu. 2021. Finding Bugs Using Your Own Code: Detecting Functionally-similar yet Inconsistent Code. In 30th USENIX Security Symposium, USENIX Security 2021, August 11-13, 2021, Michael Bailey and Rachel Greenstadt (Eds.). USENIX Association, 2025\u20132040. https:\/\/www.usenix.org\/conference\/usenixsecurity21\/presentation\/ahmadi"},{"key":"e_1_2_2_2_1","doi-asserted-by":"publisher","DOI":"10.1016\/S0022-0000(05)80071-6"},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-66158-2_44"},{"key":"e_1_2_2_4_1","volume-title":"International Conference on Learning Representations. https:\/\/openreview.net\/forum?id=BJOFETxR-","author":"Allamanis Miltiadis","year":"2018","unstructured":"Miltiadis Allamanis , Marc Brockschmidt , and Mahmoud Khademi . 2018 . Learning to Represent Programs with Graphs . In International Conference on Learning Representations. https:\/\/openreview.net\/forum?id=BJOFETxR- Miltiadis Allamanis, Marc Brockschmidt, and Mahmoud Khademi. 2018. Learning to Represent Programs with Graphs. In International Conference on Learning Representations. https:\/\/openreview.net\/forum?id=BJOFETxR-"},{"key":"e_1_2_2_5_1","volume-title":"Self-Supervised Bug Detection and Repair. CoRR, abs\/2105.12787","author":"Allamanis Miltiadis","year":"2021","unstructured":"Miltiadis Allamanis , Henry Jackson-Flux , and Marc Brockschmidt . 2021. Self-Supervised Bug Detection and Repair. CoRR, abs\/2105.12787 ( 2021 ), arXiv:2105.12787. arxiv:2105.12787 Miltiadis Allamanis, Henry Jackson-Flux, and Marc Brockschmidt. 2021. Self-Supervised Bug Detection and Repair. CoRR, abs\/2105.12787 (2021), arXiv:2105.12787. arxiv:2105.12787"},{"key":"e_1_2_2_6_1","doi-asserted-by":"publisher","DOI":"10.1109\/FMCAD.2013.6679385"},{"key":"e_1_2_2_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/3360585"},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-10575-8_11"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/3485511"},{"key":"e_1_2_2_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/3338906.3338952"},{"key":"e_1_2_2_11_1","volume-title":"Test Driven Development","author":"Beck Kent","unstructured":"Kent Beck . 2002. Test Driven Development . By Example (Addison-Wesley Signature). Addison-Wesley Longman , Amsterdam. isbn:0321146530 Kent Beck. 2002. Test Driven Development. By Example (Addison-Wesley Signature). Addison-Wesley Longman, Amsterdam. isbn:0321146530"},{"key":"e_1_2_2_12_1","volume-title":"Proceedings of the 38th International Conference on Machine Learning, Marina Meila and Tong Zhang (Eds.) (Proceedings of Machine Learning Research","volume":"791","author":"Berabi Berkay","year":"2021","unstructured":"Berkay Berabi , Jingxuan He , Veselin Raychev , and Martin Vechev . 2021 . TFix: Learning to Fix Coding Errors with a Text-to-Text Transformer . In Proceedings of the 38th International Conference on Machine Learning, Marina Meila and Tong Zhang (Eds.) (Proceedings of Machine Learning Research , Vol. 139). PMLR, 780\u2013 791 . https:\/\/proceedings.mlr.press\/v139\/berabi21a.html Berkay Berabi, Jingxuan He, Veselin Raychev, and Martin Vechev. 2021. TFix: Learning to Fix Coding Errors with a Text-to-Text Transformer. In Proceedings of the 38th International Conference on Machine Learning, Marina Meila and Tong Zhang (Eds.) (Proceedings of Machine Learning Research, Vol. 139). PMLR, 780\u2013791. https:\/\/proceedings.mlr.press\/v139\/berabi21a.html"},{"key":"e_1_2_2_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/3236024.3236032"},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.5555\/1792734.1792766"},{"key":"e_1_2_2_15_1","volume-title":"RobustFill: Neural Program Learning under Noisy I\/O. CoRR, abs\/1703.07469","author":"Devlin Jacob","year":"2017","unstructured":"Jacob Devlin , Jonathan Uesato , Surya Bhupatiraju , Rishabh Singh , Abdel-rahman Mohamed, and Pushmeet Kohli . 2017. RobustFill: Neural Program Learning under Noisy I\/O. CoRR, abs\/1703.07469 ( 2017 ), arxiv:1703.07469. arxiv:1703.07469 Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. 2017. RobustFill: Neural Program Learning under Noisy I\/O. CoRR, abs\/1703.07469 (2017), arxiv:1703.07469. arxiv:1703.07469"},{"key":"e_1_2_2_16_1","volume-title":"Semantic Code Repair using Neuro-Symbolic Transformation Networks. CoRR, abs\/1710.11054","author":"Devlin Jacob","year":"2017","unstructured":"Jacob Devlin , Jonathan Uesato , Rishabh Singh , and Pushmeet Kohli . 2017. Semantic Code Repair using Neuro-Symbolic Transformation Networks. CoRR, abs\/1710.11054 ( 2017 ), arxiv:1710.11054 Jacob Devlin, Jonathan Uesato, Rishabh Singh, and Pushmeet Kohli. 2017. Semantic Code Repair using Neuro-Symbolic Transformation Networks. CoRR, abs\/1710.11054 (2017), arxiv:1710.11054"},{"key":"e_1_2_2_17_1","volume-title":"8th International Conference on Learning Representations, ICLR 2020","author":"Dinella Elizabeth","year":"2020","unstructured":"Elizabeth Dinella , Hanjun Dai , Ziyang Li , Mayur Naik , Le Song , and Ke Wang . 2020 . Hoppity: Learning Graph Transformations to Detect and Fix Bugs in Programs . In 8th International Conference on Learning Representations, ICLR 2020 , Addis Ababa, Ethiopia , April 26-30, 2020. OpenReview.net. https:\/\/openreview.net\/forum?id=SJeqs6EFvB Elizabeth Dinella, Hanjun Dai, Ziyang Li, Mayur Naik, Le Song, and Ke Wang. 2020. Hoppity: Learning Graph Transformations to Detect and Fix Bugs in Programs. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. https:\/\/openreview.net\/forum?id=SJeqs6EFvB"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/2642937.2642982"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/3485530"},{"key":"e_1_2_2_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/24039.24041"},{"key":"e_1_2_2_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/3485538"},{"key":"e_1_2_2_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/1925844.1926423"},{"key":"e_1_2_2_23_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-71237-6_1"},{"key":"e_1_2_2_24_1","doi-asserted-by":"publisher","DOI":"10.1007\/BF00114802"},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/3385412.3386025"},{"key":"e_1_2_2_26_1","volume-title":"6th International Conference on Learning Representations, ICLR","author":"Kalyan Ashwin","year":"2018","unstructured":"Ashwin Kalyan , Abhishek Mohta , Oleksandr Polozov , Dhruv Batra , Prateek Jain , and Sumit Gulwani . 2018. Neural-Guided Deductive Search for Real-Time Program Synthesis from Examples . In 6th International Conference on Learning Representations, ICLR 2018 , Vancouver, BC , Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview .net. https:\/\/openreview.net\/forum?id=rywDjg-RW Ashwin Kalyan, Abhishek Mohta, Oleksandr Polozov, Dhruv Batra, Prateek Jain, and Sumit Gulwani. 2018. Neural-Guided Deductive Search for Real-Time Program Synthesis from Examples. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net. https:\/\/openreview.net\/forum?id=rywDjg-RW"},{"key":"e_1_2_2_27_1","doi-asserted-by":"publisher","DOI":"10.1145\/2901739.2901749"},{"key":"e_1_2_2_28_1","volume-title":"Interactive Program Synthesis. CoRR, abs\/1703.03539","author":"Le Vu","year":"2017","unstructured":"Vu Le , Daniel Perelman , Oleksandr Polozov , Mohammad Raza , Abhishek Udupa , and Sumit Gulwani . 2017. Interactive Program Synthesis. CoRR, abs\/1703.03539 ( 2017 ), arXiv:1703.03539. arxiv:1703.03539 Vu Le, Daniel Perelman, Oleksandr Polozov, Mohammad Raza, Abhishek Udupa, and Sumit Gulwani. 2017. Interactive Program Synthesis. CoRR, abs\/1703.03539 (2017), arXiv:1703.03539. arxiv:1703.03539"},{"key":"e_1_2_2_29_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.patcog.2017.07.029"},{"key":"e_1_2_2_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/1015330.1015404"},{"key":"e_1_2_2_31_1","doi-asserted-by":"publisher","DOI":"10.1109\/SP40001.2021.00090"},{"key":"e_1_2_2_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/1081706.1081755"},{"key":"e_1_2_2_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/2914770.2837617"},{"key":"e_1_2_2_34_1","volume-title":"GENSYNTH: Synthesizing Datalog Programs without Language Bias. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI","author":"Mendelson Jonathan","year":"2021","unstructured":"Jonathan Mendelson , Aaditya Naik , Mukund Raghothaman , and Mayur Naik . 2021 . GENSYNTH: Synthesizing Datalog Programs without Language Bias. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021. AAAI Press , 6444\u20136453. https:\/\/ojs.aaai.org\/index.php\/AAAI\/article\/view\/16799 Jonathan Mendelson, Aaditya Naik, Mukund Raghothaman, and Mayur Naik. 2021. GENSYNTH: Synthesizing Datalog Programs without Language Bias. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021. AAAI Press, 6444\u20136453. https:\/\/ojs.aaai.org\/index.php\/AAAI\/article\/view\/16799"},{"key":"e_1_2_2_35_1","volume-title":"McKinley","author":"Meng Na","year":"2013","unstructured":"Na Meng , Miryung Kim , and Kathryn S . McKinley . 2013 . LASE : Locating and Applying Systematic Edits by Learning from Examples. In Proceedings of the 2013 International Conference on Software Engineering (ICSE \u201913). IEEE Press , 502\u2013511. isbn:9781467330763 Na Meng, Miryung Kim, and Kathryn S. McKinley. 2013. LASE: Locating and Applying Systematic Edits by Learning from Examples. In Proceedings of the 2013 International Conference on Software Engineering (ICSE \u201913). IEEE Press, 502\u2013511. isbn:9781467330763"},{"key":"e_1_2_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3360569"},{"key":"e_1_2_2_37_1","volume-title":"Machine Learning","author":"Mitchell Tom M.","unstructured":"Tom M. Mitchell . 1997. Machine Learning . McGraw-Hill , New York . isbn:978-0-07-042807-2 Tom M. Mitchell. 1997. Machine Learning. McGraw-Hill, New York. isbn:978-0-07-042807-2"},{"key":"e_1_2_2_38_1","doi-asserted-by":"publisher","DOI":"10.4230\/LIPIcs.ECOOP.2022.14"},{"key":"e_1_2_2_39_1","doi-asserted-by":"publisher","DOI":"10.1145\/3472749.3474737"},{"key":"e_1_2_2_40_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE43902.2021.00023"},{"key":"e_1_2_2_41_1","doi-asserted-by":"publisher","DOI":"10.1145\/3192366.3192403"},{"key":"e_1_2_2_42_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE43902.2021.00077"},{"key":"e_1_2_2_43_1","doi-asserted-by":"publisher","DOI":"10.1145\/2814270.2814310"},{"key":"e_1_2_2_44_1","doi-asserted-by":"publisher","DOI":"10.1145\/3276517"},{"key":"e_1_2_2_45_1","doi-asserted-by":"publisher","DOI":"10.1145\/3371130"},{"key":"e_1_2_2_46_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICCQ51190.2021.9392977"},{"key":"e_1_2_2_47_1","doi-asserted-by":"publisher","DOI":"10.1109\/ACCESS.2020.2987631"},{"key":"e_1_2_2_48_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2017.44"},{"key":"e_1_2_2_49_1","volume-title":"Learning Quick Fixes from Code Repositories. CoRR, abs\/1803.03806","author":"Rolim Reudismam","year":"2018","unstructured":"Reudismam Rolim , Gustavo Soares , Rohit Gheyi , and Loris D\u2019Antoni . 2018. Learning Quick Fixes from Code Repositories. CoRR, abs\/1803.03806 ( 2018 ), arxiv:1803.03806. arxiv:1803.03806 Reudismam Rolim, Gustavo Soares, Rohit Gheyi, and Loris D\u2019Antoni. 2018. Learning Quick Fixes from Code Repositories. CoRR, abs\/1803.03806 (2018), arxiv:1803.03806. arxiv:1803.03806"},{"key":"e_1_2_2_50_1","unstructured":"Evgeniy Ryzhkov. 2011. How to add a new diagnostic rule into PVS-Studio? Days from developers\u2019 life. https:\/\/pvs-studio.com\/en\/blog\/posts\/0110\/ \t\t\t\t  Evgeniy Ryzhkov. 2011. How to add a new diagnostic rule into PVS-Studio? Days from developers\u2019 life. https:\/\/pvs-studio.com\/en\/blog\/posts\/0110\/"},{"key":"e_1_2_2_51_1","volume-title":"Theory of Linear and Integer Programming","author":"Schrijver Alexander","year":"1908","unstructured":"Alexander Schrijver . 1986. Theory of Linear and Integer Programming . John Wiley & Sons, Inc. , USA. isbn:047 1908 541 Alexander Schrijver. 1986. Theory of Linear and Integer Programming. John Wiley & Sons, Inc., USA. isbn:0471908541"},{"key":"e_1_2_2_52_1","doi-asserted-by":"publisher","DOI":"10.1145\/3236024.3236034"},{"key":"e_1_2_2_53_1","doi-asserted-by":"publisher","DOI":"10.24963\/ijcai.2019\/847"},{"key":"e_1_2_2_54_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2019.00044"},{"key":"e_1_2_2_55_1","doi-asserted-by":"publisher","DOI":"10.1109\/SANER.2018.8330203"},{"key":"e_1_2_2_57_1","unstructured":"Amann Sven and Hoan Anh Nguyen. 2019. MUDetect : An API-Misuse Detector. https:\/\/github.com\/stg-tud\/MUDetect \t\t\t\t  Amann Sven and Hoan Anh Nguyen. 2019. MUDetect : An API-Misuse Detector. https:\/\/github.com\/stg-tud\/MUDetect"},{"key":"e_1_2_2_58_1","doi-asserted-by":"publisher","DOI":"10.1145\/3453483.3454098"},{"key":"e_1_2_2_59_1","doi-asserted-by":"publisher","DOI":"10.1145\/3238147.3240732"},{"key":"e_1_2_2_60_1","volume-title":"International Conference on Learning Representations. https:\/\/openreview.net\/forum?id=ByloJ20qtm","author":"Vasic Marko","year":"2019","unstructured":"Marko Vasic , Aditya Kanade , Petros Maniatis , David Bieber , and Rishabh singh. 2019 . Neural Program Repair by Jointly Learning to Localize and Repair . In International Conference on Learning Representations. https:\/\/openreview.net\/forum?id=ByloJ20qtm Marko Vasic, Aditya Kanade, Petros Maniatis, David Bieber, and Rishabh singh. 2019. Neural Program Repair by Jointly Learning to Localize and Repair. In International Conference on Learning Representations. https:\/\/openreview.net\/forum?id=ByloJ20qtm"},{"key":"e_1_2_2_61_1","doi-asserted-by":"publisher","DOI":"10.1145\/3485477"},{"key":"e_1_2_2_62_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE43902.2021.00079"},{"key":"e_1_2_2_63_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICCV.2013.207"},{"key":"e_1_2_2_64_1","volume-title":"Proceedings of the 25th USENIX Conference on Security Symposium (SEC\u201916)","author":"Yun Insu","year":"2016","unstructured":"Insu Yun , Changwoo Min , Xujie Si , Yeongjin Jang , Taesoo Kim , and Mayur Naik . 2016 . APISAN: Sanitizing API Usages through Semantic Cross-Checking . In Proceedings of the 25th USENIX Conference on Security Symposium (SEC\u201916) . USENIX Association, USA. 363\u2013378. isbn:978 1931971324 Insu Yun, Changwoo Min, Xujie Si, Yeongjin Jang, Taesoo Kim, and Mayur Naik. 2016. APISAN: Sanitizing API Usages through Semantic Cross-Checking. In Proceedings of the 25th USENIX Conference on Security Symposium (SEC\u201916). USENIX Association, USA. 363\u2013378. isbn:9781931971324"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3563350","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3563350","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T19:02:33Z","timestamp":1750186953000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3563350"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2022,10,31]]},"references-count":63,"journal-issue":{"issue":"OOPSLA2","published-print":{"date-parts":[[2022,10,31]]}},"alternative-id":["10.1145\/3563350"],"URL":"https:\/\/doi.org\/10.1145\/3563350","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2022,10,31]]},"assertion":[{"value":"2022-10-31","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}