{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,10,12]],"date-time":"2025-10-12T03:17:00Z","timestamp":1760239020495,"version":"build-2065373602"},"reference-count":24,"publisher":"MDPI AG","issue":"9","license":[{"start":{"date-parts":[[2020,9,22]],"date-time":"2020-09-22T00:00:00Z","timestamp":1600732800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Symmetry"],"abstract":"<jats:p>Recently, software, especially CPS and Internet of Things (IoT), increasingly have high requirements for quality, while program defects exist inevitably duo to the high complexity. Program defect repair faces serious challenges in that such repairs require considerable manpower, and the existing automatic repair approaches have difficulty generating correct patches efficiently. This paper proposes an automatic method for repairing semantic defects in Java programs based on restricted sets which refer to the interval domains of related variables that can trigger program semantic defects. Our work introduces a repair mechanism symmetrically combining defect patterns and repair templates. First, the program semantic defects are summarized into defect patterns according to their grammar and semantic features. A repair template for each type of defect pattern is predefined based on a restricted-set. Then, for each specific defect, a patch statement is automatically synthesized according to the repair template, and the detected defect information is reported by the static detection tool (DTSJava). Next, the patch location is determined by the def-use chain of defect-related variables. Finally, we evaluate the patches generated by our method using DTSJava. We implemented the method in the defect automatic repair prototype tool DTSFix to verify the effect of repairing the semantic defects detected by DTSJava in 6 Java open-source projects. The experimental results showed that 109 of 129 program semantic defects were repaired.<\/jats:p>","DOI":"10.3390\/sym12091563","type":"journal-article","created":{"date-parts":[[2020,9,24]],"date-time":"2020-09-24T03:03:39Z","timestamp":1600916619000},"page":"1563","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":2,"title":["Automatic Repair of Semantic Defects Using Restraint Mechanisms"],"prefix":"10.3390","volume":"12","author":[{"given":"Yukun","family":"Dong","sequence":"first","affiliation":[{"name":"College of Computer Science and Technology, China University of Petroleum, Qingdao, 266580, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Li","family":"Zhang","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, China University of Petroleum, Qingdao, 266580, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Shanchen","family":"Pang","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, China University of Petroleum, Qingdao, 266580, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Wenjing","family":"Yin","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, China University of Petroleum, Qingdao, 266580, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Mengying","family":"Wu","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, China University of Petroleum, Qingdao, 266580, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Meng","family":"Wu","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, China University of Petroleum, Qingdao, 266580, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Haojie","family":"Li","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, China University of Petroleum, Qingdao, 266580, China"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"1968","published-online":{"date-parts":[[2020,9,22]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","unstructured":"Xu, G., Zhao, Y., Jiao, L., Feng, M., Ji, Z., Panaousis, E., Chen, S., and Zheng, X. (2020). TT-SVD: An Efficient Sparse Decision Making Model with Two-way Trust Recommendation in the AI Enabled IoT Systems. IEEE Internet Things J.","DOI":"10.1109\/JIOT.2020.3006066"},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"2539","DOI":"10.1109\/JIOT.2019.2944006","article-title":"SoProtector: Safeguard Privacy for Native SO Files in Evolving Mobile IoT Applications","volume":"7","author":"Xu","year":"2020","journal-title":"Internet Things J."},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"54","DOI":"10.1109\/TSE.2011.104","article-title":"GenProg: A Generic Method for Automatic Software Repair","volume":"38","author":"Goues","year":"2012","journal-title":"IEEE Trans. Softw. Eng."},{"key":"ref_4","unstructured":"Goues, C.L., Dewey-Vogt, M., Forrest, S., and Weimer, W. (2012, January 2\u20139). A systematic study of automated program repair: Fixing 55 out of 105 bugs for $8 each. Proceedings of the International Conference on Software Engineering, Zurich, Switzerland."},{"key":"ref_5","doi-asserted-by":"crossref","unstructured":"Le, X.D., Le, Q.L., Lo, D., and Goues, C.L. (2017, January 2\u20137). Enhancing Automated Program Repair with Deductive Verification. Proceedings of the IEEE International Conference on Software Maintenance and Evolution (ICSME), Raleigh, NC, USA.","DOI":"10.1109\/ICSME.2016.66"},{"key":"ref_6","first-page":"244","article-title":"Automatic program repair: Key problems and technologies","volume":"30","author":"Li","year":"2019","journal-title":"Ruan Jian Xue Bao J. Softw."},{"key":"ref_7","unstructured":"Xiong, Y., Liu, X., Zeng, M., Zhang, L., and Huang, G. (June, January 27). Identifying patch correctness in test-based program repair. Proceedings of the 40th International Conference on Software Engineering, Gothenburg, Sweden."},{"key":"ref_8","doi-asserted-by":"crossref","unstructured":"Durieux, T., and Monperrus, M. (2016, January 14\u201315). DynaMoth: Dynamic code synthesis for automatic program repair. Proceedings of the International Workshop on Automation of Software Test, Austin, TX, USA.","DOI":"10.1145\/2896921.2896931"},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Le, X.D., Chu, D., Lo, D., Goues, C.L., and Visser, W. (2017, January 22\u201329). S3: Syntax- and semantic-guided repair synthesis via programming by examples. Proceedings of the Joint Meeting on Foundations of Software Engineering, Uppsala, Sweden.","DOI":"10.1145\/3106237.3106309"},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Liu, K., Koyuncu, N., Kim, O., and Bissyande, E.F. (2019, January 24\u201327). Avatar: Fixing semantic bugs with fix patterns of static analysis violations. Proceedings of the 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER), Hangzhou, China.","DOI":"10.1109\/SANER.2019.8667970"},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Qi, Z., Long, F., Achour, S., and Rinard, M. (2015, January 12\u201317). An Analysis of Patch Plausibility and Correctness for Generate-And- Validate Patch Generation Systems. Proceedings of the International Symposium on Software Testing & Analysis, Baltimore, MD, USA.","DOI":"10.1145\/2771783.2771791"},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Weimer, W., Fry, Z.P., and Forrest, S. (2013, January 11\u201315). Leveraging program equivalence for adaptive program repair: Models and first results. Proceedings of the Automated Software Engineering, Silicon Valley, CA, USA.","DOI":"10.1109\/ASE.2013.6693094"},{"key":"ref_13","first-page":"31","article-title":"Illegal computing defect detection by static analysis for C program","volume":"52","author":"Dong","year":"2016","journal-title":"Comput. Eng. Appl."},{"key":"ref_14","first-page":"1744","article-title":"Null Pointer Dereference Defect Detected Based on Region-Based Memory Model","volume":"42","author":"Dong","year":"2014","journal-title":"Acta Electron. Sin."},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Nguyen, H.D.T., Qi, D., Roychoudhury, A., and Chandra, S. (2013, January 18\u201326). SemFix: Program Repair via Semantic Analysis. Proceedings of the 2013 35th International Conference on Software Engineering(ICSE), San Francisco, CA, USA.","DOI":"10.1109\/ICSE.2013.6606623"},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"34","DOI":"10.1109\/TSE.2016.2560811","article-title":"Nopol: Automatic Repair of Conditional Statement Bugs in Java Programs","volume":"43","author":"Xuan","year":"2017","journal-title":"IEEE Trans. Softw. Eng."},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Le, X.D., Chu, D., Lo, D., Goues, C.L., and Visser, W. (2017, January 10\u201314). JFIX: Semantics-Based Repair of Java Programs via Symbolic PathFinder. Proceedings of the International Symposium on Software Testing and Analysis, Santa Barbara, CA, USA.","DOI":"10.1145\/3092703.3098225"},{"key":"ref_18","unstructured":"Mechtaev, S., and Roychoudhury, A. (June, January 27). Semantic program repair using a reference implementation. Proceedings of the 40th International Conference, Gothenburg, Sweden."},{"key":"ref_19","doi-asserted-by":"crossref","unstructured":"Gao, Q., Xiong, Y., Mi, Y., Zhang, L., Yang, W., Zhou, Z., Xie, B., and Mei, H. (2015, January 16\u201324). Safe Memory-Leak Fixing for C Programs. Proceedings of the IEEE\/ACM 37th IEEE International Conference on Software Engineering (ICSE), Florence, Italy.","DOI":"10.1109\/ICSE.2015.64"},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Liu, C., Yang, J., Tan, L., and Hafiz, M. (2013, January 18\u201322). R2Fix: Automatically Generating Bug Fixes from Bug Reports. Proceedings of the 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation(ICST), Luxembourg.","DOI":"10.1109\/ICST.2013.24"},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Durieux, T., Cornu, B., Seinturier, L., and Monperrus, M. (2017, January 20\u201324). Dynamic patch generation for null pointer exceptions using metaprogramming. Proceedings of the 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER), Klagenfurt, Austria.","DOI":"10.1109\/SANER.2017.7884635"},{"key":"ref_22","doi-asserted-by":"crossref","unstructured":"Kim, D., Nam, J., Song, J., and Kim, S. (2013, January 18\u201326). Automatic patch generation learned from human-written patches. Proceedings of the IEEE\/ACM 37th IEEE International Conference on Software Engineering (ICSE), San Francisco, CA, USA.","DOI":"10.1109\/ICSE.2013.6606626"},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"Xiong, Y., Wang, J., Yan, R., Zhang, J., Han, S., Huang, G., and Zhang, L. (2017, January 20\u201328). Precise condition synthesis for program repair. Proceedings of the IEEE\/ACM 39th International Conference on Software Engineering (ICSE), Buenos Aires, Argentina.","DOI":"10.1109\/ICSE.2017.45"},{"key":"ref_24","first-page":"386","article-title":"Optimizing static analysis based on defect correlations","volume":"25","author":"Zhang","year":"2014","journal-title":"Ruan Jian Xue Bao J. Softw."}],"container-title":["Symmetry"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2073-8994\/12\/9\/1563\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,11]],"date-time":"2025-10-11T10:12:13Z","timestamp":1760177533000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2073-8994\/12\/9\/1563"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2020,9,22]]},"references-count":24,"journal-issue":{"issue":"9","published-online":{"date-parts":[[2020,9]]}},"alternative-id":["sym12091563"],"URL":"https:\/\/doi.org\/10.3390\/sym12091563","relation":{},"ISSN":["2073-8994"],"issn-type":[{"type":"electronic","value":"2073-8994"}],"subject":[],"published":{"date-parts":[[2020,9,22]]}}}