88 research outputs found

    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

    Towards a catalog of aspect-oriented refactorings

    Get PDF
    Comunicação aprovada à International Conference on Aspect-Oriented Software Development (AOSD), 4, Chicago, 2005.In this paper, we present a collection of aspect-oriented refactorings covering both the extraction of aspects from object-oriented legacy code and the subsequent tidying up of the resulting aspects. In some cases, this tidying up entails the replacement of the original implementation with a different, centralized design, made possible by modularization. The collection of refactorings includes the extraction of common code in various aspects into abstract superaspects. We review the traditional object-oriented code smells in the light of aspect-orientation and propose some new smells for the detection of crosscutting concerns. In addition, we propose a new code smell that is specific to aspects.(undefined

    An empirical study of aspect-oriented metrics

    Get PDF
    Metrics for aspect-oriented software have been proposed and used to investigate the benefits and the disadvantages of crosscutting concerns modularisation. Some of these metrics have not been rigorously defined nor analytically evaluated. Also, there are few empirical data showing typical values of these metrics in aspect-oriented software. In this paper, we provide rigorous definitions, usage guidelines, analytical evaluation, and empirical data from ten open source projects, determining the value of six metrics for aspect-oriented software (lines of code, weighted operations in module, depth of inheritance tree, number of children, crosscutting degree of an aspect, and coupling on advice execution). We discuss how each of these metrics can be used to identify shortcomings in existing aspect-oriented software. (C) 2012 Elsevier B.V. All rights reserved.CNPq [140046/06-2]; Project CNPQ-PROSUL [490478/06-9]; Capes-Grices [2051-05-2]; FAPERGS [10/0470-1]; FCT MCTESinfo:eu-repo/semantics/publishedVersio

    Co-Occurrence of Design Patterns and Bad Smells in Software Systems: An Exploratory Study

    Get PDF
    A design pattern is a general reusable solution to a recurring problem in software design. Bad smells are symptoms that may indicate something wrong in the system design or code. Therefore, design patterns and bad smells represent antagonistic structures. They are subject of recurring research and typically appear in software systems. Although design patterns represent good design, their use is often inadequate because their implementation is not always trivial or they may be unnecessarily employed. The inadequate use of design patterns may lead to a bad smell. Therefore, this paper performs an exploratory study in order to identify instances of co-occurrences of design patterns and bad smells. This study is performed over five systems and discovers some co-occurrences between design patterns and bad smells. For instance, we observed the co-occurrences of Command with God Class and Template Method with Duplicated Code. The results of this study make it possible to understand in which situations design patterns are misused or overused and establish guidelines for their better use

    Towards the design and implementation of aspect-oriented programming for spreadsheets

    Get PDF
    A spreadsheet usually starts as a simple and singleuser software artifact, but, as frequent as in other software systems, quickly evolves into a complex system developed by many actors. Often, different users work on different aspects of the same spreadsheet: while a secretary may be only involved in adding plain data to the spreadsheet, an accountant may define new business rules, while an engineer may need to adapt the spreadsheet content so it can be used by other software systems.Unfortunately,spreadsheetsystemsdonotoffermodular mechanisms, and as a consequence, some of the previous tasks may be defined by adding intrusive “code” to the spreadsheet. In this paper we go through the design and implementation of an aspect-oriented language for spreadsheets so that users can work on different aspects of a spreadsheet in a modular way. For example, aspects can be defined in order to introduce new business rules to an existing spreadsheet, or to manipulate the spreadsheet data to be ported to another system. Aspects are defined as aspect-oriented program specifications that are dynamically woven into the underlying spreadsheet by an aspect weaver. In this aspect-oriented style of spreadsheet development, differentusers develop,orreuse,aspects withoutaddingintrusive code to the original spreadsheet. Such code is added/executed by the spreadsheet weaving mechanism proposed in this paper.This work is financed by the FCT – Fundação para a Ciência e a Tecnologia (Portuguese Foundation for Science and Technology) within project UID/EEA/50014/2013. This work has also been partially funded by FLAD/NSF through a project grant (ref. 233/2014). The last author is supported by CAPES through a Programa Professor Visitante do Exterior (PVE) grant (ref. 15075133)

    Experiences In Migrating An Industrial Application To Aspects

    Get PDF
    Aspect-Oriented Software Development (AOSD) is a paradigm aiming to solve problems of object-oriented programming (OOP). With normal OOP it’s often unlikely to accomplish fine system modularity due to crosscutting concerns being scattered and tangled throughout the system. AOSD resolves this problem by its capability to crosscut the regular code and as a consequence transfer the crosscutting concerns to a single model called aspect. This thesis describes an experiment on industrial application wherein the effectiveness of aspect-oriented techniques is explained in migration the OOP application into aspects. The experiment goals at first to identify the crosscutting concerns in source code of the industrial application and transform these concerns to a functionally equivalent aspect-oriented version. In addition to presenting experiences gained through the experiment, the thesis aims to provide practical guidance of aspect solutions in a real application

    1st Workshop on Refactoring Tools (WRT'07) : Proceedings

    Get PDF

    Applying and Evaluating Concern-Sensitive Design Heuristics

    Get PDF
    Abstract-Empirical studies have stressed that aspect-oriented decompositions can cause non-obvious flaws in the modularity of certain design concerns. Without proper design evaluation mechanisms, the identification of these flaws can become counter-productive and impractical. Nowadays, modularity assessment is mostly supported by metric-based heuristics rooted at conventional attributes, such as module cohesion and coupling. However, such conventional module-driven assessment cannot be tailored to the design concerns. This paper proposes and systematically evaluates a representative suite of concern-sensitive heuristic rules. The accuracy of the heuristics is assessed through their application to six systems. The analysis was based on the heuristics support for: (i) addressing the shortcomings of conventional metrics-based assessments, (ii) reducing the manifestation of false positives and false negatives, and (iii) finding the presence of design flaws relative to both classes and aspects. Resumo-Estudos experimentais recentes mostraram que decomposições orientadas a aspectos podem causar anomalias na modularidade do design de certos interesses e que tais anomalias muitas vezes não são óbvias. Sem mecanismos de avaliação de design apropriados, a identificação dessas anomalias pode se tornar contraproducente e impraticável. Atualmente, a avaliação da modularidade de design orientado a aspectos é na maioria das vezes apoiada por heurísticas baseadas em métricas que quantificam atributos convencionais, como coesão e acoplamento de módulos. No entanto, essa avaliação dirigida por atributos convencionais não leva em conta os interesses que guiam o design. Esse artigo propõe e avalia sistematicamente um conjunto de regras heurísticas sensíveis a interesses. A acurácia das heurísticas foi avaliada por meio de sua aplicação em seis diferentes sistemas. A análise se baseou na capacidade das heurísticas de: (i) tratar das limitações de abordagens de avaliação baseadas em métricas convencionais, (ii) detectar a presença de anomalias de design relacionadas a classes e aspectos, e (iii) reduzir a manifestação de falsos positivos e falsos negativos

    Refactorings to evolve object-oriented systems with aspect-oriented concepts

    Get PDF
    Tese de doutoramento em Informática.Software engineering tools should support complete separation of concerns, by enabling the deployment of each different concern in its own unit of modularity. Unfortunately, current tools and languages – including those supporting the object-oriented programming paradigm – fail to provide a complete and effective support for the separation of all concerns. Undesirable phenomena such as code scattering and code tangling ensue. Aspect-Oriented Programming is a new programming paradigm capable of modularising crosscutting concerns. Aspect-oriented programming complements existing programming paradigms, including object-oriented programming, with constructs that provide a fuller separation of concerns. Refactoring is a technique to restructure program source code in order to improve its underlying design and style while preserving the externally observable behaviour. “Code smells” help to detect inadequate structures and designs, which are then gradually removed through refactoring processes. There is a prospect of aspect-oriented programming becoming a mainstream technology in the near future. This begs the question of how to deal with a large base of object-oriented legacy code when aspect-orientation becomes standard practice. AspectJ's backward compatibility with Java opens the way for refactoring existing Java applications to leverage the concepts and mechanisms of aspects. This requires a prior idea of good style for aspect-oriented source code, something yet to be developed and matured. This thesis contributes to the definition of a new style appropriate to aspect orientation. To this effect, this thesis documents a collection of novel refactorings enabling the extraction of crosscutting concerns from object-oriented legacy source code and the subsequent restructuring of the aspects thus obtained. In addition, this thesis presents a review of traditional object-oriented code smells so they can be used as indicators of latent aspects in object-oriented source code. Finally, this thesis proposes several novel aspect-oriented code smells. We validate the refactorings through an illustrative refactoring process.Idealmente, as ferramentas de engenharia de programas suportariam uma estrita separação de facetas, possibilitando a colocação de cada faceta na sua própria unidade modular. Infelizmente, as actuais ferramentas e linguagens – incluindo as que suportam o paradigma da orientação ao objecto – não conseguem obter uma completa e efectiva separação de todas as facetas. Daí resultam fenómenos indesejáveis tais como a dispersão e emaranhado de texto fonte. A programação orientada ao aspecto é um novo paradigma da programação capaz de modularizar facetas transversais. A orientação ao aspecto complementa os paradigmas existentes, incluindo a orientação ao objecto, com mecanismos que providenciam uma separação de facetas mais completa. A refabricação de programas é uma técnica para reestruturar o texto fonte de um programa no sentido de melhorar a concepção e estilo subjacentes, mantendo o seu comportamento externamente observável. “Maus cheiros” no texto fonte ajudam a detectar estruturas e concepções inadequadas, que são então gradualmente removidos através de processos de refabricação. Existe a perspectiva da orientação ao aspecto ter uma aceitação generalizada no futuro próximo. Coloca-se a questão de como lidar com uma grande base instalada de texto fonte orientado ao objecto legado quando tal acontecer. A compatibilidade retroactiva de AspectJ em relação a Java possibilita a refabricação das aplicações Java existentes de modo a tomarem partido dos conceitos e mecanismos dos aspectos. Porém, isto tem como pressuposto uma ideia clara de bom estilo para o texto fonte orientado ao aspecto, algo que actualmente não existe duma maneira desenvolvida e matura. Esta tese contribui para a caracterização de um novo estilo, apropriado à orientação ao aspecto. Para esse efeito, esta tese documenta uma colecção de refabricações originais através das quais facetas transversais existentes em texto legado orientado ao objecto são extraídas para aspectos, e a posterior reestruturação dos aspectos assim obtidos pode ser realizada. Esta tese apresenta também uma reapreciação dos maus cheiros orientados ao objecto tradicionais no sentido de poderem ser usados na detecção de aspectos latentes no texto fonte orientado ao objecto. Por fim, esta tese propõe diversos maus cheiros originais, orientados ao aspecto. As refabricações são validadas por meio de um processo de refabricação ilustrativo.Programa de Desenvolvimento Educativo para Portugal III (PRODEP III) - (Medida 5 - Acção 5.3 - Eixo 3 - Formação Avançada de Docentes do Ensino Superior).Portable Parallel Computing based on Virtual Machines (PPC-VM) - (PO-SI/CHS/47158/2002).Fundação Luso Americana para o Desenvolvimento (FLAD)
    corecore