{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,5]],"date-time":"2026-02-05T06:08:02Z","timestamp":1770271682185,"version":"3.49.0"},"reference-count":69,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA","license":[{"start":{"date-parts":[[2019,10,10]],"date-time":"2019-10-10T00:00:00Z","timestamp":1570665600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/100000001","name":"National Science Foundation","doi-asserted-by":"publisher","award":["1750886"],"award-info":[{"award-number":["1750886"]}],"id":[{"id":"10.13039\/100000001","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2019,10,10]]},"abstract":"<jats:p>In C programs, error specifications, which specify the value range that each function returns to indicate failures, are widely used to check and propagate errors for the sake of reliability and security. Various kinds of C analyzers employ error specifications for different purposes, e.g., to detect error handling bugs, yet a general approach for generating precise specifications is still missing. This limits the applicability of those tools.<\/jats:p><jats:p>In this paper, we solve this problem by developing a machine learning-based approach named MLPEx. It generates error specifications by analyzing only the source code, and is thus general. We propose a novel machine learning paradigm based on transfer learning, enabling MLPEx to require only one-time minimal data labeling from us (as the tool developers) and zero manual labeling efforts from users. To improve the accuracy of generated error specifications, MLPEx extracts and exploits project-specific information. We evaluate MLPEx on 10 projects, including 6 libraries and 4 applications. An investigation of 3,443 functions and 17,750 paths reveals that MLPEx generates error specifications with a precision of 91% and a recall of 94%, significantly higher than those of state-of-the-art approaches. To further demonstrate the usefulness of the generated error specifications, we use them to detect 57 bugs in 5 tested projects.<\/jats:p>","DOI":"10.1145\/3360586","type":"journal-article","created":{"date-parts":[[2019,10,11]],"date-time":"2019-10-11T14:53:33Z","timestamp":1570805613000},"page":"1-30","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":6,"title":["Generating precise error specifications for C: a zero shot learning approach"],"prefix":"10.1145","volume":"3","author":[{"given":"Baijun","family":"Wu","sequence":"first","affiliation":[{"name":"University of Louisiana at Lafayette, USA"}]},{"given":"John Peter","family":"Campora III","sequence":"additional","affiliation":[{"name":"University of Louisiana at Lafayette, USA"}]},{"given":"Yi","family":"He","sequence":"additional","affiliation":[{"name":"University of Louisiana at Lafayette, USA"}]},{"given":"Alexander","family":"Schlecht","sequence":"additional","affiliation":[{"name":"University of Louisiana at Lafayette, USA"}]},{"given":"Sheng","family":"Chen","sequence":"additional","affiliation":[{"name":"University of Louisiana at Lafayette, USA"}]}],"member":"320","published-online":{"date-parts":[[2019,10,10]]},"reference":[{"key":"e_1_2_2_1_1","unstructured":"2007. OWASP TOP 10. https:\/\/www.owasp.org\/images\/e\/e8\/OWASP_Top_10_2007.pdf 2007. OWASP TOP 10. https:\/\/www.owasp.org\/images\/e\/e8\/OWASP_Top_10_2007.pdf"},{"key":"e_1_2_2_2_1","unstructured":"2019. CVE-2019-12818. https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2019-12818 2019. CVE-2019-12818. https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2019-12818"},{"key":"e_1_2_2_3_1","unstructured":"2019. MongoDB. https:\/\/www.mongodb.com\/ 2019. MongoDB. https:\/\/www.mongodb.com\/"},{"key":"e_1_2_2_4_1","unstructured":"2019. Neo4j. https:\/\/neo4j.com\/ 2019. Neo4j. https:\/\/neo4j.com\/"},{"key":"e_1_2_2_5_1","doi-asserted-by":"crossref","unstructured":"Mithun Acharya and Tao Xie. 2009. Mining API Error-Handling Specifications from Source Code. In Proceedings of the 12th International Conference on Fundamental Approaches to Software Engineering: Held As Part of the Joint European Conferences on Theory and Practice of Software ETAPS 2009 (FASE \u201909). Springer-Verlag Berlin Heidelberg 370\u2013384. Mithun Acharya and Tao Xie. 2009. Mining API Error-Handling Specifications from Source Code. In Proceedings of the 12th International Conference on Fundamental Approaches to Software Engineering: Held As Part of the Joint European Conferences on Theory and Practice of Software ETAPS 2009 (FASE \u201909). Springer-Verlag Berlin Heidelberg 370\u2013384.","DOI":"10.1007\/978-3-642-00593-0_25"},{"key":"e_1_2_2_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/3212695"},{"key":"e_1_2_2_7_1","volume-title":"Proceedings of the 6th International Conference on Learning Representations (ICLR \u201918)","author":"Allamanis Miltiadis","year":"2018"},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1145\/3192366.3192412"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/3290353"},{"key":"e_1_2_2_10_1","volume-title":"Introduction to machine learning","author":"Alpaydin Ethem"},{"key":"e_1_2_2_11_1","volume-title":"Software change impact analysis","author":"Arnold Robert S"},{"key":"e_1_2_2_12_1","volume-title":"5th International Conference on Learning Representations (ICLR \u201917)","author":"Balog Matej","year":"2017"},{"key":"e_1_2_2_13_1","volume-title":"Representation learning: A review and new perspectives","author":"Bengio Yoshua","year":"2013"},{"key":"e_1_2_2_14_1","volume-title":"Random forests. Machine learning 45, 1","author":"Breiman Leo","year":"2001"},{"key":"e_1_2_2_15_1","doi-asserted-by":"crossref","volume-title":"Classification and regression trees","author":"Breiman Leo","DOI":"10.1201\/9781315139470"},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/3133925"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1109\/TC.1982.1676035"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/2908080.2908126"},{"key":"e_1_2_2_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/3236024.3236059"},{"key":"e_1_2_2_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/1250734.1250784"},{"key":"e_1_2_2_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/1375581.1375615"},{"key":"e_1_2_2_23_1","volume-title":"Neural networks and the bias\/variance dilemma. Neural computation 4, 1","author":"Geman Stuart","year":"1992"},{"key":"e_1_2_2_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/512976.512997"},{"key":"e_1_2_2_25_1","volume-title":"6th USENIX Conference on File and Storage Technologies (FAST \u201908)","volume":"8","author":"Gunawi Haryadi S","year":"2008"},{"key":"e_1_2_2_26_1","volume-title":"The elements of statistical learning","author":"Hastie Trevor"},{"key":"e_1_2_2_27_1","doi-asserted-by":"publisher","DOI":"10.1093\/bioinformatics\/bti171"},{"key":"e_1_2_2_28_1","doi-asserted-by":"crossref","unstructured":"Jiayuan Huang Arthur Gretton Karsten Borgwardt Bernhard Sch\u00f6lkopf and Alex J Smola. 2007. Correcting sample selection bias by unlabeled data. In Advances in neural information processing systems. 601\u2013608. Jiayuan Huang Arthur Gretton Karsten Borgwardt Bernhard Sch\u00f6lkopf and Alex J Smola. 2007. Correcting sample selection bias by unlabeled data. In Advances in neural information processing systems. 601\u2013608.","DOI":"10.7551\/mitpress\/7503.003.0080"},{"key":"e_1_2_2_29_1","volume-title":"Automatically Detecting Error Handling Bugs Using Error Specifications. In USENIX Security Symposium. 345\u2013362","author":"Jana Suman","year":"2016"},{"key":"e_1_2_2_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/2970276.2970354"},{"key":"e_1_2_2_31_1","volume-title":"Logistic regression","author":"Kleinbaum David G"},{"key":"e_1_2_2_32_1","volume-title":"The role of domain knowledge in a large scale data mining project. Methods and Applications of Artificial Intelligence","author":"Kopanas Ioannis","year":"2002"},{"key":"e_1_2_2_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3138818"},{"key":"e_1_2_2_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/3136625"},{"key":"e_1_2_2_35_1","doi-asserted-by":"publisher","DOI":"10.1145\/2884781.2884870"},{"key":"e_1_2_2_36_1","volume-title":"Proceedings of 7th IEEE International Conference on Tools with Artificial Intelligence. IEEE, 388\u2013391","author":"Liu Huan","year":"1995"},{"key":"e_1_2_2_37_1","doi-asserted-by":"publisher","DOI":"10.1145\/2837614.2837617"},{"key":"e_1_2_2_38_1","first-page":"2579","article-title":"Visualizing data using t-SNE","author":"van der Maaten Laurens","year":"2008","journal-title":"Journal of machine learning research 9"},{"key":"e_1_2_2_39_1","doi-asserted-by":"publisher","DOI":"10.1145\/2063509.2063511"},{"key":"e_1_2_2_40_1","unstructured":"Steven S Muchnick. 1997. Advanced compiler design implementation. Morgan Kaufmann. Steven S Muchnick. 1997. Advanced compiler design implementation. Morgan Kaufmann."},{"key":"e_1_2_2_41_1","volume-title":"Machine learning: a probabilistic perspective","author":"Murphy Kevin P"},{"key":"e_1_2_2_42_1","doi-asserted-by":"publisher","DOI":"10.1145\/2896587"},{"key":"e_1_2_2_43_1","doi-asserted-by":"publisher","DOI":"10.1145\/2786805.2786834"},{"key":"e_1_2_2_44_1","doi-asserted-by":"publisher","DOI":"10.1145\/42372.42379"},{"key":"e_1_2_2_45_1","volume-title":"IJCAI-99 workshop on machine learning for information filtering","volume":"1","author":"Nigam Kamal","year":"1999"},{"key":"e_1_2_2_46_1","doi-asserted-by":"publisher","DOI":"10.1109\/TKDE.2009.191"},{"key":"e_1_2_2_47_1","doi-asserted-by":"publisher","DOI":"10.5555\/1953048.2078195"},{"key":"e_1_2_2_48_1","doi-asserted-by":"publisher","DOI":"10.1145\/1993498.1993558"},{"key":"e_1_2_2_49_1","doi-asserted-by":"publisher","DOI":"10.1145\/3276517"},{"key":"e_1_2_2_50_1","doi-asserted-by":"publisher","DOI":"10.1145\/2594291.2594321"},{"key":"e_1_2_2_51_1","volume-title":"A stochastic approximation method. The annals of mathematical statistics","author":"Robbins Herbert","year":"1951"},{"key":"e_1_2_2_52_1","doi-asserted-by":"publisher","DOI":"10.1145\/1542476.1542506"},{"key":"e_1_2_2_53_1","doi-asserted-by":"publisher","DOI":"10.1145\/1806672.1806687"},{"key":"e_1_2_2_54_1","doi-asserted-by":"crossref","unstructured":"Olga Russakovsky Jia Deng Hao Su Jonathan Krause Sanjeev Satheesh Sean Ma Zhiheng Huang Andrej Karpathy Aditya Khosla Michael Bernstein etal 2015. Imagenet large scale visual recognition challenge. International journal of computer vision 115 3 (2015) 211\u2013252. Olga Russakovsky Jia Deng Hao Su Jonathan Krause Sanjeev Satheesh Sean Ma Zhiheng Huang Andrej Karpathy Aditya Khosla Michael Bernstein et al. 2015. Imagenet large scale visual recognition challenge. International journal of computer vision 115 3 (2015) 211\u2013252.","DOI":"10.1007\/s11263-015-0816-y"},{"key":"e_1_2_2_55_1","doi-asserted-by":"publisher","DOI":"10.1145\/1401890.1401965"},{"key":"e_1_2_2_56_1","doi-asserted-by":"publisher","DOI":"10.1016\/S0378-3758(00)00115-4"},{"key":"e_1_2_2_57_1","unstructured":"Masashi Sugiyama Shinichi Nakajima Hisashi Kashima Paul V Buenau and Motoaki Kawanabe. 2008. Direct importance estimation with model selection and its application to covariate shift adaptation. In Advances in neural information processing systems. 1433\u20131440. Masashi Sugiyama Shinichi Nakajima Hisashi Kashima Paul V Buenau and Motoaki Kawanabe. 2008. Direct importance estimation with model selection and its application to covariate shift adaptation. In Advances in neural information processing systems. 1433\u20131440."},{"key":"e_1_2_2_58_1","doi-asserted-by":"publisher","DOI":"10.1109\/EDCC.2006.3"},{"key":"e_1_2_2_59_1","doi-asserted-by":"publisher","DOI":"10.1145\/3106237.3106300"},{"key":"e_1_2_2_60_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-1-4757-3264-1"},{"key":"e_1_2_2_61_1","doi-asserted-by":"publisher","DOI":"10.1049\/iet-its.2018.5104"},{"key":"e_1_2_2_62_1","volume-title":"Mining temporal specifications for error detection. Tools and Algorithms for the Construction and Analysis of Systems","author":"Weimer Westley","year":"2005"},{"key":"e_1_2_2_63_1","volume-title":"Yi He, Alexander Schlecht, and Sheng Chen.","author":"Wu Baijun","year":"2019"},{"key":"e_1_2_2_64_1","volume-title":"Learning User Friendly Type Error Messages. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA \u201917)","author":"Wu Baijun","year":"2017"},{"key":"e_1_2_2_65_1","doi-asserted-by":"publisher","DOI":"10.1609\/aaai.v33i01.3301782"},{"key":"e_1_2_2_66_1","doi-asserted-by":"publisher","DOI":"10.1109\/SP.2014.44"},{"key":"e_1_2_2_67_1","doi-asserted-by":"publisher","DOI":"10.1145\/1015330.1015425"},{"key":"e_1_2_2_68_1","doi-asserted-by":"publisher","DOI":"10.1038\/s41524-018-0081-z"},{"key":"e_1_2_2_69_1","doi-asserted-by":"publisher","DOI":"10.1145\/2908080.2908125"},{"key":"e_1_2_2_70_1","volume-title":"Introduction to semi-supervised learning. Synthesis lectures on artificial intelligence and machine learning 3, 1","author":"Zhu Xiaojin","year":"2009"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3360586","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3360586","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3360586","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T23:22:59Z","timestamp":1750202579000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3360586"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2019,10,10]]},"references-count":69,"journal-issue":{"issue":"OOPSLA","published-print":{"date-parts":[[2019,10,10]]}},"alternative-id":["10.1145\/3360586"],"URL":"https:\/\/doi.org\/10.1145\/3360586","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2019,10,10]]},"assertion":[{"value":"2019-10-10","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}