{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,5,24]],"date-time":"2026-05-24T14:03:42Z","timestamp":1779631422732,"version":"3.53.1"},"reference-count":51,"publisher":"SAGE Publications","issue":"3","license":[{"start":{"date-parts":[[2026,3,18]],"date-time":"2026-03-18T00:00:00Z","timestamp":1773792000000},"content-version":"tdm","delay-in-days":0,"URL":"https:\/\/journals.sagepub.com\/page\/policies\/text-and-data-mining-license"}],"content-domain":{"domain":["journals.sagepub.com"],"crossmark-restriction":true},"short-container-title":["Big Data"],"published-print":{"date-parts":[[2026,6,1]]},"abstract":"<jats:p>Automated program repair (APR) has been studied extensively in recent years. Existing approaches mainly generate single-position patches that fail to address multilocation faults effectively. While existing multistep repair approaches can iteratively generate patches for each fault position sequentially, their data augmentation methodologies lack rationality and deviate from real-world scenarios. Furthermore, they overlook the interdependencies between faulty statements, leading to patches learned from erroneous contextual patterns. In this article, we propose MuTemAPR, an APR approach that iteratively generates multilocation patches. MuTemAPR incorporates templates with neural machine translation. Specifically, our method introduces three key innovations. First, we design a template-based data augmentation framework that transforms single-line faulty code into multilocation faulty code through 35 mutation templates. It simulates a real-world environment by establishing variable-type mapping tables for more accurate repair augmentation. Second, we propose a reinforced faulty context training method that employs progressive annotation to incrementally learn repair processes from top to bottom in multifault code. Third, we implement a semantic constraint mechanism during training that enforces syntactic and semantic rules through differential analysis between templates, input code, and generated patches. We evaluate MuTemAPR on the widely used Defects4j benchmark. Experimental results demonstrate that our approach can effectively repair multilocation faults, successfully fixing five additional bugs compared with state-of-the-art methods on Defects4j v1.2 and v2.0.<\/jats:p>","DOI":"10.1177\/2167647x261428016","type":"journal-article","created":{"date-parts":[[2026,3,18]],"date-time":"2026-03-18T15:03:38Z","timestamp":1773846218000},"page":"206-218","update-policy":"https:\/\/doi.org\/10.1177\/sage-journals-update-policy","source":"Crossref","is-referenced-by-count":0,"title":["MuTemAPR: Enhance Multilocation Patches with Template-Based Neural Program Repair"],"prefix":"10.1177","volume":"14","author":[{"given":"Tao","family":"Zhang","sequence":"first","affiliation":[{"name":"Shanxi Police College, Taiyuan, Shanxi, China."}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0002-3957-9171","authenticated-orcid":false,"given":"Yu","family":"Zhu","sequence":"additional","affiliation":[{"name":"Shanxi Police College, Taiyuan, Shanxi, China."}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"179","published-online":{"date-parts":[[2026,3,18]]},"reference":[{"key":"e_1_3_2_2_1","doi-asserted-by":"publisher","unstructured":"1.Wright CS Zia TA. A quantitative analysis into the economics of correcting software bugs. In: Computational Intelligence in Security for Information Systems: 4th International Conference CISIS 2011 Held at IWANN 2011 Torremolinos-Malaga Spain June 8\u201310 2011. Springer; 2011; pp. 198\u2013205; doi: 10.1145\/3193977.3193981","DOI":"10.1145\/3193977.3193981"},{"key":"e_1_3_2_3_1","doi-asserted-by":"publisher","unstructured":"2.Liu X Zhong H. Mining stackoverflow for program repair. In: 2018 IEEE 25th international conference on software analysis evolution and reengineering (SANER). IEEE; 2018; pp. 118\u201329; doi: 10.1109\/SANER.2018.8330202","DOI":"10.1109\/SANER.2018.8330202"},{"key":"e_1_3_2_4_1","doi-asserted-by":"publisher","unstructured":"3.Saha RK Lyu Y Yoshida H et al. Elixir: Effective object-orientedprogram repair. In: 2017 32nd IEEE\/ACM International Conference on Auto-mated Software Engineering (ASE). IEEE; 2017; pp. 648\u201359; doi: 10.5555\/3155562.3155643","DOI":"10.5555\/3155562.3155643"},{"key":"e_1_3_2_5_1","doi-asserted-by":"publisher","unstructured":"4.Saha S et al. Harnessing evolution for multi-hunk program repair. In: 2019 IEEE\/ACM 41st International Conference on Software Engineering (ICSE). IEEE; 2019; pp. 13\u201324; doi: 10.1109\/ICSE.2019.00020","DOI":"10.1109\/ICSE.2019.00020"},{"key":"e_1_3_2_6_1","doi-asserted-by":"publisher","DOI":"10.1007\/s10664-019-09780-z"},{"key":"e_1_3_2_7_1","doi-asserted-by":"publisher","unstructured":"6.Wen M Chen J Wu R et al. Context-aware patch generation for better automated program repair. In: Proceedings of the 40th international conference on software engineering. ACM; 2018; pp. 1\u201311; doi: 10.1145\/3180155.3180233","DOI":"10.1145\/3180155.3180233"},{"key":"e_1_3_2_8_1","doi-asserted-by":"publisher","unstructured":"7.Ghanbari A Benton S Zhang L. Practical program repair via bytecode mu tation. In: Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis. ACM; 2019; pp. 19\u201330; doi: 10.1145\/3293882.3330559","DOI":"10.1145\/3293882.3330559"},{"key":"e_1_3_2_9_1","doi-asserted-by":"publisher","unstructured":"8.Hua J Zhang M Wang K et al. Towards practical program repair with on-demand candidate generation. In: Proceedings of the 40th international conference on software engineering. ACM; 2018; pp. 12\u201323; doi: 10.1145\/3180155.3180245","DOI":"10.1145\/3180155.3180245"},{"key":"e_1_3_2_10_1","doi-asserted-by":"publisher","unstructured":"9.Tan SH Dong Z Gao X et al. Repairing crashes in android apps. In: Proceedings of the 40th International Conference on Software Engineering. ACM; 2018; pp. 187\u201398; doi: 10.1145\/3180155.3180243","DOI":"10.1145\/3180155.3180243"},{"key":"e_1_3_2_11_1","doi-asserted-by":"publisher","unstructured":"10.Long F Rinard M. Automatic patch generation by learning correct code. In Proceedings of the 43rd annual ACM SIGPLAN-SIGACT symposium on principles of programming languages. ACM; 2016; pp. 298\u2013312; doi: 10.1145\/2837614.2837617","DOI":"10.1145\/2837614.2837617"},{"key":"e_1_3_2_12_1","doi-asserted-by":"publisher","unstructured":"11.Liu K Koyuncu A Bissyand\u2019e TF et al. You cannot fix what you cannot find! an investigation of fault localization bias in benchmarking automated program repair systems. In: 2019 12th IEEE conference on software testing validation and verification (ICST). IEEE; 2019; pp. 102\u2013113; doi: 10.1109\/ICST.2019.00020","DOI":"10.1109\/ICST.2019.00020"},{"key":"e_1_3_2_13_1","doi-asserted-by":"publisher","unstructured":"12.Durieux T Cornu B Seinturier L et al. Dynamic patch generation for null pointer exceptions using metaprogramming. In: 2017 IEEE 24th Interna tional conference on software analysis evolution and reengineering (SANER). IEEE; 2017; pp. 349\u201358; doi: 10.1109\/SANER.2017.7884635","DOI":"10.1109\/SANER.2017.7884635"},{"key":"e_1_3_2_14_1","doi-asserted-by":"publisher","unstructured":"13.Falleri JR Morandat F Blanc X et al. Fine-grained and accurate source code differencing. In: Proceedings of the 29th ACM\/IEEE International Conference on Automated Software Engineering ASE \u201814. Association for Computing Machinery; NewYork NY; 2014; pp. 313\u2013324; doi: 10.1145\/2642937.2642982","DOI":"10.1145\/2642937.2642982"},{"key":"e_1_3_2_15_1","doi-asserted-by":"publisher","unstructured":"14.Liu K Koyuncu A Kim D et al. TBar: Revisiting template-based automated program repair. In: Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis. ISSTA 2019. Association for Computing Machinery; NewYork NY; 2019; pp. 31\u201342; doi: 10.1145\/3293882.3330577","DOI":"10.1145\/3293882.3330577"},{"key":"e_1_3_2_16_1","doi-asserted-by":"publisher","unstructured":"15.Jiang J Xiong Y Zhang H et al. Shaping program repair space with existing patches and similar code. In: Proceedings of the 27th ACM SIGSOFT international symposium on software testing and analysis. ACM; 2018; pp. 298\u2013309; doi: 10.1145\/3213846.3213871","DOI":"10.1145\/3213846.3213871"},{"key":"e_1_3_2_17_1","doi-asserted-by":"publisher","unstructured":"16.Liu K Koyuncu A Kim D et al. Avatar: Fixing semantic bugs with fix patterns of static analysis violations. In: 2019 IEEE 26th International Conference on Software Analysis Evolution and Reengineering (SANER). IEEE; 2019; pp. 1\u201312; doi: 10.1109\/SANER.2019.8667970","DOI":"10.1109\/SANER.2019.8667970"},{"key":"e_1_3_2_18_1","doi-asserted-by":"publisher","unstructured":"17.Tufano M Pantiuchina J Watson C et al. On learning meaningful code changes via neural machine translation. In: 2019 IEEE\/ACM 41st International Conference on Software Engineering (ICSE). IEEE; 2019; pp. 25\u201336; doi: 10.1109\/ICSE.2019.00021","DOI":"10.1109\/ICSE.2019.00021"},{"key":"e_1_3_2_19_1","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2020.3020502"},{"key":"e_1_3_2_20_1","article-title":"A systematic literature review on large language models for automated program repair","author":"Zhang Q","year":"2024","unstructured":"19.Zhang Q, , Fang C, , Xie Y, et al. A systematic literature review on large language models for automated program repair. arXiv Preprint 2024; doi: 10.48550\/arXiv.2405.01466","journal-title":"arXiv Preprint"},{"key":"e_1_3_2_21_1","doi-asserted-by":"publisher","unstructured":"20.Ye H Martinez M Monperrus M. Neural program repair with execution-based backpropagation. In: Proceedings of the 44th International Conference on Software Engineering. ACM; 2022; pp. 1506\u201318; doi: 10.1145\/3510003.3510222","DOI":"10.1145\/3510003.3510222"},{"key":"e_1_3_2_22_1","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2019.2940179"},{"key":"e_1_3_2_23_1","doi-asserted-by":"publisher","unstructured":"22.Li Y Wang S Nguyen TN. Dlfix: Context-based code transformation learning for automated program repair. In: Proceedings of the ACM\/IEEE 42nd International Conference on Software Engineering. ACM; 2020; pp. 602\u201314; doi: 10.1145\/3377811.3380345","DOI":"10.1145\/3377811.3380345"},{"key":"e_1_3_2_24_1","doi-asserted-by":"publisher","unstructured":"23.Lutellier T Pham HV Pang L et al. Coconut: Combining context-aware neural translation models using ensemble for program repair. In: Proceedings of the 29th ACM SIGSOFT international symposium on software testing and analysis. ACM; 2020; pp. 101\u201314; doi: 10.1145\/3395363.3397369","DOI":"10.1145\/3395363.3397369"},{"key":"e_1_3_2_25_1","doi-asserted-by":"publisher","unstructured":"24.Jiang N Lutellier T Tan L. Cure: Code-aware neural machine translation for automatic program repair. In: 2021 IEEE\/ACM 43rd International Conference on Software Engineering (ICSE). IEEE; 2021; pp. 1161\u201373; doi: 10.1109\/ICSE43902.2021.00107","DOI":"10.1109\/ICSE43902.2021.00107"},{"key":"e_1_3_2_26_1","doi-asserted-by":"publisher","unstructured":"25.Zhu Q Sun Z Xiao Y et al. A syntax-guided edit decoder for neural program repair. In: Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. ACM; 2021; pp. 341\u201353; doi: 10.1145\/3468264.3468544","DOI":"10.1145\/3468264.3468544"},{"key":"e_1_3_2_27_1","doi-asserted-by":"publisher","unstructured":"26.Li Y Wang S Nguyen TN. Dear: A novel deep learning-based approach for automated program repair. In: Proceedings of the 44th International Conference on Software Engineering. ACM; 2022; pp. 511\u201323; doi: 10.1145\/3510003.3510177","DOI":"10.1145\/3510003.3510177"},{"key":"e_1_3_2_28_1","doi-asserted-by":"publisher","unstructured":"27.Meng X Wang X Zhang H et al. Improving Fault Localization and Program Repair with Deep Semantic Features and Transferred Knowledge. In: Proceedings of the 44th International Conference on Software Engineering. ICSE \u201822. Association for Computing Machinery: New York NY; 2022; pp. 1169\u20131180; doi: 10.1145\/3510003.3510147","DOI":"10.1145\/3510003.3510147"},{"key":"e_1_3_2_29_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE48619.2023.00111"},{"key":"e_1_3_2_30_1","doi-asserted-by":"publisher","unstructured":"29.Meng X Wang X Zhang H et al. Template-based neural program repair. In: 2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE). IEEE; 2023; pp. 1456\u201368; doi: 10.1109\/ICSE48619.2023.00127","DOI":"10.1109\/ICSE48619.2023.00127"},{"key":"e_1_3_2_31_1","doi-asserted-by":"publisher","unstructured":"30.Ye H Monperrus M. Iter: Iterative neural repair for multi-location patches. In: Proceedings of the 46th IEEE\/ACM International Conference on Software Engineering. IEEE; 2024; pp. 1\u201313; doi: 10.1145\/3597503.3623337","DOI":"10.1145\/3597503.3623337"},{"key":"e_1_3_2_32_1","doi-asserted-by":"publisher","unstructured":"31.Zhang Q Fang C Zhang T et al. Gamma: Revisiting template-based automated program repair via mask prediction. In: 2023 38th IEEE\/ACM International Conference on Automated Software Engineering (ASE). IEEE; 2023; pp. 535\u201347; doi: 10.1109\/ASE56229.2023.00063","DOI":"10.1109\/ASE56229.2023.00063"},{"key":"e_1_3_2_33_1","doi-asserted-by":"publisher","unstructured":"32.Xiong Y Wang J Yan R et al. Precise condition synthesis for program repair. In: 2017 IEEE\/ACM 39th International Conference on Software Engineering (ICSE). IEEE; 2017; pp. 416\u201326; doi: 10.1109\/icse.2017.45","DOI":"10.1109\/icse.2017.45"},{"key":"e_1_3_2_34_1","article-title":"Learning structural edits via incremental tree transformations","author":"Yao Z","year":"2021","unstructured":"33.Yao Z, , Xu FF, , Yin P, et al. Learning structural edits via incremental tree transformations. arXiv Preprint 2021; doi: 10.48550\/arXiv.2101.12087","journal-title":"arXiv Preprint"},{"key":"e_1_3_2_35_1","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2016.2560811"},{"key":"e_1_3_2_36_1","doi-asserted-by":"publisher","DOI":"10.1162\/neco.1997.9.8.1735"},{"key":"e_1_3_2_37_1","first-page":"8696","article-title":"Codet5: Identifier-aware unified pre-trained encoder-decoder models for code understanding and generation","author":"Wang Y","year":"2021","unstructured":"36.Wang Y, , Wang W, , Joty S, et al. Codet5: Identifier-aware unified pre-trained encoder-decoder models for code understanding and generation. arXiv Preprint 2021:8696\u20138708; doi: 10.18653\/v1\/2021.emnlp-main.685","journal-title":"arXiv Preprint"},{"key":"e_1_3_2_38_1","doi-asserted-by":"publisher","DOI":"10.5555\/3295222.3295349"},{"key":"e_1_3_2_39_1","article-title":"BERT: Pre-training of deep bidirectional transformers for language understanding","author":"Devlin J","year":"2018","unstructured":"38.Devlin J, , Chang MW, , Lee K, et al. BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv Preprint 2018; doi: 10.48550\/arXiv.1810.04805","journal-title":"arXiv Preprint"},{"key":"e_1_3_2_40_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE48619.2023.00125"},{"key":"e_1_3_2_41_1","doi-asserted-by":"publisher","unstructured":"40.Xia CS Zhang L. Less training more repairing please: Revisiting automated program repair via zero-shot learning. In: Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering. ACM; 2022; pp. 959\u201371; doi: 10.1145\/3540250.3549101","DOI":"10.1145\/3540250.3549101"},{"key":"e_1_3_2_42_1","article-title":"Incoder: A generative model for code infilling and synthesis","author":"Fried D","year":"2022","unstructured":"41.Fried D, , Aghajanyan A, , Lin J, et al. Incoder: A generative model for code infilling and synthesis. arXiv Preprint 2022; doi: 10.48550\/arXiv.2204.05999","journal-title":"arXiv Preprint"},{"key":"e_1_3_2_43_1","doi-asserted-by":"publisher","unstructured":"42.Ye H Martinez M Luo X et al. Selfapr: Self-supervised program repair with test execution diagnostics. In: Proceedings of the 37th IEEE\/ACM International Conference on Automated Software Engineering. IEEE; 2022; pp. 1\u201313; doi: 10.1145\/3551349.3556926","DOI":"10.1145\/3551349.3556926"},{"key":"e_1_3_2_44_1","doi-asserted-by":"publisher","DOI":"10.5555\/3454287.3455360"},{"key":"e_1_3_2_45_1","doi-asserted-by":"publisher","unstructured":"44.Zhang Y Wang Y. SeTemAPR: Incorporating semantic knowledge in template-based neural program repair. In: 2024 International Joint Conference on Neural Networks (IJCNN). IEEE; 2024; pp. 1\u20138; doi: 10.1109\/IJCNN60899.2024.10650123","DOI":"10.1109\/IJCNN60899.2024.10650123"},{"key":"e_1_3_2_46_1","doi-asserted-by":"publisher","DOI":"10.1214\/aoms\/1177729694"},{"key":"e_1_3_2_47_1","doi-asserted-by":"publisher","unstructured":"46.Just R Jalali D Ernst MD. Defects4J: A database of existing faults to enable controlled testing studies for Java programs. In: ISSTA 2014. Association for Computing Machinery: New York NY; 2014; pp. 437\u2013440; doi: 10.1145\/2610384.2628055","DOI":"10.1145\/2610384.2628055"},{"key":"e_1_3_2_48_1","article-title":"Adam: A method for stochastic optimization","author":"Kingma DP","year":"2014","unstructured":"47.Kingma DP, , Ba J. Adam: A method for stochastic optimization. arXiv Preprint 2014; doi: 10.48550\/arXiv.1412.6980","journal-title":"arXiv Preprint"},{"key":"e_1_3_2_49_1","doi-asserted-by":"publisher","DOI":"10.1145\/3340544"},{"key":"e_1_3_2_50_1","doi-asserted-by":"publisher","unstructured":"49.Abreu R Zoeteweij P Van Gemund AJ. On the accuracy of spectrum-based fault localization. In: Testing: Academic and industrial conference practice and research techniques-MUTATION (TAICPART-MUTATION 2007). IEEE; 2007. p. 89\u201398; doi: 10.5555\/1308173.1308264","DOI":"10.5555\/1308173.1308264"},{"key":"e_1_3_2_51_1","doi-asserted-by":"publisher","unstructured":"50.Campos J Riboira A Perez A et al. Gzoltar: An eclipse plug-in for testing and debugging. In: Proceedings of the 27th IEEE\/ACM international conference on automated software engineering; 2012; pp. 378\u201381; doi: 10.1145\/2351676.2351752","DOI":"10.1145\/2351676.2351752"},{"key":"e_1_3_2_52_1","doi-asserted-by":"publisher","DOI":"10.1109\/TGCN.2021.3111909"}],"container-title":["Big Data"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/journals.sagepub.com\/doi\/pdf\/10.1177\/2167647X261428016","content-type":"application\/pdf","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/journals.sagepub.com\/doi\/full-xml\/10.1177\/2167647X261428016","content-type":"application\/xml","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/journals.sagepub.com\/doi\/pdf\/10.1177\/2167647X261428016","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,5,24]],"date-time":"2026-05-24T13:46:12Z","timestamp":1779630372000},"score":1,"resource":{"primary":{"URL":"https:\/\/journals.sagepub.com\/doi\/10.1177\/2167647X261428016"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,3,18]]},"references-count":51,"journal-issue":{"issue":"3","published-print":{"date-parts":[[2026,6,1]]}},"alternative-id":["10.1177\/2167647X261428016"],"URL":"https:\/\/doi.org\/10.1177\/2167647x261428016","relation":{},"ISSN":["2167-6461","2167-647X"],"issn-type":[{"value":"2167-6461","type":"print"},{"value":"2167-647X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,3,18]]}}}