{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,8,23]],"date-time":"2026-08-23T11:21:11Z","timestamp":1787484071838,"version":"build-2736575974"},"reference-count":39,"publisher":"Association for Computing Machinery (ACM)","issue":"FSE","license":[{"start":{"date-parts":[[2025,6,19]],"date-time":"2025-06-19T00:00:00Z","timestamp":1750291200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/legalcode"}],"funder":[{"name":"Hong Kong Research Grants Council General Research Fund","award":["16205722"],"award-info":[{"award-number":["16205722"]}]},{"name":"FRQNT\\\/NSERC NOVA program","award":["2024-NOVA-346499"],"award-info":[{"award-number":["2024-NOVA-346499"]}]},{"DOI":"10.13039\/501100001809","name":"National Natural Science Foundation of China","doi-asserted-by":"crossref","award":["62372219"],"award-info":[{"award-number":["62372219"]}],"id":[{"id":"10.13039\/501100001809","id-type":"DOI","asserted-by":"crossref"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. ACM Softw. Eng."],"published-print":{"date-parts":[[2025,6,19]]},"abstract":"<jats:p>\n                    Mock assertions provide developers with a powerful means to validate program behaviors that are unobservable to test assertions. Despite their significance, they are rarely considered by automated test generation techniques. Effective generation of mock assertions requires understanding how they are used in practice. Although previous studies highlighted the importance of mock assertions, none provide insight into their usages. To bridge this gap, we conducted the first empirical study on mock assertions, examining their adoption, the characteristics of the verified method invocations, and their effectiveness in fault detection. Our analysis of 4,652 test cases from 11 popular J\n                    <jats:sc>ava<\/jats:sc>\n                    projects reveals that mock assertions are mostly applied to validating specific kinds of method calls, such as those interacting with external resources and those reflecting whether a certain code path was traversed in systems under test. Additionally, we find that mock assertions complement traditional test assertions by ensuring the desired side effects have been produced, validating control flow logic, and checking internal computation results. Our findings contribute to a better understanding of mock assertion usages and provide a foundation for future related research such as automated test generation that support mock assertions.\n                  <\/jats:p>","DOI":"10.1145\/3715741","type":"journal-article","created":{"date-parts":[[2025,6,19]],"date-time":"2025-06-19T11:16:02Z","timestamp":1750331762000},"page":"554-575","source":"Crossref","is-referenced-by-count":5,"title":["Understanding and Characterizing Mock Assertions in Unit Tests"],"prefix":"10.1145","volume":"2","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-3082-5957","authenticated-orcid":false,"given":"Hengcheng","family":"Zhu","sequence":"first","affiliation":[{"name":"Hong Kong University of Science and Technology, Hong Kong, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-5885-9297","authenticated-orcid":false,"given":"Valerio","family":"Terragni","sequence":"additional","affiliation":[{"name":"University of Auckland, Auckland, New Zealand"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-2428-4111","authenticated-orcid":false,"given":"Lili","family":"Wei","sequence":"additional","affiliation":[{"name":"McGill University, Montr\u00e9al, Canada"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3508-7172","authenticated-orcid":false,"given":"Shing-Chi","family":"Cheung","sequence":"additional","affiliation":[{"name":"Hong Kong University of Science and Technology, Hong Kong, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-6126-303X","authenticated-orcid":false,"given":"Jiarong","family":"Wu","sequence":"additional","affiliation":[{"name":"Hong Kong University of Science and Technology, Hong Kong, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8147-8126","authenticated-orcid":false,"given":"Yepang","family":"Liu","sequence":"additional","affiliation":[{"name":"Southern University of Science and Technology, Shenzhen, China"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2025,6,19]]},"reference":[{"key":"e_1_3_1_2_2","unstructured":"Agitar Technologies. [n. d.]. Agitar One Test Generator. Retrieved August 2024 from http:\/\/www.agitar.com\/solutions\/products\/agitarone.html"},{"key":"e_1_3_1_3_2","volume-title":"Practical Software Testing: Tool Automation and Human Factors, 14.03. - 19.03.2010 (Dagstuhl Seminar Proceedings, Vol. 10111)","author":"Alshahwan Nadia","year":"2010","unstructured":"Nadia Alshahwan, Yue Jia, Kiran Lakhotia, Gordon Fraser, David Shuler, and Paolo Tonella. 2010. AUTOMOCK: Automated Synthesis of a Mock Environment for Test Case Generation. In Practical Software Testing: Tool Automation and Human Factors, 14.03. - 19.03.2010 (Dagstuhl Seminar Proceedings, Vol. 10111). Schloss Dagstuhl - Leibniz-Zentrum f\u00fcr Informatik, Germany. http:\/\/drops.dagstuhl.de\/opus\/volltexte\/2010\/2618\/"},{"key":"e_1_3_1_4_2","doi-asserted-by":"publisher","DOI":"10.1145\/2642937.2642986"},{"key":"e_1_3_1_5_2","doi-asserted-by":"publisher","DOI":"10.1145\/2786805.2786828"},{"key":"e_1_3_1_6_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICST.2017.19"},{"key":"e_1_3_1_7_2","doi-asserted-by":"publisher","DOI":"10.1109\/APSEC48747.2019.00033"},{"key":"e_1_3_1_8_2","unstructured":"Henry Coles. [n. d.]. PIT Mutation Testing. Retrieved August 2024 from https:\/\/pitest.org"},{"key":"e_1_3_1_9_2","unstructured":"Mockito contributors. [n. d.]. Mockito framework site. Retrieved August 2024 from https:\/\/mockito.org"},{"key":"e_1_3_1_10_2","unstructured":"EasyMock Contributors. [n. d.]. EasyMock. Retrieved August 2024 from https:\/\/easymock.org"},{"key":"e_1_3_1_11_2","doi-asserted-by":"publisher","DOI":"10.1145\/3510003.3510175"},{"key":"e_1_3_1_12_2","doi-asserted-by":"publisher","DOI":"10.1145\/3324884.3418927"},{"key":"e_1_3_1_13_2","doi-asserted-by":"publisher","DOI":"10.1109\/QSIC.2011.19"},{"key":"e_1_3_1_14_2","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2010.62"},{"key":"e_1_3_1_15_2","unstructured":"jMock Contributors. [n. d.]. jMock. Retrieved August 2024 from https:\/\/jmock.org"},{"issue":"2015","key":"e_1_3_1_16_2","doi-asserted-by":"crossref","first-page":"473","DOI":"10.1177\/1524839915580941","article-title":"Qualitative inquiry and research design: Choosing among five approaches","volume":"4","author":"Lewis Sarah","year":"2015","unstructured":"Sarah Lewis. 2015. Qualitative inquiry and research design: Choosing among five approaches. Health promotion practice 16, 4 (2015), 473\u2013475.","journal-title":"Health promotion practice 16"},{"key":"e_1_3_1_17_2","unstructured":"Mengzhen Li and Mattia Fazzini. 2024. Automatically Removing Unnecessary Stubbings from Test Suites. arXiv:2407.20924 [cs.SE] https:\/\/arxiv.org\/abs\/2407.20924"},{"key":"e_1_3_1_18_2","first-page":"287","volume-title":"Endo-Testing: Unit Testing with Mock Objects","author":"Mackinnon Tim","year":"2001","unstructured":"Tim Mackinnon, Steve Freeman, and Philip Craig. 2001. Endo-Testing: Unit Testing with Mock Objects. Addison-Wesley Longman Publishing Co., Inc., USA, 287\u2013301."},{"key":"e_1_3_1_19_2","doi-asserted-by":"publisher","DOI":"10.1109\/IWAST.2009.5069054"},{"key":"e_1_3_1_20_2","doi-asserted-by":"publisher","DOI":"10.1109\/QSIC.2014.19"},{"key":"e_1_3_1_21_2","doi-asserted-by":"publisher","unstructured":"Carlos Pacheco and Michael D. Ernst. 2007. Randoop: feedback-directed random testing for Java. In Companion to the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems Languages and Applications OOPSLA 2007 October 21-25 2007 Montreal Quebec Canada Richard P. Gabriel David F. Bacon Cristina Videira Lopes and Guy L. Steele Jr. (Eds.). ACM 815\u2013816. doi:10.1145\/1297846.1297902","DOI":"10.1145\/1297846.1297902"},{"key":"e_1_3_1_22_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-1-4612-4380-9_2"},{"key":"e_1_3_1_23_2","unstructured":"Anthony Peruma Mohamed Wiem Mkaouer Khalid Almalki Christian D. Newman Ali Ouni and Fabio Palomba. 2024. Test Smells. Retrieved August 2024 from https:\/\/testsmells.org\/pages\/testsmells.html"},{"key":"e_1_3_1_24_2","unstructured":"Power Contributors. [n. d.]. PowerMock. Retrieved August 2024 from https:\/\/powermock.github.io"},{"key":"e_1_3_1_25_2","doi-asserted-by":"publisher","unstructured":"David Saff Shay Artzi Jeff H. Perkins and Michael D. Ernst. 2005. Automatic test factoring for java. In 20th IEEE\/ACM International Conference on Automated Software Engineering (ASE 2005). ACM 114\u2013123. doi:10.1145\/1101908.1101927","DOI":"10.1145\/1101908.1101927"},{"key":"e_1_3_1_26_2","doi-asserted-by":"publisher","DOI":"10.1145\/996821.996838"},{"key":"e_1_3_1_27_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-031-48796-5_4"},{"key":"e_1_3_1_28_2","doi-asserted-by":"publisher","DOI":"10.1109\/ASE.2015.86"},{"key":"e_1_3_1_29_2","doi-asserted-by":"publisher","DOI":"10.1109\/MSR.2017.61"},{"key":"e_1_3_1_30_2","doi-asserted-by":"publisher","DOI":"10.1007\/s10664-018-9663-0"},{"key":"e_1_3_1_31_2","doi-asserted-by":"publisher","DOI":"10.1145\/1858996.1859053"},{"key":"e_1_3_1_32_2","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2208.01321"},{"key":"e_1_3_1_33_2","unstructured":"Michele Tufano Dawn Drain Alexey Svyatkovskiy Shao Kun Deng and Neel Sundaresan. 2020. Unit Test Case Generation with Transformers and Focal Context. arXiv:2009.05617 [cs.SE]"},{"key":"e_1_3_1_34_2","doi-asserted-by":"publisher","DOI":"10.1007\/S10515-024-00449-6"},{"key":"e_1_3_1_35_2","doi-asserted-by":"publisher","DOI":"10.1145\/3468264.3468590"},{"key":"e_1_3_1_36_2","doi-asserted-by":"publisher","DOI":"10.1007\/S10664-023-10410-Y"},{"key":"e_1_3_1_37_2","doi-asserted-by":"publisher","DOI":"10.1109\/MS.2011.158"},{"key":"e_1_3_1_38_2","doi-asserted-by":"publisher","unstructured":"Hengcheng Zhu Valerio Terragni Lili Wei Sheng-Chi Chung Jiarong Wu and Yepang Liu. 2025. Experimental Data: Understanding and Characterizing Mock Assertions in Unit Tests. doi:10.5281\/zenodo.14695510","DOI":"10.5281\/zenodo.14695510"},{"key":"e_1_3_1_39_2","doi-asserted-by":"publisher","DOI":"10.1145\/3617171"},{"key":"e_1_3_1_40_2","doi-asserted-by":"publisher","DOI":"10.1145\/3324884.3416539"}],"container-title":["Proceedings of the ACM on Software Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3715741","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,8,23]],"date-time":"2026-08-23T11:06:06Z","timestamp":1787483166000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3715741"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,6,19]]},"references-count":39,"journal-issue":{"issue":"FSE","published-print":{"date-parts":[[2025,6,19]]}},"alternative-id":["10.1145\/3715741"],"URL":"https:\/\/doi.org\/10.1145\/3715741","relation":{},"ISSN":["2994-970X"],"issn-type":[{"value":"2994-970X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,6,19]]}}}