Publication Type
Conference Proceeding Article
Version
acceptedVersion
Publication Date
5-2025
Abstract
Code refinement aims to enhance existing code by addressing issues, refactoring, and optimizing to improve quality and meet specific requirements. As software projects scale in size and complexity, the traditional iterative exchange between reviewers and developers becomes increasingly burdensome. While recent deep learning techniques have been explored to accelerate this process, their performance remains limited, primarily due to challenges in accurately understanding reviewers’ intents. This paper proposes an intention-based code refinement technique that enhances the conventional comment-to-code process by explicitly extracting reviewer intentions from the comments. Our approach consists of two key phases: Intention Extraction and Intention Guided Revision Generation. Intention Extraction categorizes comments using predefined templates, while Intention Guided Revision Generation employs large language models (LLMs) to generate revised code based on these defined intentions. Three categories with eight subcategories are designed for comment transformation, which is followed by a hybrid approach that combines rule-based and LLM-based classifiers for accurate classification. Extensive experiments with five LLMs (GPT4o, GPT3.5, DeepSeekV2, DeepSeek7B, CodeQwen7B) under different prompting settings demonstrate that our approach achieves 79% accuracy in intention extraction and up to 66% in code refinement generation. Our results highlight the potential of our approach in enhancing data quality and improving the efficiency of code refinement.
Keywords
code refinement, intention-based generation, large language model
Discipline
Programming Languages and Compilers | Software Engineering
Research Areas
Intelligent Systems and Optimization
Areas of Excellence
Digital transformation
Publication
Proceedings of the ICSE 2025 47th International Conference on Software Engineering, Ontario, Canada, April 27 - May 3
First Page
1
Last Page
13
City or Country
Ottawa, ON, Canada
Citation
GUO, Qi; XIE, Xiaofei; LIU, Shangqing; HU, Ming; LI, Xiaohong; and BU, Lei.
Intention is all you need: Refining your code from your intention. (2025). Proceedings of the ICSE 2025 47th International Conference on Software Engineering, Ontario, Canada, April 27 - May 3. 1-13.
Available at: https://ink.library.smu.edu.sg/sis_research/10303
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-No Derivative Works 4.0 International License.