ABSTRACT
Model-driven engineering suggests that models are the primary artefacts of software development. This means that models may be refactored even after code has been generated from them, in which case the code must be changed to reflect the refactoring. However, as we show neither re-generating the code from the refactored model nor applying an equivalent refactoring to the generated code is sufficient to keep model and code in sync -- rather, model and code need to be refactored jointly. To enable this, we investigate the technical requirements of model/code corefactoring, and implement a model-driven solution that we evaluate using a set of open-source programs and their structural models. Results suggest that our approach is feasible.
- Acceleo Model-to-Text Transformation (www.eclipse.org/acceleo).Google Scholar
- L Angyal, L Lengyel, H Charaf "Novel techniques for model-code synchronization" ECEASST 8: ERCIM Symposium on Software Evolution (2007).Google Scholar
- EMF Metamodel (Ecore) www.eclipse.org/modeling/emf.Google Scholar
- J Estublier, T Leveque, G Vega "Evolution control in MDE projects: Controlling model and code co-evolution" in: Proc. of FSE (2010) 431-438. Google ScholarDigital Library
- M Fowler Refactoring: Improving the Design of Existing Code (Addison-Wesley 1999). Google ScholarDigital Library
- A Kiezun, V Ganesh, S Artzi, PJ Guo, P Hooimeijer, MD Ernst "HAMPI: A solver for word equations over strings, regular expressions, and context-free grammars" ACM Trans. Softw. Eng. Methodol. 21(4): 25 (2012). Google ScholarDigital Library
- MDT/UML2 (www.eclipse.org/uml2/)Google Scholar
- ER Murphy-Hill, C Parnin, AP Black "How we refactor, and how we know it" IEEE Trans. Software Eng. 38:1 (2012) 5-18. Google ScholarDigital Library
- OMG Meta Object Facility (MOF) 2.0 Query/View/Transformation Specification Version 1.1 (http://www.omg.org/spec/QVT/1.1).Google Scholar
- F Steimann, A Thies "From public to private to absent: Refactoring Java programs under constrained accessibility" in: Proc. of ECOOP (2009) 419-443. Google ScholarDigital Library
- F Steimann, C Kollee, J von Pilgrim "A refactoring constraint language and its application to Eiffel" in: Proc. of ECOOP (2011) 255-280. Google ScholarDigital Library
- F Steimann "Contraint-based model refactoring" in: Proc. of MODELS (2011) 440-454. Google ScholarDigital Library
- F Steimann, J von Pilgrim "Constraint-based refactoring with foresight" in: Proc. of ECOOP (2012) 535-559. Google ScholarDigital Library
- F Steimann, J von Pilgrim "Refactorings without names" in: Proc. of ASE (2012) 290-293. Google ScholarDigital Library
- G Sunyé, D Pollet, Y Le Traon, JM Jézéquel "Refactoring UML Models" in: Proc. of UML (2001) 134-148. Google ScholarDigital Library
- F Tip, A Kiezun, D Bäumer "Refactoring for generalization using type constraints" in: Proc. of OOPSLA (2003) 13-26. Google ScholarDigital Library
- F Tip, RM Fuhrer, A Kiezun, MD Ernst, I Balaban, B De Sutter "Refactoring using type constraints" ACM Trans. Program. Lang. Syst. 33(3):9 (2011). Google ScholarDigital Library
- J von Pilgrim Computerunterstützte Modelltransformationen Doctoral Dissertation (Fernuniversität in Hagen, 2011).Google Scholar
- S Winkler, J von Pilgrim "A survey of traceability in requirements engineering and model-driven development" Software and System Modeling 9:4 (2010) 529-565. Google ScholarDigital Library
Recommendations
Prioritising Refactoring Using Code Bad Smells
ICSTW '11: Proceedings of the 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation WorkshopsWe investigated the relationship between six of Fowler et al.'s Code Bad Smells (Duplicated Code, Data Clumps, Switch Statements, Speculative Generality, Message Chains, and Middle Man) and software faults. In this paper we discuss how our results can ...
The buggy side of code refactoring: understanding the relationship between refactorings and bugs
ICSE '18: Proceedings of the 40th International Conference on Software Engineering: Companion ProceeedingsCode refactoring is widely practiced by software developers. There is an explicit assumption that code refactoring improves the structural quality of a software project, thereby also reducing its bug proneness. However, refactoring is often applied with ...
An approach and tool for synchronous refactoring of UML diagrams and models using model-to-model transformations
WRT '12: Proceedings of the Fifth Workshop on Refactoring ToolsWhen refactorings are applied to software models that are specified using the Unified Modeling Language (UML), the actual model and the graphical presentation of the model using a diagram need to be distinguished. While UML refactoring tools exist, they ...
Comments