{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,6,20]],"date-time":"2025-06-20T04:08:53Z","timestamp":1750392533265,"version":"3.41.0"},"reference-count":41,"publisher":"Association for Computing Machinery (ACM)","issue":"FSE","funder":[{"name":"National Research Foundation of Korea","award":["RS-2021-NR060080"],"award-info":[{"award-number":["RS-2021-NR060080"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. ACM Softw. Eng."],"published-print":{"date-parts":[[2025,6,19]]},"abstract":"<jats:p>We present UnitCon, a system for synthesizing targeted unit testsfor runtime exceptions in Java programs. Targeted unit tests aim to reveal a bug at a specific location in the program under test. This capability benefits various tasks in software development, such as patch testing, crash reproduction, or static analysis alarm inspection. However, conventional unit test generation tools are mainly designed for regression tests by maximizing code coverage; hence they are not effective at such target-specific tasks. In this paper, we propose a novel synthesis technique that effectively guides the search for targeted unit tests. The key idea is to use static analysis to prune and prioritize the search space by estimating the semantics of candidate test cases. This allows us to efficiently focus on promising unit tests that are likely to trigger runtime exceptions at the target location. According to our experiments on a suite of Java programs, our approach outperforms the state-of-the-art unit test generation tools. We also applied UnitCon for inspecting static analysis alarms for null pointer exceptions (NPEs) in 51 open-source projects and discovered 21 previously unknown NPE bugs.<\/jats:p>","DOI":"10.1145\/3729362","type":"journal-article","created":{"date-parts":[[2025,6,19]],"date-time":"2025-06-19T15:15:34Z","timestamp":1750346134000},"page":"2053-2074","source":"Crossref","is-referenced-by-count":0,"title":["UnitCon: Synthesizing Targeted Unit Tests for Java Runtime Exceptions"],"prefix":"10.1145","volume":"2","author":[{"ORCID":"https:\/\/orcid.org\/0009-0004-8095-7300","authenticated-orcid":false,"given":"Sujin","family":"Jang","sequence":"first","affiliation":[{"name":"KAIST, Daejeon, Republic of Korea"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-9810-3635","authenticated-orcid":false,"given":"Yeonhee","family":"Ryou","sequence":"additional","affiliation":[{"name":"KAIST, Daejeon, Republic of Korea"}]},{"ORCID":"https:\/\/orcid.org\/0009-0005-5696-185X","authenticated-orcid":false,"given":"Heewon","family":"Lee","sequence":"additional","affiliation":[{"name":"KAIST, Daejeon, Republic of Korea"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2671-0142","authenticated-orcid":false,"given":"Kihong","family":"Heo","sequence":"additional","affiliation":[{"name":"KAIST, Daejeon, Republic of Korea"}]}],"member":"320","published-online":{"date-parts":[[2025,6,19]]},"reference":[{"key":"e_1_2_1_1_1","volume-title":"Syntax-Guided Synthesis. In Proceedings of the Conference on Formal Methods in Computer-Aided Design (FMCAD).","author":"Alur Rajeev","year":"2013","unstructured":"Rajeev Alur, Rastislav Bodik, Garvit Juniwal, Milo M. K. Martin, Mukund Raghothaman, Sanjit A. Seshia, Rishabh Singh, Armando Solar-Lezama, Emina Torlak, and Abhishek Udupa. 2013. Syntax-Guided Synthesis. In Proceedings of the Conference on Formal Methods in Computer-Aided Design (FMCAD)."},{"key":"e_1_2_1_2_1","volume-title":"Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE).","author":"B\u00f6hme Marcel","year":"2013","unstructured":"Marcel B\u00f6hme, Bruno C. d S. Oliveira, and Abhik Roychoudhury. 2013. Regression Tests to Expose Change Interaction Errors. In Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE)."},{"key":"e_1_2_1_3_1","volume-title":"Proceedings of the ACM SIGSAC Conference on Computer and Communications Security (CCS).","author":"B\u00f6hme Marcel","year":"2017","unstructured":"Marcel B\u00f6hme, Van-Thuan Pham, Manh-Dung Nguyen, and Abhik Roychoudhury. 2017. Directed Greybox Fuzzing. In Proceedings of the ACM SIGSAC Conference on Computer and Communications Security (CCS)."},{"key":"e_1_2_1_4_1","volume-title":"Proceedings of the ACM SIGSAC Conference on Computer and Communications Security (CCS).","author":"Chen Hongxu","year":"2018","unstructured":"Hongxu Chen, Yinxing Xue, Yuekang Li, Bihuan Chen, Xiaofei Xie, Xiuheng Wu, and Yang Liu. 2018. Hawkeye: Towards a Desired Directed Grey-box Fuzzer. In Proceedings of the ACM SIGSAC Conference on Computer and Communications Security (CCS)."},{"key":"e_1_2_1_5_1","volume-title":"Proceedings of the IEEE Symposium on Security and Privacy (SP).","author":"Chen Yaohui","year":"2020","unstructured":"Yaohui Chen, Peng Li, Jun Xu, Shengjian Guo, Rundong Zhou, Yulong Zhang, Tao Wei, and Long Lu. 2020. SAVIOR: Towards Bug-Driven Hybrid Testing. In Proceedings of the IEEE Symposium on Security and Privacy (SP)."},{"key":"e_1_2_1_6_1","volume-title":"Proceedings of the International Conference on Software Engineering (ICSE).","author":"Christakis Maria","year":"2016","unstructured":"Maria Christakis, Peter M\u00fcller, and Valentin W\u00fcstholz. 2016. Guiding Dynamic Symbolic Execution toward Unverified Program Executions. In Proceedings of the International Conference on Software Engineering (ICSE)."},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/3510003.3510197"},{"key":"e_1_2_1_8_1","unstructured":"Facebook. 2024. Infer Static Analyzer. https:\/\/fbinfer.com\/"},{"key":"e_1_2_1_9_1","volume-title":"Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE).","author":"Fraser Gordon","year":"2011","unstructured":"Gordon Fraser and Andrea Arcuri. 2011. EvoSuite: Automatic Test Suite Generation for Object-Oriented Software. In Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE)."},{"key":"e_1_2_1_10_1","volume-title":"Improving Search-Based Test Suite Generation with Dynamic Symbolic Execution. In International Symposium on Software Reliability Engineering (ISSRE).","author":"Galeotti Juan Pablo","year":"2013","unstructured":"Juan Pablo Galeotti, Gordon Fraser, and Andrea Arcuri. 2013. Improving Search-Based Test Suite Generation with Dynamic Symbolic Execution. In International Symposium on Software Reliability Engineering (ISSRE)."},{"key":"e_1_2_1_11_1","volume-title":"Proceedings of the ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI).","author":"Godefroid Patrice","year":"2005","unstructured":"Patrice Godefroid, Nils Klarlund, and Koushik Sen. 2005. DART: Directed Automated Random Testing. In Proceedings of the ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI)."},{"key":"e_1_2_1_12_1","volume-title":"Proceedings of the ACM on Programming Languages (PACMPL), 7, PLDI","author":"Guria Sankha Narayan","year":"2023","unstructured":"Sankha Narayan Guria, Jeffrey S. Foster, and David Van Horn. 2023. Absynthe: Abstract Interpretation-Guided Synthesis. Proceedings of the ACM on Programming Languages (PACMPL), 7, PLDI (2023)."},{"key":"e_1_2_1_13_1","doi-asserted-by":"publisher","DOI":"10.1109\/SP46214.2022.9833751"},{"key":"e_1_2_1_14_1","volume-title":"IEEE\/ACM International Workshop on Search-Based and Fuzz Testing (SBFT).","author":"Ivanov Dmitry","year":"2023","unstructured":"Dmitry Ivanov, Alexey Menshutin, Maxim Pelevin, Daniil Stepanov, Denis Fokin, Yury Kamenev, Egor Kulikov, Artemiy Kononov, Sergey Pospelov, Ivan Volkov, Alena Lisevych, Timur Yuldashev, Nikita Stroganov, and Andrey Tarbeev. 2023. UTBot at the SBFT 2023 Java Tool Competition. In IEEE\/ACM International Workshop on Search-Based and Fuzz Testing (SBFT)."},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","unstructured":"Sujin Jang Yeonhee Ryou Heewon Lee and Kihong Heo. 2025. UnitCon: Synthesizing Targeted Unit Tests for Java Runtime Exceptions. https:\/\/doi.org\/10.5281\/zenodo.15205112 10.5281\/zenodo.15205112","DOI":"10.5281\/zenodo.15205112"},{"key":"e_1_2_1_16_1","volume-title":"Proceedings of the International Conference on Software Engineering (ICSE).","author":"Jin Wei","year":"2012","unstructured":"Wei Jin and Alessandro Orso. 2012. BugRedux: Reproducing Field Failures for in-House Debugging. In Proceedings of the International Conference on Software Engineering (ICSE)."},{"key":"e_1_2_1_17_1","volume-title":"Proceedings of the International Symposium on Software Testing and Analysis (ISSTA).","author":"Just Ren\u00e9","unstructured":"Ren\u00e9 Just, Darioush Jalali, and Michael D. Ernst. 2014. Defects4J: A Database of Existing Faults to Enable Controlled Testing Studies for Java Programs. In Proceedings of the International Symposium on Software Testing and Analysis (ISSTA)."},{"key":"e_1_2_1_18_1","volume-title":"Proceedings of the USENIX Security Symposium (Security).","author":"Kim Tae Eun","year":"2023","unstructured":"Tae Eun Kim, Jaeseung Choi, Kihong Heo, and Sang Kil Cha. 2023. DAFL: Directed Grey-Box Fuzzing Guided by Data Dependency. In Proceedings of the USENIX Security Symposium (Security)."},{"key":"e_1_2_1_19_1","volume-title":"Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE).","author":"Kim Yunho","year":"2019","unstructured":"Yunho Kim, Shin Hong, and Moonzoo Kim. 2019. Target-Driven Compositional Concolic Testing with Function Summary Refinement for Effective Bug Detection. In Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE)."},{"key":"e_1_2_1_20_1","volume-title":"Proceedings of the ACM on Programming Languages (PACMPL), 6, OOPSLA1","author":"Le Quang Loc","year":"2022","unstructured":"Quang Loc Le, Azalea Raad, Jules Villard, Josh Berdine, Derek Dreyer, and Peter W. O\u2019Hearn. 2022. Finding Real Bugs in Big Programs with Incorrectness Logic. Proceedings of the ACM on Programming Languages (PACMPL), 6, OOPSLA1 (2022)."},{"key":"e_1_2_1_21_1","volume-title":"Proceedings of the International Conference on Software Engineering (ICSE).","author":"Lee Junhee","year":"2022","unstructured":"Junhee Lee, Seongjoon Hong, and Hakjoo Oh. 2022. NPEX: Repairing Java Null Pointer Exceptions without Tests. In Proceedings of the International Conference on Software Engineering (ICSE)."},{"key":"e_1_2_1_22_1","volume-title":"Proceedings of the IEEE\/ACM International Conference on Automated Software Engineering (ASE).","author":"Lee Myungho","year":"2024","unstructured":"Myungho Lee, Jiseong Bak, Seokhyeon Moon, Yoonchan Jhi, and Hakjoo Oh. 2024. Effective Unit Test Generation for Java Null Pointer Exceptions. In Proceedings of the IEEE\/ACM International Conference on Automated Software Engineering (ASE)."},{"key":"e_1_2_1_23_1","volume-title":"Proceedings of the International Conference on Software Engineering (ICSE).","author":"Lemieux Caroline","year":"2023","unstructured":"Caroline Lemieux, Jeevana Priya Inala, Shuvendu K. Lahiri, and Siddhartha Sen. 2023. CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language Models. In Proceedings of the International Conference on Software Engineering (ICSE)."},{"key":"e_1_2_1_24_1","volume-title":"Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE).","author":"Lin Yun","year":"2021","unstructured":"Yun Lin, You Sheng Ong, Jun Sun, Gordon Fraser, and Jin Song Dong. 2021. Graph-Based Seed Object Synthesis for Search-Based Unit Testing. In Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE)."},{"key":"e_1_2_1_25_1","volume-title":"Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE).","author":"Long Fan","unstructured":"Fan Long, Peter Amidon, and Martin C. Rinard. 2017. Automatic Inference of Code Transforms for Patch Generation. In Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE)."},{"key":"e_1_2_1_26_1","volume-title":"Proceedings of the International Conference on Static Analysis (SAS).","author":"Ma Kin-Keung","year":"2011","unstructured":"Kin-Keung Ma, Khoo Yit Phang, Jeffrey S. Foster, and Michael Hicks. 2011. Directed Symbolic Execution. In Proceedings of the International Conference on Static Analysis (SAS)."},{"key":"e_1_2_1_27_1","volume-title":"Proceedings of the IEEE\/ACM International Conference on Automated Software Engineering (ASE).","author":"Ma Lei","year":"2015","unstructured":"Lei Ma, Cyrille Artho, Cheng Zhang, Hiroyuki Sato, Johannes Gmeiner, and Rudolf Ramler. 2015. GRT: Program-analysis-guided Random Testing (T). In Proceedings of the IEEE\/ACM International Conference on Automated Software Engineering (ASE)."},{"key":"e_1_2_1_28_1","volume-title":"BEARS: An Extensible Java Bug Benchmark for Automatic Program Repair Studies. In IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER).","author":"Madeiral Fernanda","year":"2019","unstructured":"Fernanda Madeiral, Simon Urli, Marcelo de Almeida Maia, and Martin Monperrus. 2019. BEARS: An Extensible Java Bug Benchmark for Automatic Program Repair Studies. In IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)."},{"key":"e_1_2_1_29_1","volume-title":"Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE).","author":"Marinescu Paul Dan","year":"2013","unstructured":"Paul Dan Marinescu and Cristian Cadar. 2013. KATCH: High-Coverage Testing of Software Patches. In Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE)."},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/3643659.3648556"},{"key":"e_1_2_1_31_1","volume-title":"Proceedings of ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA).","author":"Pacheco Carlos","unstructured":"Carlos Pacheco and Michael D. Ernst. 2007. Randoop: Feedback-Directed Random Testing for Java. In Proceedings of ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA)."},{"key":"e_1_2_1_32_1","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2017.2663435"},{"key":"e_1_2_1_33_1","volume-title":"Proceedings of IEEE\/ACM International Conference on Automated Software Engineering (ASE).","author":"Perera Anjana","year":"2020","unstructured":"Anjana Perera, Aldeida Aleti, Marcel B\u00f6hme, and Burak Turhan. 2020. Defect Prediction Guided Search-Based Software Testing. In Proceedings of IEEE\/ACM International Conference on Automated Software Engineering (ASE)."},{"key":"e_1_2_1_34_1","volume-title":"Proceedings of the ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI).","author":"Person Suzette","year":"2011","unstructured":"Suzette Person, Guowei Yang, Neha Rungta, and Sarfraz Khurshid. 2011. Directed Incremental Symbolic Execution. In Proceedings of the ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI)."},{"key":"e_1_2_1_35_1","volume-title":"Proceedings of the International Conference on Software Engineering (ICSE).","author":"Pham Van-Thuan","year":"2015","unstructured":"Van-Thuan Pham, Wei Boon Ng, Konstantin Rubinov, and Abhik Roychoudhury. 2015. Hercules: Reproducing Crashes in Real-World Application Binaries. In Proceedings of the International Conference on Software Engineering (ICSE)."},{"key":"e_1_2_1_36_1","unstructured":"SBFT. 2023. Search-Based and Fuzz Testing. https:\/\/sbft23.github.io\/tools\/"},{"key":"e_1_2_1_37_1","doi-asserted-by":"publisher","DOI":"10.1145\/1081706.1081750"},{"key":"e_1_2_1_38_1","volume-title":"Proceedings of the International Conference on Static Analysis (SAS).","author":"So Sunbeom","year":"2017","unstructured":"Sunbeom So and Hakjoo Oh. 2017. Synthesizing Imperative Programs from Examples Guided by Static Analysis. In Proceedings of the International Conference on Static Analysis (SAS)."},{"key":"e_1_2_1_39_1","volume-title":"Symstra: A Framework for Generating Object-Oriented Unit Tests Using Symbolic Execution. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS).","author":"Xie Tao","year":"2005","unstructured":"Tao Xie, Darko Marinov, Wolfram Schulte, and David Notkin. 2005. Symstra: A Framework for Generating Object-Oriented Unit Tests Using Symbolic Execution. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS)."},{"key":"e_1_2_1_40_1","volume-title":"Proceedings of the International Conference on Software Engineering (ICSE).","author":"Xu Xuezheng","year":"2019","unstructured":"Xuezheng Xu, Yulei Sui, Hua Yan, and Jingling Xue. 2019. VFix: Value-Flow-Guided Precise Program Repair for Null Pointer Dereferences. In Proceedings of the International Conference on Software Engineering (ICSE)."},{"key":"e_1_2_1_41_1","volume-title":"Proceedings of the ACM on Programming Languages (PACMPL), 7, PLDI","author":"Yoon Yongho","year":"2023","unstructured":"Yongho Yoon, Woosuk Lee, and Kwangkeun Yi. 2023. Inductive Program Synthesis via Iterative Forward-Backward Abstract Interpretation. Proceedings of the ACM on Programming Languages (PACMPL), 7, PLDI (2023)."}],"container-title":["Proceedings of the ACM on Software Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3729362","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,19]],"date-time":"2025-06-19T15:21:51Z","timestamp":1750346511000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3729362"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,6,19]]},"references-count":41,"journal-issue":{"issue":"FSE","published-print":{"date-parts":[[2025,6,19]]}},"alternative-id":["10.1145\/3729362"],"URL":"https:\/\/doi.org\/10.1145\/3729362","relation":{},"ISSN":["2994-970X"],"issn-type":[{"value":"2994-970X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,6,19]]}}}