Metamodel Refactoring using Constraint Solving: a Quality-based Perspective

The design of metamodels is a main task in model-driven engineering where modellers need to consider many quality factors. However, metamodels are subject to many changes during the software life cycle due to the evolution of requirements or for maintenance purposes. These changes may harm their quality by introducing bad smells that make the metamodels more complex and less understandable. Refactoring metamodels by removing bad smells is not an easy task due to their size, the need to achieve high standards of conflicting quality factors, and the many possible refactoring solutions. We propose a quality-driven approach to refactoring metamodels using constraint solving. We encode both the removal of bad smells and the quality criteria as a set of constraints. Then, we use a constraint solver to find a sequence of refactoring operations that satisfies both constraints. We illustrate the efficiency of our approach through a case study. The latter shows that the refactoring solution we obtain improves the time and correctness of performing understandability and extendibility tasks, as compared to other alternatives.