Hui Liu
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
Hui Liu has a total of 172 co-authors. Here are the top co-authors by number of shared publications:
- Yuxia Zhang
Beijing Institute of Technology, Beijing, China
33 shared publications - Yanjie Jiang
Tianjin University, Tianjin, China
30 shared publications - Lu Zhang
Key Lab of HCST (PKU), MOE; SCS, Peking University, China
14 shared publications - Nan Niu
School of Computing, University of North Florida, Jacksonville, FL, USA
12 shared publications - Klaas-Jan Stol
University College Cork, Cork, Ireland
7 shared publications - Yanjie Jiang
School of Computer Science, Peking University, Beijing, China
6 shared publications
Latest Publications
- Open Access
- 3 October 2026
- Published by Association for Computing Machinery (ACM) in ACM Computing Surveys
A Survey of Deep Learning Based Software Refactoring
Refactoring is a critical activity in software engineering used to improve software quality and maintainability. Increasingly, deep learning (DL) techniques are being applied to software refactoring to overcome the limitations of traditional, manually designed heuristics. However, there is a lack of comprehensive surveys and structured taxonomies characterizing these deep learning-based approaches. To fill this gap, we present a survey that categorizes deep learning-based software refactoring into five core tasks: code smell detection, refactoring recommendation, refactoring implementation, refactoring mining, and refactoring impact analysis. Our analysis reveals an imbalance in research distribution. The field is concentrated on the early decision-making stages, with code smell detection ( \(43.84\% \) ) and refactoring recommendation ( \(32.88\% \) ) comprising more than three-quarters of the literature. Conversely, refactoring implementation ( \(12.33\% \) ) and mining ( \(8.22\% \) ) show emergent tracking, while refactoring impact analysis remains under-explored ( \(2.74\% \) ). Beyond this taxonomy, the survey highlights critical gaps, including a notable absence of research on quality assurance for DL-based refactoring and minimal attention given to class- and variable-level operations. Finally, we map out open challenges and future directions to guide researchers toward building more comprehensive, end-to-end automated refactoring pipelines.- 3 October 2026
- Published by Association for Computing Machinery (ACM) in ACM Computing Surveys
Open AccessA Survey of Deep Learning Based Software Refactoring
Refactoring is a critical activity in software engineering used to improve software quality and maintainability. Increasingly, deep learning (DL) techniques are being applied to software refactoring to overcome the limitations of traditional, manually designed heuristics. However, there is a lack of comprehensive surveys and structured taxonomies characterizing these deep learning-based approaches. To fill this gap, we present a survey that categorizes deep learning-based software refactoring into five core tasks: code smell detection, refactoring recommendation, refactoring implementation, refactoring mining, and refactoring impact analysis. Our analysis reveals an imbalance in research distribution. The field is concentrated on the early decision-making stages, with code smell detection ( \(43.84\% \) ) and refactoring recommendation ( \(32.88\% \) ) comprising more than three-quarters of the literature. Conversely, refactoring implementation ( \(12.33\% \) ) and mining ( \(8.22\% \) ) show emergent tracking, while refactoring impact analysis remains under-explored ( \(2.74\% \) ). Beyond this taxonomy, the survey highlights critical gaps, including a notable absence of research on quality assurance for DL-based refactoring and minimal attention given to class- and variable-level operations. Finally, we map out open challenges and future directions to guide researchers toward building more comprehensive, end-to-end automated refactoring pipelines. - Open Access
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 2727-2749
From Custom Logic to APIs: Understanding and Recommending API Replacement Refactorings
Software refactoring is essential for maintaining code quality. However, API replacement refactoring, which replaces custom logic with API calls, remains underexplored. Existing refactoring tools provide limited support for detecting such opportunities because they rely on predefined templates and have difficulty capturing complex, multi-statement semantic equivalents. To address this limitation, we conduct the first empirical study of API replacement refactorings by mining 166,299 commits across six open-source Java projects and manually analyzing a curated subset of 1,800 commits, from which we identify 366 validated instances to characterize their scope, categories, and recurring patterns. Based on these insights, we propose AKIRA (Adaptive Knowledge Discovery and Retrieval), a hybrid framework that integrates pattern-deterministic heuristics with a refactoring-aware knowledge base to assess the practical feasibility of recommending API replacement refactorings. Our evaluation shows that AKIRA achieves 90% recall and 88% precision on a manually curated dataset. Furthermore, on the external RETIWA dataset, AKIRA significantly improves the state of the art by increasing recall from 21% to 81% and precision from 40% to 78%. These results demonstrate the effectiveness of combining static pattern matching with semantic reasoning to support the automation of recommending complex API replacement refactorings.
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 2727-2749
Open AccessFrom Custom Logic to APIs: Understanding and Recommending API Replacement Refactorings
Software refactoring is essential for maintaining code quality. However, API replacement refactoring, which replaces custom logic with API calls, remains underexplored. Existing refactoring tools provide limited support for detecting such opportunities because they rely on predefined templates and have difficulty capturing complex, multi-statement semantic equivalents. To address this limitation, we conduct the first empirical study of API replacement refactorings by mining 166,299 commits across six open-source Java projects and manually analyzing a curated subset of 1,800 commits, from which we identify 366 validated instances to characterize their scope, categories, and recurring patterns. Based on these insights, we propose AKIRA (Adaptive Knowledge Discovery and Retrieval), a hybrid framework that integrates pattern-deterministic heuristics with a refactoring-aware knowledge base to assess the practical feasibility of recommending API replacement refactorings. Our evaluation shows that AKIRA achieves 90% recall and 88% precision on a manually curated dataset. Furthermore, on the external RETIWA dataset, AKIRA significantly improves the state of the art by increasing recall from 21% to 81% and precision from 40% to 78%. These results demonstrate the effectiveness of combining static pattern matching with semantic reasoning to support the automation of recommending complex API replacement refactorings.
- Open Access
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 4629-4652
Empowering Lightweight Language Models for Security Code Review via Context-Aware Distillation
Security code review, which specifically examines software from a security perspective, is indispensable for preempting vulnerabilities and bolstering software reliability. However, existing automated approaches face a dilemma. They either rely on large language models with prohibitive deployment costs, or employ lightweight models that struggle with complex reasoning and global contextual understanding. In this paper, we propose LSCR, a context-aware distillation approach that empowers lightweight language models for security code review by distilling static-analysis–style security rationale from powerful teacher models. Rather than directly transferring final review outputs, LSCR guides student models to internalize how high-level security judgments are systematically derived from low-level code evidence, leveraging repository-level context during training. By embedding this evidence-driven analysis paradigm into lightweight models, LSCR enables more reliable security code reviews under constrained model capacity. When compared with competitive lightweight baselines, LSCR attains an average improvement of over 12% in security issue classification accuracy and more than 13.3% gains in BLEU score for review generation. Human evaluation reveals that LSCR increases the proportion of instrumental reviews by 52.6% on average over state-of-the-art baselines, while reducing misleading feedback by 22.6%. LSCR effectively narrows the performance gap between small-scale and large-scale models, making on-premise security code review more feasible in practice.
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 4629-4652
Open AccessEmpowering Lightweight Language Models for Security Code Review via Context-Aware Distillation
Security code review, which specifically examines software from a security perspective, is indispensable for preempting vulnerabilities and bolstering software reliability. However, existing automated approaches face a dilemma. They either rely on large language models with prohibitive deployment costs, or employ lightweight models that struggle with complex reasoning and global contextual understanding. In this paper, we propose LSCR, a context-aware distillation approach that empowers lightweight language models for security code review by distilling static-analysis–style security rationale from powerful teacher models. Rather than directly transferring final review outputs, LSCR guides student models to internalize how high-level security judgments are systematically derived from low-level code evidence, leveraging repository-level context during training. By embedding this evidence-driven analysis paradigm into lightweight models, LSCR enables more reliable security code reviews under constrained model capacity. When compared with competitive lightweight baselines, LSCR attains an average improvement of over 12% in security issue classification accuracy and more than 13.3% gains in BLEU score for review generation. Human evaluation reveals that LSCR increases the proportion of instrumental reviews by 52.6% on average over state-of-the-art baselines, while reducing misleading feedback by 22.6%. LSCR effectively narrows the performance gap between small-scale and large-scale models, making on-premise security code review more feasible in practice.
- Open Access
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 3891-3910
Testing Method Relocation Algorithms via Template-Based Systematic Structural Traversal and Precondition Filtering
Method relocation refactorings, primarily Move Method and Pull Up/Push Down Method, are indispensable for reducing coupling and enhancing cohesion. Despite their widespread automation in modern refactoring engines, these algorithms remain notoriously error-prone, posing significant risks to software reliability. A primary challenge in testing them lies in the vast search space of complex program structures and the intricate preconditions required for safe method relocation. To address this, we propose RelocTest, a comprehensive testing framework that combines template-driven structural traversal with automated precondition filtering. RelocTest systematically explores the input space by populating program templates specially designed for method relocation through a two-stage generation process: (1) Skeleton Synthesis, which systematically traverses diverse syntactic structures, and (2) LLM-Guided Completion, which leverages Large Language Models to inject diverse, executable code into these skeletons. This hybrid strategy ensures high structural coverage while maintaining test program validity. Furthermore, to optimize testing efficiency, we introduce an LLM-based Precondition Extractor that analyzes the implementation of method relocation algorithms to identify and prune test programs destined for rejection. We evaluated RelocTest on 7 mainstream refactoring engines. Our approach successfully uncovered 56 previously unknown bugs, with 19 already confirmed by tool vendors, demonstrating its effectiveness in hardening industrial-strength refactoring tools.
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 3891-3910
Open AccessTesting Method Relocation Algorithms via Template-Based Systematic Structural Traversal and Precondition Filtering
Method relocation refactorings, primarily Move Method and Pull Up/Push Down Method, are indispensable for reducing coupling and enhancing cohesion. Despite their widespread automation in modern refactoring engines, these algorithms remain notoriously error-prone, posing significant risks to software reliability. A primary challenge in testing them lies in the vast search space of complex program structures and the intricate preconditions required for safe method relocation. To address this, we propose RelocTest, a comprehensive testing framework that combines template-driven structural traversal with automated precondition filtering. RelocTest systematically explores the input space by populating program templates specially designed for method relocation through a two-stage generation process: (1) Skeleton Synthesis, which systematically traverses diverse syntactic structures, and (2) LLM-Guided Completion, which leverages Large Language Models to inject diverse, executable code into these skeletons. This hybrid strategy ensures high structural coverage while maintaining test program validity. Furthermore, to optimize testing efficiency, we introduce an LLM-based Precondition Extractor that analyzes the implementation of method relocation algorithms to identify and prune test programs destined for rejection. We evaluated RelocTest on 7 mainstream refactoring engines. Our approach successfully uncovered 56 previously unknown bugs, with 19 already confirmed by tool vendors, demonstrating its effectiveness in hardening industrial-strength refactoring tools.
- Open Access
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 3569-3590
Enhancing LLM-Based Bug Reproduction via Code Entity Retrieval and Test Case Repair
Automated bug reproduction from bug reports is a critical yet challenging step in software debugging. While LLM-based bug reproduction shows promise, its effectiveness is often hampered by insufficient contextual awareness of the relevant codebase and a tendency to produce invalid test cases. To address these limitations, we propose a novel approach, called LTER, that enhances LLM-based bug reproduction through fine-grained code entity retrieval and a feedback-driven dynamic repair loop. LTER first identifies specific code entities within bug reports to automatically extract precise contexts, including class definitions, constructors, and method logic. The extracted contexts are then used to guide the LLM in generating reproduced test cases. To further ensure executability, LTER employs an iterative repair mechanism to resolve complex dependencies. Specifically, upon injecting a generated test case into the project, if a compilation failure occurs, the framework forwards the error messages to the LLM for an initial repair. Should this initial repair fail, it empowers the LLM to analyze diagnostic messages to recognize missing context and retrieve indispensable dependencies, subsequently regenerating the test case with the supplemented data. Finally, LTER employs a hybrid cascade ranking strategy to accurately select the most effective reproduction test case from the generated candidates. The experimental results on the widely-used Defects4J benchmark show that LTER substantially outperforms the best performance in automated bug reproduction, increasing the reproduction success rate to 46.2% with successfully identifying a valid reproduction test as the top candidate in 38.1% of the cases. Furthermore, LTER demonstrates strong generalization capability, delivering robust performance on the GHRB dataset containing recent bugs previously unseen by the LLM.
- 1 October 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (ISSTA) , 3569-3590
Open AccessEnhancing LLM-Based Bug Reproduction via Code Entity Retrieval and Test Case Repair
Automated bug reproduction from bug reports is a critical yet challenging step in software debugging. While LLM-based bug reproduction shows promise, its effectiveness is often hampered by insufficient contextual awareness of the relevant codebase and a tendency to produce invalid test cases. To address these limitations, we propose a novel approach, called LTER, that enhances LLM-based bug reproduction through fine-grained code entity retrieval and a feedback-driven dynamic repair loop. LTER first identifies specific code entities within bug reports to automatically extract precise contexts, including class definitions, constructors, and method logic. The extracted contexts are then used to guide the LLM in generating reproduced test cases. To further ensure executability, LTER employs an iterative repair mechanism to resolve complex dependencies. Specifically, upon injecting a generated test case into the project, if a compilation failure occurs, the framework forwards the error messages to the LLM for an initial repair. Should this initial repair fail, it empowers the LLM to analyze diagnostic messages to recognize missing context and retrieve indispensable dependencies, subsequently regenerating the test case with the supplemented data. Finally, LTER employs a hybrid cascade ranking strategy to accurately select the most effective reproduction test case from the generated candidates. The experimental results on the widely-used Defects4J benchmark show that LTER substantially outperforms the best performance in automated bug reproduction, increasing the reproduction success rate to 46.2% with successfully identifying a valid reproduction test as the top candidate in 38.1% of the cases. Furthermore, LTER demonstrates strong generalization capability, delivering robust performance on the GHRB dataset containing recent bugs previously unseen by the LLM.
- Open Access
- 18 July 2026
- Published by Association for Computing Machinery (ACM)
- p. 452-462
Securing the OpenHarmony Software Supply Chain: LLM-Based Malicious Code Detection for ArkTS
- 18 July 2026
- Published by Association for Computing Machinery (ACM)
- p. 452-462
Open AccessSecuring the OpenHarmony Software Supply Chain: LLM-Based Malicious Code Detection for ArkTS
- Open Access
- 30 June 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (FSE) , 3253-3274
Cross-Refactoring-Type Test Program Migration for Refactoring Engines
Refactoring engines are an essential part of modern IDEs, supporting automated or semi-automated software refactorings. However, these refactoring engines suffer from software bugs, just like other complex software systems, and buggy refactoring engines may silently inject fatal errors into software projects. Consequently, thorough testing of refactoring engines is highly desirable. To this end, this paper proposes an automated approach called EngineTest to test refactoring engines. Unlike existing approaches, it is the first in this line to leverage both LLMs and bug reports of refactoring types other than the targeted refactoring type. The key rationale is that the same mistake, e.g., ignoring the potential name shadowing, may result in similar errors in multiple refactoring types.Consequently, we may retrieve a bug report for a refactoring type and carefully construct a few-shot example as input, guiding LLMs to migrate it into test programs for exercising other refactoring types.Finally, we run the test cases and validate them with differential testing and LLM-based inconsistent checking. We evaluate the proposed approach with widely used state-of-the-practice refactoring engines in Eclipse, NetBeans, and IntelliJ IDEA. Our evaluation results demonstrate that a total of 85 previously unknown bugs (including Java, C/C++, and Python) have been identified, and 30 of them have been manually confirmed by the tool vendors.
- 30 June 2026
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 3 (FSE) , 3253-3274
Open AccessCross-Refactoring-Type Test Program Migration for Refactoring Engines
Refactoring engines are an essential part of modern IDEs, supporting automated or semi-automated software refactorings. However, these refactoring engines suffer from software bugs, just like other complex software systems, and buggy refactoring engines may silently inject fatal errors into software projects. Consequently, thorough testing of refactoring engines is highly desirable. To this end, this paper proposes an automated approach called EngineTest to test refactoring engines. Unlike existing approaches, it is the first in this line to leverage both LLMs and bug reports of refactoring types other than the targeted refactoring type. The key rationale is that the same mistake, e.g., ignoring the potential name shadowing, may result in similar errors in multiple refactoring types.Consequently, we may retrieve a bug report for a refactoring type and carefully construct a few-shot example as input, guiding LLMs to migrate it into test programs for exercising other refactoring types.Finally, we run the test cases and validate them with differential testing and LLM-based inconsistent checking. We evaluate the proposed approach with widely used state-of-the-practice refactoring engines in Eclipse, NetBeans, and IntelliJ IDEA. Our evaluation results demonstrate that a total of 85 previously unknown bugs (including Java, C/C++, and Python) have been identified, and 30 of them have been manually confirmed by the tool vendors.
- Open Access
- 24 April 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (5) , 1-26
Detecting Outdated Screenshot from GUI Document
In software development, many documents (e.g., tutorials for tools and mobile application websites) contain screenshots of GUIs to illustrate functionalities. Although screenshots are critical in such documents, screenshots can become outdated, especially if document developers forget to update them. Outdated screenshots can mislead users and diminish the credibility of documentation. Identifying screenshots manually is tedious and error-prone, especially when documents are numerous. However, no existing tools are proposed to detect outdated screenshots in GUI documents. To mitigate manual efforts, we propose DOSUD , a novel approach for detecting outdated screenshots. It is challenging to identify outdated screenshots since the differences are subtle and only specific areas are useful to identify such screenshots. To address the challenges, DOSUD automatically extracts and labels screenshots and trains a classification model to identify outdated screenshots. As the first exploration, we focus on Android applications and the most popular IDE, VS Code. We evaluated DOSUD on a benchmark comprising 10 popular applications, achieving high F1-scores. When applied in the wild, DOSUD identified 20 outdated screenshots across 50 Android application websites and 17 outdated screenshots in VS Code documentation. VS Code developers have confirmed and fixed all our bug reports.
- 24 April 2026
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (5) , 1-26
Open AccessDetecting Outdated Screenshot from GUI Document
In software development, many documents (e.g., tutorials for tools and mobile application websites) contain screenshots of GUIs to illustrate functionalities. Although screenshots are critical in such documents, screenshots can become outdated, especially if document developers forget to update them. Outdated screenshots can mislead users and diminish the credibility of documentation. Identifying screenshots manually is tedious and error-prone, especially when documents are numerous. However, no existing tools are proposed to detect outdated screenshots in GUI documents. To mitigate manual efforts, we propose DOSUD , a novel approach for detecting outdated screenshots. It is challenging to identify outdated screenshots since the differences are subtle and only specific areas are useful to identify such screenshots. To address the challenges, DOSUD automatically extracts and labels screenshots and trains a classification model to identify outdated screenshots. As the first exploration, we focus on Android applications and the most popular IDE, VS Code. We evaluated DOSUD on a benchmark comprising 10 popular applications, achieving high F1-scores. When applied in the wild, DOSUD identified 20 outdated screenshots across 50 Android application websites and 17 outdated screenshots in VS Code documentation. VS Code developers have confirmed and fixed all our bug reports.
- Open Access
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 362-373
Evaluating Generated Commit Messages with Large Language Models
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 362-373
Open AccessEvaluating Generated Commit Messages with Large Language Models
- Open Access
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 2186-2197
SeRe: A Security-Related Code Review Dataset Aligned with Real-World Review Activities
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 2186-2197
Open AccessSeRe: A Security-Related Code Review Dataset Aligned with Real-World Review Activities