Refactoring Detection in C++ Programs with RefactoringMiner++

📅 2025-02-24
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
The absence of publicly available, effective automated refactoring detection tools for C++ hinders code review efforts, making it difficult to distinguish behavior-preserving refactorings from functional changes. Method: This paper introduces the first open-source refactoring detection tool specifically designed for C++. Built upon the RefactoringMiner 3 framework, it leverages the Clang parser to construct high-fidelity abstract syntax trees (ASTs) and integrates AST differencing with domain-specific rule matching to accurately handle C++’s complex syntactic and semantic features. Contribution/Results: Evaluated on a seed dataset, the tool correctly identifies multiple canonical C++ refactorings. Empirical evaluation demonstrates that it achieves recall, precision, and runtime performance comparable to the Java version of RefactoringMiner, thereby bridging a critical gap in refactoring detection tooling for mainstream programming languages.

Technology Category

Application Category

📝 Abstract
Commits often involve refactorings -- behavior-preserving code modifications aiming at software design improvements. Refactoring operations pose a challenge to code reviewers, as distinguishing them from behavior-altering changes is often not a trivial task. Accordingly, research on automated refactoring detection tools has flourished over the past two decades, however, the majority of suggested tools is limited to Java projects. In this work, we present RefactoringMiner++, a refactoring detection tool based on the current state of the art: RefactoringMiner 3. While the latter focuses exclusively on Java, our tool is -- to the best of our knowledge -- the first publicly available refactoring detection tool for C++ projects. RefactoringMiner's thorough evaluation provides confidence in our tool's performance. In addition, we test RefactoringMiner++ on a small seeded dataset and demonstrate the tool's capability in a short demo involving both refactorings and behavior-altering changes. A screencast demonstrating our tool can be found at https://cloud.tugraz.at/index.php/s/oCzmjfFSaBxNZoe.
Problem

Research questions and friction points this paper is trying to address.

Automated refactoring detection in C++
Distinguishing refactorings from behavior-altering changes
First publicly available C++ refactoring detection tool
Innovation

Methods, ideas, or system contributions that make the work stand out.

RefactoringMiner++ detects C++ refactorings
First public tool for C++ refactoring detection
Based on state-of-the-art RefactoringMiner 3
B
Benjamin Ritz
Graz University of Technology, Graz, Austria
A
Aleksandar Karakavs
Carinthia University of Applied Sciences, Villach, Austria
Denis Helic
Denis Helic
Graz University of Technology
Data ScienceWeb ScienceInformation Networks