7 research outputs found

    Model refactoring by example: A multi‐objective search based software engineering approach

    Full text link
    Declarative rules are frequently used in model refactoring in order to detect refactoring opportunities and to apply the appropriate ones. However, a large number of rules is required to obtain a complete specification of refactoring opportunities. Companies usually have accumulated examples of refactorings from past maintenance experiences. Based on these observations, we consider the model refactoring problem as a multi objective problem by suggesting refactoring sequences that aim to maximize both structural and textual similarity between a given model (the model to be refactored) and a set of poorly designed models in the base of examples (models that have undergone some refactorings) and minimize the structural similarity between a given model and a set of well‐designed models in the base of examples (models that do not need any refactoring). To this end, we use the Non‐dominated Sorting Genetic Algorithm (NSGA‐II) to find a set of representative Pareto optimal solutions that present the best trade‐off between structural and textual similarities of models. The validation results, based on 8 real world models taken from open‐source projects, confirm the effectiveness of our approach, yielding refactoring recommendations with an average correctness of over 80%. In addition, our approach outperforms 5 of the state‐of‐the‐art refactoring approaches.Peer Reviewedhttps://deepblue.lib.umich.edu/bitstream/2027.42/143783/1/smr1916.pdfhttps://deepblue.lib.umich.edu/bitstream/2027.42/143783/2/smr1916_am.pd

    Model-based source code refactoring with interaction and visual cues

    Get PDF
    Refactoring source code involves the developer in a myriad of program detail that can obscure the design changes that they actually wish to bring about. On the other hand, refactoring a UML model of the code makes it easier to focus on the program design, but the burdensome task of applying the refactorings to the source code is left to the developer. In an attempt to obtain the advantages of both approaches, we propose a refactoring approach where the interaction with the developer takes place at the model level, but the actual refactoring occurs on the source code itself. We call this approach model-based source code refactoring and implement it in this paper using two tools: (1) Design-Imp enables the developer to use interactive search-based design exploration to create a UML-based desired design from an initial design extracted from the source code. It also provides visual cues to improve developer comprehension during the design-level refactoring process and to help the developer to discern between promising and poor refactoring solutions. (2) Code-Imp then refactors the original source so that it has the same functional behavior as the original program, and a design close to the one produced in the design exploration phase, that is, a design that has been confirmed as “desirable” by the developer. We evaluated our approach involving interaction and visual cues with industrial developers refactoring three Java projects, comparing it with an approach using interaction without visual cues and a fully automated approach. The results show that our approach yields refactoring sequences that are more acceptable both to the individual developer and to a set of independent expert refactoring evaluators. Furthermore, our approach removed more code smells and was evaluated very positively by the experiment participants.</p

    Example-based model refactoring using heuristic search

    Get PDF
    Software maintenance is considered the most expensive activity in software systems development: more than 80% of the resources are devoted to it. During the maintenance activities, software models are very rarely taken into account. The evolution of these models and the transformations that manipulate them are at the heart of model-driven engineering (MDE). However, as the source code, the model changes and tends to become increasingly complex. These changes generally have a negative impact on the quality of models and they cause damage to the software. In this context, refactoring is the most used technique to maintain an adequate quality of these models. The refactoring process is usually done in two steps: the detection of elements of the model to correct (design defects), then the correction of these elements. In this thesis, we propose two main contributions related to detection and correction of defects in class diagrams. The first contribution aims to automate the design defect detection. We propose to adapt genetic algorithms (e.g., genetic programming) to detect parts of the model that may correspond to design defects. The second contribution concerns the automation of the correction of these design defects. We propose to adapt three heuristic methods to suggest refactorings: 1. A single-objective optimization method based on structural similarities between a given model (i.e., the model to be refactored) and a set of examples of models (i.e., models that have undergone some refactorings); 2. An interactive single-objective optimization method based on structural similarity and the opinion of the designer; and 3. A multi-objective optimization method that maximizes both the structural and semantic similarities between the model under study and the models in the set of examples. All the proposed methods were implemented and evaluated on models generated from existing open-source projects and the obtained results confirm their efficiency

    Handling High-Level Model Changes Using Search Based Software Engineering

    Full text link
    Model-Driven Engineering (MDE) considers models as first-class artifacts during the software lifecycle. The number of available tools, techniques, and approaches for MDE is increasing as its use gains traction in driving quality, and controlling cost in evolution of large software systems. Software models, defined as code abstractions, are iteratively refined, restructured, and evolved. This is due to many reasons such as fixing defects in design, reflecting changes in requirements, and modifying a design to enhance existing features. In this work, we focus on four main problems related to the evolution of software models: 1) the detection of applied model changes, 2) merging parallel evolved models, 3) detection of design defects in merged model, and 4) the recommendation of new changes to fix defects in software models. Regarding the first contribution, a-posteriori multi-objective change detection approach has been proposed for evolved models. The changes are expressed in terms of atomic and composite refactoring operations. The majority of existing approaches detects atomic changes but do not adequately address composite changes which mask atomic operations in intermediate models. For the second contribution, several approaches exist to construct a merged model by incorporating all non-conflicting operations of evolved models. Conflicts arise when the application of one operation disables the applicability of another one. The essence of the problem is to identify and prioritize conflicting operations based on importance and context – a gap in existing approaches. This work proposes a multi-objective formulation of model merging that aims to maximize the number of successfully applied merged operations. For the third and fourth contributions, the majority of existing works focuses on refactoring at source code level, and does not exploit the benefits of software design optimization at model level. However, refactoring at model level is inherently more challenging due to difficulty in assessing the potential impact on structural and behavioral features of the software system. This requires analysis of class and activity diagrams to appraise the overall system quality, feasibility, and inter-diagram consistency. This work focuses on designing, implementing, and evaluating a multi-objective refactoring framework for detection and fixing of design defects in software models.Ph.D.Information Systems Engineering, College of Engineering and Computer ScienceUniversity of Michigan-Dearbornhttp://deepblue.lib.umich.edu/bitstream/2027.42/136077/1/Usman Mansoor Final.pdfDescription of Usman Mansoor Final.pdf : Dissertatio

    Otimização para reduzir o tamanho de código-fonte JavaScript

    Get PDF
    JavaScript is one of the most used programming languages for front-end development of Web application. The increase in complexity of front-end features brings concerns about performance, especially the load and execution time of JavaScript code. To reduce the size of JavaScript programs and, therefore, the time required to load and execute these programs in the front-end of Web applications. To characterize the variants of JavaScript programs and use this information to build a search procedure that scans such variants for smaller implementations that pass all test cases. We applied this procedure to 19 JavaScript programs varying from 92 to 15,602 LOC and observed reductions from 0.2% to 73.8% of the original code, as well as a relationship between the quality of a program’s test suite and the ability to reduce its size.Esta Tese aborda o problema de otimização de tempo de carga de software, especificamente software escrito na linguagem de programação JavaScript, uma linguagem interpretada, baseada em objetos e amplamente utilizada no desenvolvimento de aplicativos e sistemas para a internet. Estudos experimentais foram projetados para avaliar a hipótese de que técnicas heurísticas já aplicadas com sucesso em linguagens orientadas a objeto poderiam ter resultados positivos na redução do tempo de carga de programas escritos em JavaScript. Para tanto, um ferramental que permitisse observar a aplicação de heurísticas selecionadas em programas JavaScript foi construído e executado em um ambiente de computação de alto desempenho. Os resultados dos estudos preliminares foram utilizados para criar um procedimento de busca que varre o código JavaScript criando variantes do programa que sejam menores e passem em todos os casos de teste do programa original. Aplicamos este procedimento a 19 programas JavaScript, variando de 92 a 15.602 linhas de código, e observamos reduções de 0,2% a 73,8% do código original, bem como uma relação entre a qualidade do conjunto de casos de testes e a capacidade de reduzir o tamanho dos programas
    corecore