{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T19:06:42Z","timestamp":1782846402787,"version":"3.54.5"},"reference-count":80,"publisher":"Association for Computing Machinery (ACM)","issue":"FSE","license":[{"start":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T00:00:00Z","timestamp":1782777600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/legalcode"}],"funder":[{"DOI":"10.13039\/501100012166","name":"National Key R&D Program of China","doi-asserted-by":"crossref","award":["2024YFB4506400"],"award-info":[{"award-number":["2024YFB4506400"]}],"id":[{"id":"10.13039\/501100012166","id-type":"DOI","asserted-by":"crossref"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. ACM Softw. Eng."],"published-print":{"date-parts":[[2026,6,30]]},"abstract":"<jats:p>The quality of foundational libraries is critical to the reliability of modern software ecosystems. However, developers often do not have enough time to test for various reasons. Recent studies show that 68% of deep learning libraries lack unit tests and their absence negatively impacts libraries' health. While automated test generation techniques have been proposed, they frequently produce invalid inputs or semantically inconsistent assertions due to missing domain knowledge. An alternative is cross-library test reuse, as many libraries in scientific computing and machine learning expose functionally similar APIs. Nevertheless, effective test reuse requires careful semantic alignment rather than naive \"copy-and-paste\", as subtle API mismatches and incomplete domain knowledge often yield invalid tests.  \nTo address these challenges, we present KATRER, a knowledge-aware framework for automated test reuse. KATRER models each library as a heterogeneous graph that integrates semantic and structural information and introduces a Test Fingerprint representation for tests, which captures code, docstrings, usage examples, pre-\/post-conditions, and invoked APIs. This enables accurate API alignment and prevents invalid calls. KATRER further employs a collaborative LLM pipeline that verifies semantic compatibility, performs stepwise API substitution, and validates test correctness.  \nWe evaluated KATRER among five libraries in two domains, generating 13,191 sub-tests from 1,484 source tests, with 7,257 retained after filtering. KATRER improves both PassRate@1 and TFC@1 by 14.46%, while uncovering 22 previously unknown defects in CuPy and cuML, 8 of which have already been fixed. These results demonstrate that knowledge-aware test reuse substantially reduces manual adaptation effort and enhances the robustness of widely used libraries.<\/jats:p>","DOI":"10.1145\/3808146","type":"journal-article","created":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T17:06:14Z","timestamp":1782839174000},"page":"3138-3161","source":"Crossref","is-referenced-by-count":0,"title":["Automated Knowledge-Aware Test Reuse"],"prefix":"10.1145","volume":"3","author":[{"ORCID":"https:\/\/orcid.org\/0009-0001-2727-7806","authenticated-orcid":false,"given":"Ziyuan","family":"Zhang","sequence":"first","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0000-2554-2381","authenticated-orcid":false,"given":"Yi","family":"Gao","sequence":"additional","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-0093-3292","authenticated-orcid":false,"given":"Xing","family":"Hu","sequence":"additional","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-6302-3256","authenticated-orcid":false,"given":"Xin","family":"Xia","sequence":"additional","affiliation":[{"name":"Zhejiang University, Hangzhou, China"},{"name":"Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2615-9792","authenticated-orcid":false,"given":"Shanping","family":"Li","sequence":"additional","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2026,6,30]]},"reference":[{"key":"e_1_2_1_1_1","doi-asserted-by":"publisher","unstructured":"DeepSeek AI. 2025. DeepSeek-R1. https:\/\/huggingface.co\/deepseek-ai\/DeepSeek-R1. doi:10.48550\/arXiv.2501.12948 Accessed: 2025-9-2. 10.48550\/arXiv.2501.12948","DOI":"10.48550\/arXiv.2501.12948"},{"key":"e_1_2_1_2_1","unstructured":"Niclas Aunin. 2025. A comprehensive list of Large Language Model knowledge cut off dates. https:\/\/www.allmo.ai\/ articles\/list-of-large-language-model-cut-off-dates. Accessed: 2026-2-22."},{"key":"e_1_2_1_3_1","unstructured":"Ned Batchelder. 2025. Coverage.py. https:\/\/coverage.readthedocs.io\/en\/7.12.0. Accessed: 2026-2-22."},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE.2019.00016"},{"key":"e_1_2_1_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/3377812.3382140"},{"key":"e_1_2_1_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3639085"},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","unstructured":"Mark Chen Jerry Tworek Heewoo Jun Qiming Yuan Henrique Pond\u00e9 de Oliveira Pinto Jared Kaplan Harri Edwards Yuri Burda Nicholas Joseph Greg Brockman Alex Ray Raul Puri Gretchen Krueger Michael Petrov Heidy Khlaaf Girish Sastry Pamela Mishkin Brooke Chan Scott Gray Nick Ryder Mikhail Pavlov Alethea Power Lukasz Kaiser Mohammad Bavarian Clemens Winter Philippe Tillet Felipe Petroski Such Dave Cummings Matthias Plappert Fotios Chantzis Elizabeth Barnes Ariel Herbert-Voss William Hebgen Guss Alex Nichol Alex Paino Nikolas Tezak Jie Tang Igor Babuschkin Suchir Balaji Shantanu Jain William Saunders Christopher Hesse Andrew N. Carr Jan Leike Joshua Achiam Vedant Misra Evan Morikawa Alec Radford Matthew Knight Miles Brundage Mira Murati Katie Mayer Peter Welinder Bob McGrew Dario Amodei Sam McCandlish Ilya Sutskever and Wojciech Zaremba. 2021. Evaluating Large Language Models Trained on Code. CoRR abs\/2107.03374 (2021) 1-35. arXiv:2107.03374 doi:10.48550\/arXiv.2107.03374 10.48550\/arXiv.2107.03374","DOI":"10.48550\/arXiv.2107.03374"},{"key":"e_1_2_1_8_1","doi-asserted-by":"publisher","DOI":"10.1145\/3663529.3663801"},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.5167\/uzh-238316"},{"key":"e_1_2_1_10_1","unstructured":"Alibaba Cloud. 2025. DeepSeek Large Language Models. https:\/\/help.aliyun.com\/zh\/model-studio\/deepseek-api. Accessed: 2026-2-22."},{"key":"e_1_2_1_11_1","unstructured":"The SciPy community. 2025. SciPy 1.16.0 Release Notes. https:\/\/docs.scipy.org\/doc\/scipy\/release\/1.16.0-notes.html. Accessed: 2026-2-22."},{"key":"e_1_2_1_12_1","unstructured":"Pynguin Contributors. 2023. Issues \u2022 se2p\/pynguin. https:\/\/github.com\/se2p\/pynguin\/issues\/. Accessed: 2026-2-22."},{"key":"e_1_2_1_13_1","unstructured":"Wikipedia contributors. 2007. Cosine similarity. https:\/\/en.wikipedia.org\/wiki\/Cosine_similarity. Accessed: 2025-9-2."},{"key":"e_1_2_1_14_1","unstructured":"Guido van Rossum <guido at python.org> David Goodger <goodger at python.org>. 2026. PEP 257 -Docstring Conventions. https:\/\/peps.python.org\/pep-0257. Accessed: 2026-2-22."},{"key":"e_1_2_1_15_1","unstructured":"Davidoxn. 2025. Data Availability. https:\/\/github.com\/Davidoxn\/KATRER. Accessed: 2026-2-22."},{"key":"e_1_2_1_16_1","unstructured":"DeepSeek. 2025. DeepSeek-R1 Release. https:\/\/api-docs.deepseek.com\/news\/news250120. Accessed: 2026-2-22."},{"key":"e_1_2_1_17_1","volume-title":"Differential Testing of Cross Deep Learning Framework APIs: Revealing Inconsistencies and Vulnerabilities. In 32nd USENIX Security Symposium, USENIX Security 2023","author":"Deng Zizhuang","year":"2023","unstructured":"Zizhuang Deng, Guozhu Meng, Kai Chen, Tong Liu, Lu Xiang, and Chunyang Chen. 2023. Differential Testing of Cross Deep Learning Framework APIs: Revealing Inconsistencies and Vulnerabilities. In 32nd USENIX Security Symposium, USENIX Security 2023, Anaheim, CA, USA, August 9-11, 2023, Joseph A. Calandrino and Carmela Troncoso (Eds.). USENIX Association, Anaheim, CA, 7393-7410. https:\/\/www.usenix.org\/conference\/usenixsecurity23\/presentation\/dengzizhuang"},{"key":"e_1_2_1_18_1","unstructured":"CuPy developers. 2025. Overview. https:\/\/docs.cupy.dev\/en\/v13.5.1\/overview.html. Accessed: 2025-9-2."},{"key":"e_1_2_1_19_1","unstructured":"NumPy Developers. 2025. numpy 2.3.0. https:\/\/pypi.org\/project\/numpy\/2.3.0\/. Accessed: 2026-2-22."},{"key":"e_1_2_1_20_1","unstructured":"NumPy Developers. 2025. NumPy documentation. https:\/\/numpy.org\/doc\/2.3\/index.html. Accessed: 2025-9-2."},{"key":"e_1_2_1_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/3672459"},{"key":"e_1_2_1_22_1","unstructured":"Alex Feinman. 2010. How do you keep your unit tests working when refactoring? https:\/\/softwareengineering. stackexchange.com\/questions\/5898\/how-do-you-keep-your-unit-tests-working-when-refactoring. Accessed: 2025-9- 2."},{"key":"e_1_2_1_23_1","unstructured":"Python Software Foundation. 2001. unittest -Unit testing framework. https:\/\/docs.python.org\/3.14\/library\/unittest. html. Accessed: 2025-9-2."},{"key":"e_1_2_1_24_1","unstructured":"Python Software Foundation. 2026. 6. Modules. https:\/\/docs.python.org\/3\/tutorial\/modules.html. Accessed: 2026-2-22."},{"key":"e_1_2_1_25_1","unstructured":"Python Software Foundation. 2026. 7. Simple statements. https:\/\/docs.python.org\/3\/reference\/simple_stmts.html. Accessed: 2026-2-22."},{"key":"e_1_2_1_26_1","unstructured":"Martin Fowler. 2007. Mocks Aren't Stubs. https:\/\/martinfowler.com\/articles\/mocksArentStubs.html. Accessed: 2025-9-2."},{"key":"e_1_2_1_27_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3639124"},{"key":"e_1_2_1_28_1","doi-asserted-by":"publisher","DOI":"10.1145\/3715750"},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2408.03095"},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE.2019.00061"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/3728984"},{"key":"e_1_2_1_32_1","unstructured":"Alyssa Coghlan <ncoghlan at gmail.com> Guido van Rossum <guido at python.org> Barry Warsaw <barry at python.org>. 2025. PEP 8 -Style Guide for Python Code. https:\/\/peps.python.org\/pep-0008\/. Accessed: 2026-2-22."},{"key":"e_1_2_1_33_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2504.04372"},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.48550\/arXiv.2308.00352"},{"key":"e_1_2_1_35_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2504.13272"},{"key":"e_1_2_1_36_1","doi-asserted-by":"publisher","DOI":"10.1109\/MSR59073.2023.00075"},{"key":"e_1_2_1_37_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2503.14713"},{"key":"e_1_2_1_38_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSME52107.2021.00011"},{"key":"e_1_2_1_39_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE43902.2021.00019"},{"key":"e_1_2_1_40_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE-SEIP.2019.00015"},{"key":"e_1_2_1_41_1","unstructured":"Holger Krekel Bruno Oliveira Ronny Pfannschmidt Floris Bruynooghe Brianna Laugher and Freya Bruhin. 2004. pytest. https:\/\/github.com\/pytest-dev\/pytest. Accessed: 2025-9-2."},{"key":"e_1_2_1_42_1","doi-asserted-by":"publisher","DOI":"10.48550\/arXiv.2005.11401"},{"key":"e_1_2_1_43_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2511.14224"},{"key":"e_1_2_1_44_1","doi-asserted-by":"publisher","DOI":"10.1145\/3691620.3695541"},{"key":"e_1_2_1_45_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2406.07944"},{"key":"e_1_2_1_46_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE55347.2025.00132"},{"key":"e_1_2_1_47_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2403.15852"},{"key":"e_1_2_1_48_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE.2019.00015"},{"key":"e_1_2_1_49_1","doi-asserted-by":"publisher","DOI":"10.1007\/S11390-019-1956-2"},{"key":"e_1_2_1_50_1","doi-asserted-by":"publisher","DOI":"10.1145\/3510454.3516829"},{"key":"e_1_2_1_51_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-59762-7_2"},{"key":"e_1_2_1_52_1","doi-asserted-by":"publisher","DOI":"10.1007\/S10664-022-10248-W"},{"key":"e_1_2_1_53_1","unstructured":"Kenichi Maehashi. 2025. Released CuPy v13.5.0. https:\/\/groups.google.com\/g\/cupy\/c\/1mqkC3vZjtI. Accessed: 2026-2-22."},{"key":"e_1_2_1_54_1","doi-asserted-by":"publisher","DOI":"10.1145\/3460319.3464827"},{"key":"e_1_2_1_55_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2307.00404"},{"key":"e_1_2_1_56_1","doi-asserted-by":"publisher","DOI":"10.1145\/2642937.2643010"},{"key":"e_1_2_1_57_1","unstructured":"Stack Overflow. 2008. Newest Questions. https:\/\/stackoverflow.com\/questions. Accessed: 2025-9-2."},{"key":"e_1_2_1_58_1","doi-asserted-by":"publisher","DOI":"10.1145\/3293882.3330575"},{"key":"e_1_2_1_59_1","unstructured":"scikit-learn developers. 2021. \"Functions to validate input and parameters within scikit-learn estimators.\". https: \/\/raw.githubusercontent.com\/scikit-learn\/scikit-learn\/main\/sklearn\/utils\/validation.py. Accessed: 2025-9-2."},{"key":"e_1_2_1_60_1","unstructured":"scikit-learn developers. 2025. Scikit-learn 1.7.0. https:\/\/github.com\/scikit-learn\/scikit-learn\/releases\/tag\/1.7.0. Accessed: 2026-2-22."},{"key":"e_1_2_1_61_1","unstructured":"scikit-learn developers. 2025. scikit-learn: machine learning in Python version 1.7 documentation. https:\/\/scikitlearn.org\/1.7\/index.html. Accessed: 2025-9-2."},{"key":"e_1_2_1_62_1","unstructured":"scikit-learn developers. 2025. sklearn.base.BaseEstimator: base class for all estimators in scikit-learn. https:\/\/scikitlearn.org\/1.7\/modules\/generated\/sklearn.base.BaseEstimator.html. Accessed: 2025-9-2."},{"key":"e_1_2_1_63_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2409.12682"},{"key":"e_1_2_1_64_1","unstructured":"RAPIDS Development Team. 2025. Welcome to cuML's documentation! https:\/\/docs.rapids.ai\/api\/cuml\/stable\/. Accessed: 2025-9-2."},{"key":"e_1_2_1_65_1","volume-title":"RAPIDS: Libraries for End to End GPU Data Science. https:\/\/github.com\/rapidsai\/ cuml\/releases\/tag\/v26.02.00. Accessed: 2026-2-22.","author":"Development Team RAPIDS","year":"2026","unstructured":"RAPIDS Development Team. 2026. RAPIDS: Libraries for End to End GPU Data Science. https:\/\/github.com\/rapidsai\/ cuml\/releases\/tag\/v26.02.00. Accessed: 2026-2-22."},{"key":"e_1_2_1_66_1","doi-asserted-by":"publisher","DOI":"10.1109\/WCRE.2013.6671294"},{"key":"e_1_2_1_67_1","unstructured":"The SciPy community. 2025. SciPy documentation: SciPy v1.16.0 manual. https:\/\/docs.scipy.org\/doc\/scipy-1.16.0\/. Accessed: 2025-9-2."},{"key":"e_1_2_1_68_1","volume-title":"Refactoring: Levels and Lessons Learnt. https:\/\/computellect.com\/2011\/10\/29\/refactoring\/. Accessed: 2025-9-2.","author":"Todkar Praful","year":"2011","unstructured":"Praful Todkar. 2011. Refactoring: Levels and Lessons Learnt. https:\/\/computellect.com\/2011\/10\/29\/refactoring\/. Accessed: 2025-9-2."},{"key":"e_1_2_1_69_1","volume-title":"Top 8 Challenges In Automation Testing","author":"Tummala Madhusudhana","year":"2023","unstructured":"Madhusudhana Tummala. 2023. Top 8 Challenges In Automation Testing in 2023. https:\/\/www.getsoftwareservice. com\/top-8-challenges-in-automation-testing-in-2023. Accessed: 2025-9-2."},{"key":"e_1_2_1_70_1","doi-asserted-by":"publisher","DOI":"10.1145\/3638245"},{"key":"e_1_2_1_71_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE43902.2021.00138"},{"key":"e_1_2_1_72_1","doi-asserted-by":"publisher","DOI":"10.18653\/V1\/2025.FINDINGS-NAACL.197"},{"key":"e_1_2_1_73_1","doi-asserted-by":"publisher","DOI":"10.1145\/3368089.3409761"},{"key":"e_1_2_1_74_1","doi-asserted-by":"publisher","DOI":"10.48550\/arXiv.2201.11903"},{"key":"e_1_2_1_75_1","unstructured":"GAT Staff Writers. 2023. 9 Key challenges of software testing to keep in mind. https:\/\/www.globalapptesting.com\/ blog\/challenges-of-software-testing. Accessed: 2025-9-2."},{"key":"e_1_2_1_76_1","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2024.3414672"},{"key":"e_1_2_1_77_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV"},{"key":"e_1_2_1_78_1","doi-asserted-by":"publisher","DOI":"10.1145\/3368089.3409708"},{"key":"e_1_2_1_79_1","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2024.3366613"},{"key":"e_1_2_1_80_1","doi-asserted-by":"publisher","DOI":"10.1145\/3551349.3556902"}],"container-title":["Proceedings of the ACM on Software Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3808146","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T18:16:00Z","timestamp":1782843360000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3808146"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,6,30]]},"references-count":80,"journal-issue":{"issue":"FSE","published-print":{"date-parts":[[2026,6,30]]}},"alternative-id":["10.1145\/3808146"],"URL":"https:\/\/doi.org\/10.1145\/3808146","relation":{},"ISSN":["2994-970X"],"issn-type":[{"value":"2994-970X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,6,30]]}}}