Skip to content
Book Open access

When Testing Meets Refactoring: Catalogue, Detection, and Recommendation

Jul 2026 · SIGSOFT FSE Companion · 0 citations · 29 references
Computer Science

TL;DR

This paper presents a unified catalogue of test refactoring patterns derived from a mixed-method approach involving repository mining, developer surveys, and analysis of StackOverflow discussions, to establish a rigorous benchmark for evaluating future automated recommendation systems, including those driven by Large Language Models.

Abstract

Automated software testing is critical for modern software development, yet test code itself requires maintenance and refactoring to prevent decay. While theoretical test-specific code smells are well-documented, the practical automation of test refactoring—both detection and recommendation—remains incipient, leading to fragmented knowledge and inadequate tooling. This paper bridges this gap by presenting a unified catalogue of test refactoring patterns derived from a mixed-method approach involving repository mining, developer surveys, and analysis of StackOverflow discussions. To operationalize this catalogue, we extend RefactoringMiner with test-aware detection capabilities and introduce PatternTracker, a tool for identifying and tracking the evolution of test patterns across version history. Leveraging this infrastructure, we analyzed 1.7 million Java projects to generate a high-confidence ground-truth dataset of test refactorings. Our results validate the prevalence of these patterns in open-source projects and establish a rigorous benchmark for evaluating future automated recommendation systems, including those driven by Large Language Models.

Read PDF

Similar papers

Review Open access 2019

ML-Enhanced Code Refactoring Recommendations for Improving Software Maintainability

Results show that ML-enhanced recommendations outperform traditional methods in accuracy, relevance, and impact on maintainability metrics, and highlight the potential of integrating ML into modern development practices to support developers in producing cleaner, more maintainable software systems.

Rohit Malhotra · 0 citations
Jul 2026

SemaDiff: Identifying Semantic-Changing Commits with Generated Code and Tests

SemaDiff, a novel approach for identifying semantic-preserving commits through behaviour-based analysis, is proposed, and results show that SemaDiff distinguishes accurately semantic-preserving from -- changing commits in about 76% of the cases, with a 100% precision in semantic-changing commit detection.

Maha Ayub, Michael Konstantinou, Ahmed Khanfir et al. · 0 citations
Review Aug 2026

Code Refinement with Repository Context: How Far are We?

A high-quality benchmark of 1,000 code refinement instances from 328 Python, Java, and JavaScript repositories that focused on one of the most challenging code refinement scenarios that strictly requires repository-level knowledge reasoning, and a straightforward method, RepoRefiner, which retrieves repository-level co...

Ke Wang, Peng Lan, Jia-Kun Liu et al. · 1 citation
Preprint Aug 2026

SmellCC: A Tool for Automated Code Smells Remediation

SmellCC, a Visual Studio Code extension that augments SonarQube with an LLM-based pipeline to automatically detect and refactor Python code smells, provides in-place, one-click remediation for the top-10 most frequent smells, effectively preventing the accumulation of technical debt during development.

Xiaoting Zhang, Yujie Zhang, Zhi-Peng Gao et al. · 0 citations
Open access Aug 2026

A mixed-method in-depth study of test-specific refactorings

This paper presents a comprehensive catalogue of 57 test-specific refactoring types, out of which only 33 were previously documented in the literature, using a mixed-method approach grounded on three sources of data.

V. Veloso, Nikolaos Tsantalis, Tse-Hsun Chen · 0 citations
Preprint Aug 2026

Detecting Behavioral Changes in Python Refactoring Implementations with Foundation Models

This work proposes an approach based on a foundation model oracle that analyzes git-style diffs to identify behavioral changes introduced by Python refactorings and uncovered 13 distinct bugs among the seven refactoring types studied.

Jonhnanthan Oliveira, Rohit Gheyi, Márcio Ribeiro et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.