mlsanityData to 14 Oct 2026

Evaluating the Effectiveness of Small Language Models in Detecting Refactoring Bugs

arXiv 2502.18454 ↗First posted 25 Feb 2025cs.SEcited by 1

Not on the map. Why?

Abstract (arXiv)

Popular IDEs frequently contain bugs in their refactoring implementations. Ensuring that a transformation preserves a program's behavior is a complex task. Traditional detection methods rely on predefined preconditions for each refactoring type, limiting their scalability and adaptability to new transformations. These methods often require extensive static and dynamic analyses, which are computationally expensive, time-consuming, and may still fail to detect certain refactoring bugs. This study evaluates the effectiveness of Small Language Models (SLMs) in detecting two types of refactoring bugs in Java and Python: (i) transformations that introduce errors or behavioral changes (Type I) and (ii) transformations unnecessarily blocked by IDEs despite being valid (Type II). We assess whether Llama 3.2 3B, Mistral 7B, Gemma 2 9B, Gemma 3 12B, DeepSeek-R1 14B, Phi-4 14B, o1-mini, and o3-mini-high can accurately detect 100 refactoring bugs reported in widely used Java and Python IDEs, such as Eclipse and NetBeans. The study covers 16 refactoring types and employs zero-shot prompting on consumer-grade hardware to evaluate the models' ability to reason about refactoring correctness without explicit prior training. The proprietary o3-mini-high model achieved the highest detection rate, identifying 84.3% of Type I bugs. The open-source Phi-4 14B performed comparably well, demonstrating strong effectiveness across both bug types. However, o3-mini-high struggled with Type II bugs, correctly identifying and applying valid but blocked transformations in only 40% of cases. The findings highlight the potential of SLMs for efficiently detecting refactoring bugs, particularly in verifying behavioral changes. Additionally, SLMs offer a more adaptable solution capable of generalizing across different refactoring types and programming languages, addressing key limitations of traditional approaches.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). First posted on arXiv 25 Feb 2025.

Builds on

No reference list yet.

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2025Testing Refactoring Engine via Historical Bug Report driven LLM
  2. 2024An Empirical Study on the Code Refactoring Capability of Large Language Models
  3. 2025LLM-Based Detection of Tangled Code Changes for Higher-Quality Method-Level Bug Datasets
  4. 2026RefactorAssist: Agentic Refinement for Reliable Code Refactoring
  5. 2025ActRef: Enhancing the Understanding of Python Code Refactoring with Action-Based Analysis
  6. 2026REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoring
  7. 2026If It's Not Buggy, Don't Fix It: On the Dynamics of Iterative Bug-fixing with LLMs
  8. 2025Are Sparse Autoencoders Useful for Java Function Bug Detection?