{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,8]],"date-time":"2026-10-08T11:37:58Z","timestamp":1791459478916,"version":"4.3.4"},"reference-count":48,"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":[{"name":"National Key Research and Development Program of China","award":["2023YFB2703700"],"award-info":[{"award-number":["2023YFB2703700"]}]},{"DOI":"10.13039\/501100001809","name":"National Natural Science Foundation of China","doi-asserted-by":"crossref","award":["62372492"],"award-info":[{"award-number":["62372492"]}],"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":[[2026,6,30]]},"abstract":"<jats:p>With the rapid development of large language models in code generation, AI-powered editors such as GitHub Copilot and Cursor are revolutionizing software development practices. At the same time, studies have identified potential defects in the generated code. Previous research has predominantly examined how code context influences the generation of defective code, often overlooking the impact of defects within commented-out code (CO code). AI coding assistants' interpretation of CO code in prompts affects the code they generate. \n This study evaluates how AI coding assistants, GitHub Copilot and Cursor, are influenced by defective CO code. The experimental results show that defective CO code in the context causes AI coding assistants to generate more defective code, reaching up to 58.17 percent. Our findings further demonstrate that the tools do not simply copy the defective code from the context. Instead, they actively reason to complete incomplete defect patterns and continue to produce defective code despite distractions such as incorrect indentation or tags. Even with explicit instructions to ignore the defective CO code, the reduction in defects does not exceed 21.84 percent. These findings underscore the need for improved robustness and security measures in AI coding assistants.<\/jats:p>","DOI":"10.1145\/3797102","type":"journal-article","created":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T17:06:14Z","timestamp":1782839174000},"page":"1650-1670","source":"Crossref","is-referenced-by-count":3,"title":["Comment Traps: How Defective Commented-Out Code Augment Defects in AI-Assisted Code Generation"],"prefix":"10.1145","volume":"3","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-9548-0208","authenticated-orcid":false,"given":"Yuan","family":"Huang","sequence":"first","affiliation":[{"name":"Sun Yat-sen University, Zhuhai, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0007-5332-6919","authenticated-orcid":false,"given":"Yukang","family":"Zhou","sequence":"additional","affiliation":[{"name":"Sun Yat-sen University, Zhuhai, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8234-3186","authenticated-orcid":false,"given":"Xiangping","family":"Chen","sequence":"additional","affiliation":[{"name":"Sun Yat-sen University, Zhuhai, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7878-4330","authenticated-orcid":false,"given":"Zibin","family":"Zheng","sequence":"additional","affiliation":[{"name":"Sun Yat-sen University, Zhuhai, 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","DOI":"10.1109\/SNAMS58071.2022.10062688"},{"key":"e_1_2_1_2_1","doi-asserted-by":"publisher","DOI":"10.1109\/MSR59073.2023.00033"},{"key":"e_1_2_1_3_1","doi-asserted-by":"publisher","DOI":"10.1109\/eSmarTA62850.2024.10638877"},{"key":"e_1_2_1_4_1","unstructured":"Anthropic. 2024. Claude 3.5 Sonnet. https:\/\/www.anthropic.com\/news\/claude-3-5-sonnet. Accessed: 2025-08-07."},{"key":"e_1_2_1_5_1","doi-asserted-by":"publisher","DOI":"10.1109\/APSEC65559.2024.00039"},{"key":"e_1_2_1_6_1","doi-asserted-by":"publisher","DOI":"10.1109\/CSR64739.2025.11130176"},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1109\/ACCESS.2024.3486365"},{"key":"e_1_2_1_8_1","doi-asserted-by":"publisher","DOI":"10.1109\/TETCI.2024.3446695"},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1109\/QRS62785.2024.00026"},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1007\/s11432-023-4127-5"},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/3643727"},{"key":"e_1_2_1_12_1","doi-asserted-by":"publisher","DOI":"10.1007\/s10515-025-00550-4"},{"key":"e_1_2_1_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/3639478"},{"key":"e_1_2_1_14_1","volume-title":"Cursor: AI-powered code editor","year":"2023","unstructured":"Cursor. 2023. Cursor: AI-powered code editor. https:\/\/www.cursor.so\/. https:\/\/www.cursor.so\/ Accessed: March 23, 2025."},{"key":"e_1_2_1_15_1","volume-title":"Cursor Official Website. https:\/\/cursor.com\/features Retrieved","author":"Code Features","year":"2025","unstructured":"Cursor. 2025. Features | Cursor -The AI-first Code Editor. Cursor Official Website. https:\/\/cursor.com\/features Retrieved April 6, 2025, from https:\/\/cursor.com\/features."},{"key":"e_1_2_1_16_1","doi-asserted-by":"publisher","DOI":"10.1109\/EMCTECH63049.2024.10741797"},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/3643916.3644409"},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/3716848"},{"key":"e_1_2_1_19_1","doi-asserted-by":"publisher","DOI":"10.1109\/RICAI64321.2024.10911408"},{"key":"e_1_2_1_20_1","volume-title":"GitHub Copilot: Your AI pair programmer. https:\/\/copilot.github.com\/. https:\/\/copilot.github.com\/ Accessed","year":"2025","unstructured":"GitHub. 2021. GitHub Copilot: Your AI pair programmer. https:\/\/copilot.github.com\/. https:\/\/copilot.github.com\/ Accessed: March 23, 2025."},{"key":"e_1_2_1_21_1","volume-title":"CodeQL: The libraries and queries that power security researchers and code scanning in GitHub Advanced Security. https:\/\/github.com\/github\/CodeQL. https:\/\/github.com\/github\/CodeQL Accessed","year":"2025","unstructured":"GitHub. 2025. CodeQL: The libraries and queries that power security researchers and code scanning in GitHub Advanced Security. https:\/\/github.com\/github\/CodeQL. https:\/\/github.com\/github\/CodeQL Accessed: May 22, 2025."},{"key":"e_1_2_1_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/3639478.3643107"},{"key":"e_1_2_1_23_1","doi-asserted-by":"publisher","DOI":"10.1109\/CSCE60160.2023.00396"},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1007\/s11219-025-09733-4"},{"key":"e_1_2_1_25_1","unstructured":"Yuan Huang Yinan Chen Xiangping Chen Junqi Chen Rui Peng Zhicao Tang Jinbo Huang Furen Xu and Zibin Zheng. 2024. Generative Software Engineering. arXiv:2403.02583 [cs.SE] https:\/\/arxiv.org\/abs\/2403.02583"},{"key":"e_1_2_1_26_1","doi-asserted-by":"publisher","DOI":"10.1145\/3510454.3522684"},{"key":"e_1_2_1_27_1","doi-asserted-by":"publisher","DOI":"10.1109\/IITCEE64140.2025.10915349"},{"key":"e_1_2_1_28_1","doi-asserted-by":"publisher","DOI":"10.1109\/CANDO-EPE65072.2024.10772760"},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICDM59182.2024.00026"},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/3650105.3652299"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1109\/ISSRE62328.2024.00030"},{"key":"e_1_2_1_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/3643795.3648392"},{"key":"e_1_2_1_33_1","volume-title":"Claude, Cursor, GitHub Copilot, and ChatGPT. https:\/\/lobehub.com\/zh\/icons. https:\/\/lobehub.com\/zh\/icons Accessed","year":"2025","unstructured":"LobeHub. 2025. Icons for GitHub, Claude, Cursor, GitHub Copilot, and ChatGPT. https:\/\/lobehub.com\/zh\/icons. https:\/\/lobehub.com\/zh\/icons Accessed: January 8, 2025."},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.1109\/SANER60148.2024.00051"},{"key":"e_1_2_1_35_1","doi-asserted-by":"publisher","DOI":"10.1109\/LAD62341.2024.10691683"},{"key":"e_1_2_1_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3639176"},{"key":"e_1_2_1_37_1","unstructured":"OpenAI. 2024. Hello GPT-4o. https:\/\/openai.com\/index\/hello-gpt-4o\/. Accessed: 2025-08-07."},{"key":"e_1_2_1_38_1","doi-asserted-by":"publisher","DOI":"10.1109\/SP46214.2022.9833571"},{"key":"e_1_2_1_39_1","doi-asserted-by":"publisher","DOI":"10.1145\/3387904.3389259"},{"key":"e_1_2_1_40_1","doi-asserted-by":"publisher","DOI":"10.1109\/ISPA63168.2024.00314"},{"key":"e_1_2_1_41_1","volume-title":"How GitHub Copilot is getting better at understanding your code. https:\/\/github.blog\/ai-andml\/github-copilot\/how-github-copilot-is-getting-better-at-understanding-your-code\/ Updated","author":"Rosenkilde Johan","year":"2024","unstructured":"Johan Rosenkilde. 2023. How GitHub Copilot is getting better at understanding your code. https:\/\/github.blog\/ai-andml\/github-copilot\/how-github-copilot-is-getting-better-at-understanding-your-code\/ Updated: February 7, 2024."},{"key":"e_1_2_1_42_1","volume-title":"Hugging Face, and OpenAI's GPT-3, ChatGPT, and GPT-4","author":"Rothman Denis","unstructured":"Denis Rothman and Antonio Gulli. 2022. Transformers for Natural Language Processing: Build, Train, and Fine-Tune Deep Neural Network Architectures for NLP with Python, Hugging Face, and OpenAI's GPT-3, ChatGPT, and GPT-4 (2nd ed.). Packt Publishing, Birmingham, UK.","edition":"2"},{"key":"e_1_2_1_43_1","volume-title":"Icons from Flaticon. https:\/\/www.flaticon.com. https:\/\/www.flaticon.com Accessed","author":"Studio Secret","year":"2025","unstructured":"Secret Studio and Freepik. 2025. Icons from Flaticon. https:\/\/www.flaticon.com. https:\/\/www.flaticon.com Accessed: January 8, 2025."},{"key":"e_1_2_1_44_1","doi-asserted-by":"publisher","DOI":"10.1109\/NLBSE59153.2023.00018"},{"key":"e_1_2_1_45_1","volume-title":"The CodeQL icon. https:\/\/www.svgrepo.com\/svg\/373515\/CodeQL. https:\/\/www.svgrepo.com\/svg\/ 373515\/CodeQL Accessed","year":"2025","unstructured":"SVGRepo. 2025. The CodeQL icon. https:\/\/www.svgrepo.com\/svg\/373515\/CodeQL. https:\/\/www.svgrepo.com\/svg\/ 373515\/CodeQL Accessed: January 8, 2025."},{"key":"e_1_2_1_46_1","first-page":"15","article-title":"Common Weakness Enumeration (CWE) -Research Concepts View (CWE-1000)","volume":"4","author":"The MITRE Corporation","year":"2025","unstructured":"The MITRE Corporation. 2025. Common Weakness Enumeration (CWE) -Research Concepts View (CWE-1000), Version 4.15. https:\/\/cwe.mitre.org\/data\/definitions\/1000.html. Accessed: March 23, 2025.","journal-title":"Version"},{"key":"e_1_2_1_47_1","volume-title":"Exploring GPT-3: An Unofficial First Look at the General-Purpose Language Processing API from OpenAI","author":"Tingiris Spiros","unstructured":"Spiros Tingiris and Brian Kinsella. 2021. Exploring GPT-3: An Unofficial First Look at the General-Purpose Language Processing API from OpenAI. Packt Publishing, Birmingham, UK."},{"key":"e_1_2_1_48_1","doi-asserted-by":"publisher","DOI":"10.1109\/MLCAD62225.2024.10740226"}],"container-title":["Proceedings of the ACM on Software Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3797102","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T18:46:57Z","timestamp":1782845217000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3797102"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,6,30]]},"references-count":48,"journal-issue":{"issue":"FSE","published-print":{"date-parts":[[2026,6,30]]}},"alternative-id":["10.1145\/3797102"],"URL":"https:\/\/doi.org\/10.1145\/3797102","relation":{},"ISSN":["2994-970X"],"issn-type":[{"value":"2994-970X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,6,30]]}}}