Shanping Li
Current Organizations / Institutes
The organizations/institutes from the scholar's latest article
Previous Organizations / Institutes
The organizations / institutes from the scholar's other articles in the past ten years
Research Subjects
Research Interests
Shanping Li has a total of 97 co-authors. Here are the top co-authors by number of shared publications:
- Xin Xia
The State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China
38 shared publications - Xing Hu
The State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China
20 shared publications - David Lo
School of Computing and Information Systems, Singapore Management University, Singapore, Singapore
17 shared publications Xinyu Wang
College of Computer Science and Technology, Zhejiang University, Hangzhou, China
7 shared publications- Ahmed E. Hassan
Queen’s University, Canada
6 shared publications - Shengyi Pan
Zhejiang University, Hangzhou, China
5 shared publications
Latest Publications
- Open Access
- 7 October 2026
- Published by Association for Computing Machinery (ACM)
- p. 942-954
EMERGE: Checking Implementation Equivalence for LLMs via Rule Synthesis
- 7 October 2026
- Published by Association for Computing Machinery (ACM)
- p. 942-954
Open AccessEMERGE: Checking Implementation Equivalence for LLMs via Rule Synthesis
- Open Access
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3  (ISSTA) , 2225-2247
Answer Is Cheap, Show Me the Evidence! Augmenting Automated Vulnerability Assessment with Evidence
Software Vulnerability (SV) assessment is a vital phase in SV management, which characterizes discovered SVs to locate hot spots and prioritize their remediation. To reduce the overhead and latency of manual assessment, prior works have explored automatically predicting assessment results from SV reports (SVRs). However, existing approaches fail to process the information conveyed by the rich text content (e.g., screenshots and code snippets) embedded in SVRs and miss information about vulnerable projects. More importantly, they primarily focus on assessment accuracy while neglecting to provide explanations or evidence supporting their predictions. As a result, these approaches remain impractical in real-world settings, where imperfect accuracy necessitates manual validation. LLMs offer a promising opportunity to address this limitation by performing SV assessment while simultaneously providing supporting evidence. Nevertheless, our extensive evaluation reveals that mainstream LLMs perform poorly on SV assessment tasks, largely due to a lack of assessment specific knowledge. To address the above challenges, we propose EAVA, a novel framework that effectively leverages LLMs to perform SV assessment and provide supporting evidence. EAVA employs specialized LLM agents to process rich text content in SVRs and incorporate information about vulnerable projects. EAVA builds a dedicated assessment LLM by injecting assessment-specific knowledge through finetuning. Specifically, we enable large-scale reasoning trajectory annotation using off-the-shelf LLMs and adopt a two-stage training paradigm, i.e., supervised instruction tuning to inject domain knowledge, followed by reinforcement learning to enhance the model’s intrinsic reasoning capability. Evaluations on a newly collected SVR dataset demonstrate that EAVA outperforms the best-performing baseline by 5.3%-35.2% across multiple evaluation metrics. Ablation studies validate the effectiveness of our design choices for both assessment specific model training and SV information enrichment. Finally, a user study with security experts confirms that the evidence provided by EAVA is useful and practical for real-world SV assessment.
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3  (ISSTA) , 2225-2247
Open AccessAnswer Is Cheap, Show Me the Evidence! Augmenting Automated Vulnerability Assessment with Evidence
Software Vulnerability (SV) assessment is a vital phase in SV management, which characterizes discovered SVs to locate hot spots and prioritize their remediation. To reduce the overhead and latency of manual assessment, prior works have explored automatically predicting assessment results from SV reports (SVRs). However, existing approaches fail to process the information conveyed by the rich text content (e.g., screenshots and code snippets) embedded in SVRs and miss information about vulnerable projects. More importantly, they primarily focus on assessment accuracy while neglecting to provide explanations or evidence supporting their predictions. As a result, these approaches remain impractical in real-world settings, where imperfect accuracy necessitates manual validation. LLMs offer a promising opportunity to address this limitation by performing SV assessment while simultaneously providing supporting evidence. Nevertheless, our extensive evaluation reveals that mainstream LLMs perform poorly on SV assessment tasks, largely due to a lack of assessment specific knowledge. To address the above challenges, we propose EAVA, a novel framework that effectively leverages LLMs to perform SV assessment and provide supporting evidence. EAVA employs specialized LLM agents to process rich text content in SVRs and incorporate information about vulnerable projects. EAVA builds a dedicated assessment LLM by injecting assessment-specific knowledge through finetuning. Specifically, we enable large-scale reasoning trajectory annotation using off-the-shelf LLMs and adopt a two-stage training paradigm, i.e., supervised instruction tuning to inject domain knowledge, followed by reinforcement learning to enhance the model’s intrinsic reasoning capability. Evaluations on a newly collected SVR dataset demonstrate that EAVA outperforms the best-performing baseline by 5.3%-35.2% across multiple evaluation metrics. Ablation studies validate the effectiveness of our design choices for both assessment specific model training and SV information enrichment. Finally, a user study with security experts confirms that the evidence provided by EAVA is useful and practical for real-world SV assessment.
- Open Access
- 17 September 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
Bug Whisperer: Unleashing LLMs to Craft Context-Aware Tests Guided by Path Constraints and Bug Clues
Automated unit test generation using Large Language Models (LLMs) has garnered significant attention due to its potential to streamline software testing. Despite its promise, existing approaches often fall short in effectively detecting bugs. There are two key limitations in the bug detection capabilities of tests generated by LLMs: (1) It is difficult for them to identify and focus on bug-related information within large and complex codebases, particularly when bugs are embedded in intricate program dependencies and nested conditions. (2) Existing LLM-based methods are less effective in generating correct test cases when the focal method is provided without more context. To address these challenges, we propose BugWhisper, a novel approach comprising three core modules: bug detection & localization module, path constraint construction module, and test generation module. In the bug detection & localization module, we leverage custom-designed prompts to extract and highlight buggy information from LLMs. The path constraint construction module introduces a greedy-based path extraction algorithm to prioritize bug-triggering paths that cover the maximum number of buggy statements. Constraints from these paths are then used to generate path condition constraint prompts. Finally, the test generation module constructs context-aware prompts by integrating path constraints with multiple types of context information, including import context, class type context, focal class method context, and buggy statement information. These enriched prompts guide LLMs to generate more effective and precise test cases. Our evaluation on the Defects4J benchmark demonstrates that BugWhisper enhances the bug detection capabilities of LLMs. Specifically, compared with existing state-of-the-art baselines, it achieves a 78.02% improvement in compilation passing rate, and a 133.33% boost in the bug successful detection rate. Besides, BugWhisper improves line and branch coverage by 8.36% and 15.89%, respectively. Ablation studies further validate the contribution of each prompt component, highlighting BugWhisper's potential as a systematic and efficient solution for bug detection in complex software systems.
- 17 September 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
Open AccessBug Whisperer: Unleashing LLMs to Craft Context-Aware Tests Guided by Path Constraints and Bug Clues
Automated unit test generation using Large Language Models (LLMs) has garnered significant attention due to its potential to streamline software testing. Despite its promise, existing approaches often fall short in effectively detecting bugs. There are two key limitations in the bug detection capabilities of tests generated by LLMs: (1) It is difficult for them to identify and focus on bug-related information within large and complex codebases, particularly when bugs are embedded in intricate program dependencies and nested conditions. (2) Existing LLM-based methods are less effective in generating correct test cases when the focal method is provided without more context. To address these challenges, we propose BugWhisper, a novel approach comprising three core modules: bug detection & localization module, path constraint construction module, and test generation module. In the bug detection & localization module, we leverage custom-designed prompts to extract and highlight buggy information from LLMs. The path constraint construction module introduces a greedy-based path extraction algorithm to prioritize bug-triggering paths that cover the maximum number of buggy statements. Constraints from these paths are then used to generate path condition constraint prompts. Finally, the test generation module constructs context-aware prompts by integrating path constraints with multiple types of context information, including import context, class type context, focal class method context, and buggy statement information. These enriched prompts guide LLMs to generate more effective and precise test cases. Our evaluation on the Defects4J benchmark demonstrates that BugWhisper enhances the bug detection capabilities of LLMs. Specifically, compared with existing state-of-the-art baselines, it achieves a 78.02% improvement in compilation passing rate, and a 133.33% boost in the bug successful detection rate. Besides, BugWhisper improves line and branch coverage by 8.36% and 15.89%, respectively. Ablation studies further validate the contribution of each prompt component, highlighting BugWhisper's potential as a systematic and efficient solution for bug detection in complex software systems.
- Open Access
- 5 July 2026
- Published by Association for Computing Machinery (ACM)
- p. 762-772
Mitigating Implicit Inconsistencies in Patch Porting
- 5 July 2026
- Published by Association for Computing Machinery (ACM)
- p. 762-772
Open AccessMitigating Implicit Inconsistencies in Patch Porting
- Open Access
- 30 June 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3  (FSE) , 3138-3161
Automated Knowledge-Aware Test Reuse
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. To 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. We 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.
- 30 June 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3  (FSE) , 3138-3161
Open AccessAutomated Knowledge-Aware Test Reuse
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. To 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. We 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.
- Open Access
- 17 June 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35  (7) , 1-30
More than Meets the Eye: On Evaluating SBOM Tools in Java
Open source software is widely used in current software development. Unfortunately, this integration introduces a spectrum of challenges and potential threats. Such challenges emerge due to the diversity of import scenarios, which in turn may introduce malicious or vulnerable code in the client software, thereby causing significant security risks. To improve the transparency of software supply chains, Software Bill of Materials (SBOM) tools are proposed to identify the components within software systems. However, there is limit investigation of functionality (i.e., tool operational process and data fields) and their practical performance of SBOM tools across various import scenarios. In this article, we perform a comprehensive empirical study to investigate the impact of different import scenarios on SBOM tools. Specifically, we focus on three distinct component import scenarios: Build Tool Import, Dynamic Loading, and Source Code Import across a new benchmark consisting of 152 projects. We find that (1) the detection capabilities of SBOM tools exhibit considerable variance, especially in identifying dependency relationships, and (2) the effectiveness of SBOM tools within the import scenarios of Dynamic Loading and Source Code Import falls short of expectations. Based on our findings, we summarize the lessons learned from different perspectives, including practitioners, tool vendors, and researchers. Our study provides valuable insights into the intricate landscape of software component usage, contributing to enhancing SBOM tools in modern software development.
- 17 June 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35  (7) , 1-30
Open AccessMore than Meets the Eye: On Evaluating SBOM Tools in Java
Open source software is widely used in current software development. Unfortunately, this integration introduces a spectrum of challenges and potential threats. Such challenges emerge due to the diversity of import scenarios, which in turn may introduce malicious or vulnerable code in the client software, thereby causing significant security risks. To improve the transparency of software supply chains, Software Bill of Materials (SBOM) tools are proposed to identify the components within software systems. However, there is limit investigation of functionality (i.e., tool operational process and data fields) and their practical performance of SBOM tools across various import scenarios. In this article, we perform a comprehensive empirical study to investigate the impact of different import scenarios on SBOM tools. Specifically, we focus on three distinct component import scenarios: Build Tool Import, Dynamic Loading, and Source Code Import across a new benchmark consisting of 152 projects. We find that (1) the detection capabilities of SBOM tools exhibit considerable variance, especially in identifying dependency relationships, and (2) the effectiveness of SBOM tools within the import scenarios of Dynamic Loading and Source Code Import falls short of expectations. Based on our findings, we summarize the lessons learned from different perspectives, including practitioners, tool vendors, and researchers. Our study provides valuable insights into the intricate landscape of software component usage, contributing to enhancing SBOM tools in modern software development.
- Open Access
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 2198-2210
Actionable Warning Is Not Enough: Recommending Valid Actionable Warnings with Weak Supervision
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 2198-2210
Open AccessActionable Warning Is Not Enough: Recommending Valid Actionable Warnings with Weak Supervision
- Open Access
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 667-678
Automating Just-In-Time Python Type Annotation Updating
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 667-678
Open AccessAutomating Just-In-Time Python Type Annotation Updating
- Top Cited PapersOpen Access
- 26 March 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35  (9) , 1-67
Enhancing Automated Unit Test Generation with Large Language Models: A Systematic Literature Review
Automated unit test generation is a fundamental yet challenging task in software engineering, playing a critical role in ensuring software correctness, reliability, and maintainability. While traditional approaches such as search-based software testing and symbolic execution have achieved notable success, they often suffer from limited semantic understanding, high configuration costs, and scalability constraints. Recent advances in Large Language Models (LLMs) have fundamentally reshaped the landscape of automated unit testing by enabling models to reason over source code semantics and generate executable, context-aware test cases. Despite the rapid growth of this research area, a comprehensive and task-oriented synthesis of existing work remains lacking. This paper presents a systematic literature review of LLM-based unit test generation. This review draws on research from leading SE and AI conferences and journals, including 69 papers published across 25 distinct venues, along with 47 high-quality preprint papers, bringing the total to 116. Our review aims to answer three key research questions: (1) which unit testing tasks have been addressed using LLMs, (2) how LLMs are adapted and integrated into the unit test generation pipeline, and (3) what datasets, benchmarks, and evaluation practices are employed in existing studies. To this end, we organize the literature from a task-centric perspective, covering test generation, test input generation, test oracle generation, and test evolution, and from a methodological perspective, categorizing LLM adaptation strategies into fine-tuning, prompt engineering, and agent-based approaches. Our analysis reveals that current research predominantly focuses on function- and class-level test generation, with comparatively limited attention given to test input generation, oracle construction, and long-term test evolution. Decoder-only LLMs, particularly GPT-family and LLaMA-based models, dominate the field, while encoder-only and encoder–decoder models remain underexplored. We further observe substantial disparities in dataset characteristics, programming language coverage, and evaluation metrics, which hinder fair comparison and reproducibility across studies. Based on empirical evidence extracted from the surveyed literature, we identify key challenges facing LLM-based unit test generation. Building on these findings, we outline several promising research directions, such as dataset optimization, structure-aware context modeling, agent coordination mechanisms, and benchmark enhancement. This review provides a consolidated and evidence-driven foundation for future research, aiming to advance the development of scalable, reliable, and practically applicable LLM-driven unit testing techniques.
- 26 March 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35  (9) , 1-67
Top Cited PapersOpen AccessEnhancing Automated Unit Test Generation with Large Language Models: A Systematic Literature Review
Automated unit test generation is a fundamental yet challenging task in software engineering, playing a critical role in ensuring software correctness, reliability, and maintainability. While traditional approaches such as search-based software testing and symbolic execution have achieved notable success, they often suffer from limited semantic understanding, high configuration costs, and scalability constraints. Recent advances in Large Language Models (LLMs) have fundamentally reshaped the landscape of automated unit testing by enabling models to reason over source code semantics and generate executable, context-aware test cases. Despite the rapid growth of this research area, a comprehensive and task-oriented synthesis of existing work remains lacking. This paper presents a systematic literature review of LLM-based unit test generation. This review draws on research from leading SE and AI conferences and journals, including 69 papers published across 25 distinct venues, along with 47 high-quality preprint papers, bringing the total to 116. Our review aims to answer three key research questions: (1) which unit testing tasks have been addressed using LLMs, (2) how LLMs are adapted and integrated into the unit test generation pipeline, and (3) what datasets, benchmarks, and evaluation practices are employed in existing studies. To this end, we organize the literature from a task-centric perspective, covering test generation, test input generation, test oracle generation, and test evolution, and from a methodological perspective, categorizing LLM adaptation strategies into fine-tuning, prompt engineering, and agent-based approaches. Our analysis reveals that current research predominantly focuses on function- and class-level test generation, with comparatively limited attention given to test input generation, oracle construction, and long-term test evolution. Decoder-only LLMs, particularly GPT-family and LLaMA-based models, dominate the field, while encoder-only and encoder–decoder models remain underexplored. We further observe substantial disparities in dataset characteristics, programming language coverage, and evaluation metrics, which hinder fair comparison and reproducibility across studies. Based on empirical evidence extracted from the surveyed literature, we identify key challenges facing LLM-based unit test generation. Building on these findings, we outline several promising research directions, such as dataset optimization, structure-aware context modeling, agent coordination mechanisms, and benchmark enhancement. This review provides a consolidated and evidence-driven foundation for future research, aiming to advance the development of scalable, reliable, and practically applicable LLM-driven unit testing techniques.
- Open Access
- 5 February 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35  (10) , 1-30
Clean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Dataset
The Large Language Models (LLMs) have demonstrated great potential in code-related tasks. However, most research focuses on improving the output quality of LLMs (e.g., correctness), and less attention has been paid to the LLM input (e.g., the training code quality). Given that code smells are widely existed in practice and can negatively impact software maintainability and readability, this study takes the first systematic research to assess and improve dataset quality in terms of code smells. In this work, we first conduct a preliminary study to explore the presence of code smells in a popular benchmark dataset (i.e., CodeSearchNet -Python) and evaluate the output of several popular LLMs (i.e., DeepSeek-Coder, CodeLlama, and MagiCoder), revealing that code smell issues extensively exist in LLM’s input (e.g., benchmark dataset) and output (e.g., generated code). We also perform a user study to investigate developers’ perspectives on LLM-generated code with and without smells, which indicated developers’ strong preference for smell-free code and their willingness to leverage LLMs for intricate code smell removal. We then conduct our systematic research by taking three main steps: Firstly, we propose an LLM-based code smell cleaning tool, named Smell CC ( Smell C ode C leaner), which automatically refactors and removes code smells. To evaluate the correctness of the code refactoring, we construct a test set of 50 repositories sourced from the CodeSearchNet -Python benchmark for functional testing. Then we apply our curated smell-cleaned dataset to fine-tune two LLMs (i.e., DeepSeek-V2 and Qwen-Coder) to explore their potential for generating high-quality code. Thirdly, we investigate the impact of code smells on two downstream tasks: code completion and code search. Furthermore, to access the generalizability of Smell CC , we conduct a cross-project evaluation. Lastly, we derive several actionable implications for software engineering researchers and industry practitioners from our findings. The experimental results show that our Smell CC eliminates 91.6% of code smells across the entire CodeSearchNet -Python corpus, curating a smell-cleaned benchmark dataset. On a curated 50-repository subset, Smell CC achieves 96.8% smell removal while maintaining 91.3% correctness through test verification. The LLMs fine-tuned on this smell-cleaned dataset reduce code smells in generated code by 79.6% and 83.1% for DeepSeek-V2 and Qwen-Coder respectively. Moreover, applying the smell-cleaned dataset to code completion and code search tasks yields significant improvements across all models (DeepSeek-V1/V2, Qwen-Coder), with Qwen-Coder achieving peak gains of 12.2% in completion and 4.3% in search performance. Finally, Smell CC also demonstrates strong generalization capabilities in a cross-project setting.
- 5 February 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35  (10) , 1-30
Open AccessClean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Dataset
The Large Language Models (LLMs) have demonstrated great potential in code-related tasks. However, most research focuses on improving the output quality of LLMs (e.g., correctness), and less attention has been paid to the LLM input (e.g., the training code quality). Given that code smells are widely existed in practice and can negatively impact software maintainability and readability, this study takes the first systematic research to assess and improve dataset quality in terms of code smells. In this work, we first conduct a preliminary study to explore the presence of code smells in a popular benchmark dataset (i.e., CodeSearchNet -Python) and evaluate the output of several popular LLMs (i.e., DeepSeek-Coder, CodeLlama, and MagiCoder), revealing that code smell issues extensively exist in LLM’s input (e.g., benchmark dataset) and output (e.g., generated code). We also perform a user study to investigate developers’ perspectives on LLM-generated code with and without smells, which indicated developers’ strong preference for smell-free code and their willingness to leverage LLMs for intricate code smell removal. We then conduct our systematic research by taking three main steps: Firstly, we propose an LLM-based code smell cleaning tool, named Smell CC ( Smell C ode C leaner), which automatically refactors and removes code smells. To evaluate the correctness of the code refactoring, we construct a test set of 50 repositories sourced from the CodeSearchNet -Python benchmark for functional testing. Then we apply our curated smell-cleaned dataset to fine-tune two LLMs (i.e., DeepSeek-V2 and Qwen-Coder) to explore their potential for generating high-quality code. Thirdly, we investigate the impact of code smells on two downstream tasks: code completion and code search. Furthermore, to access the generalizability of Smell CC , we conduct a cross-project evaluation. Lastly, we derive several actionable implications for software engineering researchers and industry practitioners from our findings. The experimental results show that our Smell CC eliminates 91.6% of code smells across the entire CodeSearchNet -Python corpus, curating a smell-cleaned benchmark dataset. On a curated 50-repository subset, Smell CC achieves 96.8% smell removal while maintaining 91.3% correctness through test verification. The LLMs fine-tuned on this smell-cleaned dataset reduce code smells in generated code by 79.6% and 83.1% for DeepSeek-V2 and Qwen-Coder respectively. Moreover, applying the smell-cleaned dataset to code completion and code search tasks yields significant improvements across all models (DeepSeek-V1/V2, Qwen-Coder), with Qwen-Coder achieving peak gains of 12.2% in completion and 4.3% in search performance. Finally, Smell CC also demonstrates strong generalization capabilities in a cross-project setting.