You are required to read and agree to the below before accessing a full-text version of an article in the IDE article repository.

The full-text document you are about to access is subject to national and international copyright laws. In most cases (but not necessarily all) the consequence is that personal use is allowed given that the copyright owner is duly acknowledged and respected. All other use (typically) require an explicit permission (often in writing) by the copyright owner.

For the reports in this repository we specifically note that

  • the use of articles under IEEE copyright is governed by the IEEE copyright policy (available at http://www.ieee.org/web/publications/rights/copyrightpolicy.html)
  • the use of articles under ACM copyright is governed by the ACM copyright policy (available at http://www.acm.org/pubs/copyright_policy/)
  • technical reports and other articles issued by M‰lardalen University is free for personal use. For other use, the explicit consent of the authors is required
  • in other cases, please contact the copyright owner for detailed information

By accepting I agree to acknowledge and respect the rights of the copyright owner of the document I am about to access.

If you are in doubt, feel free to contact webmaster@ide.mdh.se

ROSE: Transformer-Based Refactoring Recommendation for Architectural Smells

Fulltext:


Authors:

Samal Nursapa , Anastassiya Samuilova , Alessio Bucaioni, Thanh Phuong Nguyen

Publication Type:

Conference/Workshop Paper

Venue:

the 19th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement.


Abstract

Architectural smells, design flaws such as God Class, Cyclic Dependency, and Hub-like Dependency, erode maintain- ability and often impair runtime behaviour. While existing detectors flag these issues, they rarely suggest how to remove them. We developed ROSE, a recommender system that turns smell reports into concrete refactoring advice by leveraging pre- trained code transformers. We frame remediation as a three-way classification task (Extract Method, Move Class, Pull Up Method) and fine-tune CodeBERT and CodeT5 on 2.1 million refactoring instances mined with RefactoringMiner from 11,149 open-source Java projects. Running with ten-fold cross-validation, CodeT5 gets 96.9% accuracy and a macro-F1 of 0.95, outperforming CodeBERT by 10 percentage points and all classical base- lines reported in the original dataset study. Confusion-matrix analysis shows that both models separate Pull Up Method well, whereas Extract Method remains challenging because of overlap with structurally similar changes. These findings provide the first empirical evidence that transformers can close the gap between architectural-smell detection and actionable repair. The study illustrates the promise, and current limits, of data- driven, architecture-level refactoring, laying the groundwork for richer recommender systems that cover a wider range of smells and languages. We release code, trained checkpoints, and the balanced dataset under an open licence to encourage replication.

Bibtex

@inproceedings{Nursapa7227,
author = {Samal Nursapa and Anastassiya Samuilova and Alessio Bucaioni and Thanh Phuong Nguyen},
title = {ROSE: Transformer-Based Refactoring Recommendation for Architectural Smells},
month = {September},
year = {2025},
booktitle = {the 19th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement.},
url = {http://www.es.mdu.se/publications/7227-}
}