Skip to main content
Journal of Computer LanguagesVolume 80, August 2024, Article number 101273

A new architecture reconciling refactorings and transformations(Article)

  Save all to author list
  • aUniversity of Novi Sad, Faculty of Technical Sciences, Trg Dositeja Obradovića 6, Novi Sad, 21102, Serbia
  • bUniversity Lille, Inria, CNRS, Centrale Lille, UMR 9189 - CRIStAL, Lille, F-59000, France

Abstract

Refactorings are behavior-preserving code transformations. They are a recommended software development practice and are now a standard feature in modern IDEs. There are however many situations where developers need to perform mere transformations (non-behavior-preserving) or to mix refactorings and transformations. Little work exists on the analysis of transformations implementation, how refactorings could be composed of smaller, reusable, parts (simple transformations or other refactorings), and, conversely, how transformations could be reused in isolation or to compose new refactorings. In a previous article, we started to analyze the seminal implementation of refactorings as proposed in the Ph.D. of D. Roberts, and whose evolution is available in the Pharo IDE. We identified a dichotomy between the class hierarchy of refactorings (56 classes) and that of transformations (70 classes). We also noted that there are different kinds of preconditions for different purposes (applicability preconditions or behavior-preserving preconditions). In this article, we go further by proposing a new architecture that: (i) supports two important scenarios (interactive use or scripting, i.e., batch use); (ii) defines a clear API unifying refactorings and transformations; (iii) expresses refactorings as decorators over transformations, and; (iv) formalizes the uses of the different kinds of preconditions, thus supporting better user feedback. We are in the process of migrating the existing Pharo refactorings to this new architecture. Current results show that elementary transformations such as the ADD METHOD transformation is reused in 24 refactorings and 11 other transformations; and the REMOVE METHOD transformation is reused in 11 refactorings and 7 other transformations. © 2024 Elsevier Ltd

Author keywords

Behavior preservationPreconditionsRefactoringsSource code transformationTransformations

Indexed keywords

Engineering controlled terms:Software design
Engineering uncontrolled termsBehavior preservationClass hierarchiesCode transformationPreconditionRefactoringsRobertsSimple++Software development practicesSource code transformationTransformation
Engineering main heading:Cosine transforms

Funding details

Funding sponsor Funding number Acronym
European Commission
See opportunities by EC
EC
European Cooperation in Science and TechnologyCOST
451-03-65/2024-03/200156
01-3394/1
  • 1

    This work was partially supported by COST Action CA19135 CERCIRAS: Connecting Education and Research Communities for an Innovative Resource Aware Society funded by the European Union through the COST Association. We want to thank the anonymous reviewers of the early version of the article as well as the constant support from the Pharo industrial consortium http://consortium.pharo.org. This research has been supported by the Ministry of Science, Technological Development and Innovation (Contract No. 451-03-65/2024-03/200156) and the Faculty of Technical Sciences, University of Novi Sad through project \u201CScientific and Artistic Research Work of Researchers in Teaching and Associate Positions at the Faculty of Technical Sciences, University of Novi Sad\u201D (No. 01-3394/1).

  • ISSN: 26659182
  • Source Type: Journal
  • Original language: English
  • DOI: 10.1016/j.cola.2024.101273
  • Document Type: Article
  • Publisher: Elsevier Ltd

  Šarenac, B.; University of Novi Sad, Faculty of Technical Sciences, Trg Dositeja Obradovića 6, Novi Sad, Serbia;
© Copyright 2024 Elsevier B.V., All rights reserved.

Cited by 1 document

Šarenac, B. , Ducasse, S. , Polito, G.
Modular and Extensible Extract Method
(2024) CEUR Workshop Proceedings
View details of this citation
{"topic":{"name":"Refactoring; Computer Software Selection and Evaluation; Open Source Software","id":5965,"uri":"Topic/5965","prominencePercentile":94.68596,"prominencePercentileString":"94.686","overallScholarlyOutput":0},"dig":"f9e5b0fc58d85e58f59aa8b24e8bcd2e4426ce415ca3e7b5dbc81406a7a9cb46"}

SciVal Topic Prominence

Topic:
Prominence percentile: