650 research outputs found

    Barriers to Refactoring: Issues and Solutions

    Get PDF
    Refactoring mechanism is commonly used in software development. Though Object oriented programming promotes ease in designing reusable software but the long coded methods makes it unreadable and enhances the complexity of the methods. The common code defects are associated with large classes and methods. To ease up the code comprehension Extract method, Extract class serves as a comfortable option to reduce the disorganization and duplication of the code to produce more fine grained methods and classes. Though refactoring serves as an important mechanism to improve the software quality whether performed manually or in an automated way with the help of tools or IDEs but there are umpteen cases where refactoring could lead to deterrent effect. This paper intends to explore the various problems and barriers associated with refactoring and specifically while extracting the code (extract method, extract class, extract interface) and their solutions

    A heuristic-based approach to code-smell detection

    Get PDF
    Encapsulation and data hiding are central tenets of the object oriented paradigm. Deciding what data and behaviour to form into a class and where to draw the line between its public and private details can make the difference between a class that is an understandable, flexible and reusable abstraction and one which is not. This decision is a difficult one and may easily result in poor encapsulation which can then have serious implications for a number of system qualities. It is often hard to identify such encapsulation problems within large software systems until they cause a maintenance problem (which is usually too late) and attempting to perform such analysis manually can also be tedious and error prone. Two of the common encapsulation problems that can arise as a consequence of this decomposition process are data classes and god classes. Typically, these two problems occur together – data classes are lacking in functionality that has typically been sucked into an over-complicated and domineering god class. This paper describes the architecture of a tool which automatically detects data and god classes that has been developed as a plug-in for the Eclipse IDE. The technique has been evaluated in a controlled study on two large open source systems which compare the tool results to similar work by Marinescu, who employs a metrics-based approach to detecting such features. The study provides some valuable insights into the strengths and weaknesses of the two approache

    Analysis of Software Binaries for Reengineering-Driven Product Line Architecture\^aAn Industrial Case Study

    Full text link
    This paper describes a method for the recovering of software architectures from a set of similar (but unrelated) software products in binary form. One intention is to drive refactoring into software product lines and combine architecture recovery with run time binary analysis and existing clustering methods. Using our runtime binary analysis, we create graphs that capture the dependencies between different software parts. These are clustered into smaller component graphs, that group software parts with high interactions into larger entities. The component graphs serve as a basis for further software product line work. In this paper, we concentrate on the analysis part of the method and the graph clustering. We apply the graph clustering method to a real application in the context of automation / robot configuration software tools.Comment: In Proceedings FMSPLE 2015, arXiv:1504.0301

    Behind the Intent of Extract Method Refactoring: A Systematic Literature Review

    Full text link
    Code refactoring is widely recognized as an essential software engineering practice to improve the understandability and maintainability of the source code. The Extract Method refactoring is considered as "Swiss army knife" of refactorings, as developers often apply it to improve their code quality. In recent years, several studies attempted to recommend Extract Method refactorings allowing the collection, analysis, and revelation of actionable data-driven insights about refactoring practices within software projects. In this paper, we aim at reviewing the current body of knowledge on existing Extract Method refactoring research and explore their limitations and potential improvement opportunities for future research efforts. Hence, researchers and practitioners begin to be aware of the state-of-the-art and identify new research opportunities in this context. We review the body of knowledge related to Extract Method refactoring in the form of a systematic literature review (SLR). After compiling an initial pool of 1,367 papers, we conducted a systematic selection and our final pool included 83 primary studies. We define three sets of research questions and systematically develop and refine a classification schema based on several criteria including their methodology, applicability, and degree of automation. The results construct a catalog of 83 Extract Method approaches indicating that several techniques have been proposed in the literature. Our results show that: (i) 38.6% of Extract Method refactoring studies primarily focus on addressing code clones; (ii) Several of the Extract Method tools incorporate the developer's involvement in the decision-making process when applying the method extraction, and (iii) the existing benchmarks are heterogeneous and do not contain the same type of information, making standardizing them for the purpose of benchmarking difficult

    Aspect-oriented refactoring of Java programs

    Get PDF

    An Approach to Invariant-based Program Refactoring

    Get PDF
    Refactoring tools include checking of an object-oriented program for the fulfillment of preconditions, for ensuring correctness. However, program invariants â semantic information about classes and fields assumed valid during program execution â are not considered by this precondition checking. As a result, applicability of automated refactorings is constrained in these cases, as refactorings that would be applicable considering the invariants get rejected, usually requiring manual changes. In this paper, we describe initial work on the use of program invariants (declared as code annotations) to increase applicability of automated refactoring. We propose an approach that uses primitive program transformations that employ the invariant to make the program syntactically amenable to the desired refactoring, before applying the refactoring itself

    Implementation of an automatic extract method refactoring

    Get PDF
    Software quality is an important aspect to guarantee maintainability and comprehensibility of developed source code. Modern software projects use static code analysis tools to continuously monitor the software quality. Based on findings from these tools, developers refactor their code with the aim to remove detected code smells. Refactorings can use up a lot of resources when done manually and a lot of authors suggest semi-automated solutions to improve the refactoring experience for developers. One of the most applied refactorings is the extract method refactoring which is often used to improve long and complex methods. Recent studies showed, that existing semi-automated tools for this refactoring are not preferred by developers. We propose an approach to fully automate the extract method refactorings based on findings from static code analysis tools. Our approach finds refactoring opportunities in a selected method and ranks these candidates according to a scoring function. The highest ranked candidate will be automatically refactored using the extract method refactoring. We implement our approach using the existing Refactoring Bot framework, a software development bot which seamlessly integrates into the build pipeline of existing projects.Software Qualität ist ein wichtiger Faktor um Wartbarkeit und Verständlichkeit von entwickeltem Programmcode zu garantieren. Moderne Software Projekte benutzen statische Programmcode Analyse Tools, um Software Qualität kontinuierlich zu überwachen. Basierend auf erkannten problematischen Stellen im Programmcode durch diese Tools, können Entwickler ihren Programmcode, mit dem Ziel diese problematischen Stellen zu entfernen, verbessern. Solches "Refactoring" braucht viele Ressourcen wenn es manuell durchgeführt wird und viel Autoren schlagen halb automatisierte Lösungen vor, um den Refactoring Prozess zu verbessern. Eine der meist genutzten Refactoring ist das "Methode extrahieren" Refactoring, welches oft genutzt wird um lange und komplexe Methoden zu verbessern. Aktuelle Studien zeigten, dass existierende halb automatisierte Tools für Refactoring von Entwicklern nicht bevorzugt werden. Wir schlagen eine Methode vor um das "Methode extrahieren" Refactoring voll automatisiert, basierend auf erkannten problematischen Stellen im Programmcode durch statische Analyse Tools, durchzuführen. Unsere Method findet Refactoring Optionen in einer ausgewählten Methode und bewertet diese Kandidaten mithilfe einer Bewertungsfunktion. Der Kandidat mit der höchsten Punktzahl wird dann benutzt um automatisch ein "Methode extrahieren" Refactoring durchzuführen. Wir implementieren die vorgeschlagene Herangehensweise in dem existierenden Refactoring Bot Framework, ein Softwareentwicklungs Bot, welcher nahtlos in die Infrastruktur existierender Projekte integriert werden kann
    corecore