30 research outputs found
Using FCA to Suggest Refactorings to Correct Design Defects
Design defects are poor design choices resulting in a hard-to- maintain software, hence their detection and correction are key steps of a\ud
disciplined software process aimed at yielding high-quality software\ud
artifacts. While modern structure- and metric-based techniques enable\ud
precise detection of design defects, the correction of the discovered\ud
defects, e.g., by means of refactorings, remains a manual, hence\ud
error-prone, activity. As many of the refactorings amount to re-distributing\ud
class members over a (possibly extended) set of classes, formal concept\ud
analysis (FCA) has been successfully applied in the past as a formal\ud
framework for refactoring exploration. Here we propose a novel approach\ud
for defect removal in object-oriented programs that combines the\ud
effectiveness of metrics with the theoretical strength of FCA. A\ud
case study of a specific defect, the Blob, drawn from the\ud
Azureus project illustrates our approach
DĂ©veloppement logiciel par transformation de modĂšles
La recherche en gĂ©nie logiciel a depuis longtemps tentĂ© de mieux comprendre le processus de dĂ©veloppement logiciel, minimalement, pour en reproduire les bonnes pratiques, et idĂ©alement, pour pouvoir le mĂ©caniser. On peut identifier deux approches majeures pour caractĂ©riser le processus. La premiĂšre approche, dite transformationnelle, perçoit le processus comme une sĂ©quence de transformations prĂ©servant certaines propriĂ©tĂ©s des donnĂ©es Ă lâentrĂ©e. Cette idĂ©e a Ă©tĂ© rĂ©cemment reprise par lâarchitecture dirigĂ©e par les modĂšles de lâOMG. La deuxiĂšme approche consiste Ă rĂ©pertorier et Ă codifier des solutions Ă©prouvĂ©es Ă des problĂšmes rĂ©currents. Les recherches sur les styles architecturaux, les patrons de conception, ou les cadres dâapplications sâinscrivent dans cette approche. Notre travail de recherche reconnaĂźt la complĂ©mentaritĂ© des deux approches, notamment pour lâĂ©tape de conception: dans le cadre du dĂ©veloppement dirigĂ© par les modĂšles, nous percevons lâĂ©tape de conception comme lâapplication de patrons de solutions aux modĂšles reçus en entrĂ©e.
Il est coutume de dĂ©finir lâĂ©tape de conception en termes de conception architecturale, et conception dĂ©taillĂ©e. La conception architecturale se prĂ©occupe dâorganiser un logiciel en composants rĂ©pondant Ă un ensemble dâexigences non-fonctionnelles, alors que la conception dĂ©taillĂ©e se prĂ©occupe, en quelque sorte, du contenu de ces composants. La conception architecturale sâappuie sur des styles architecturaux qui sont des principes dâorganisation permettant dâoptimiser certaines qualitĂ©s, alors que la conception dĂ©taillĂ©e sâappuie sur des patrons de conception pour attribuer les responsabilitĂ©s aux classes. Les styles architecturaux et les patrons de conception sont des artefacts qui codifient des solutions Ă©prouvĂ©es Ă des problĂšmes rĂ©currents de conception. Alors que ces artefacts sont bien documentĂ©s, la dĂ©cision de les appliquer reste essentiellement manuelle. De plus, les outils proposĂ©s nâoffrent pas un support adĂ©quat pour les appliquer Ă des modĂšles existants.
Dans cette thĂšse, nous nous attaquons Ă la conception dĂ©taillĂ©e, et plus particuliĂšrement, Ă la transformation de modĂšles par application de patrons de conception, en partie parce que les patrons de conception sont moins complexes, et en partie parce que lâimplĂ©mentation des styles architecturaux passe souvent par les patrons de conception. Ainsi, nous proposons une approche pour reprĂ©senter et appliquer les patrons de conception. Notre approche se base sur la reprĂ©sentation explicite des problĂšmes rĂ©solus par ces patrons. En effet, la reprĂ©sentation explicite du problĂšme rĂ©solu par un patron permet : (1) de mieux comprendre le patron, (2) de reconnaĂźtre lâopportunitĂ© dâappliquer le patron en dĂ©tectant une instance de la reprĂ©sentation du problĂšme dans les modĂšles du systĂšme considĂ©rĂ©, et (3) dâautomatiser lâapplication du patron en la reprĂ©sentant, de façon dĂ©clarative, par une transformation dâune instance du problĂšme en une instance de la solution.
Pour vĂ©rifier et valider notre approche, nous lâavons utilisĂ©e pour reprĂ©senter et appliquer diffĂ©rents patrons de conception et nous avons effectuĂ© des tests pratiques sur des modĂšles gĂ©nĂ©rĂ©s Ă partir de logiciels libres.Software engineering researchers have long tried to understand the software process development to mechanize it or at least to codify its good practices. We identify two major approaches to characterize the process. The first approachâknown as transformationalâsees the process as a sequence of property-preserving transformations. This idea was recently adopted by the OMGâs model-driven architecture (MDA). The second approach consists in identifying and codifying proven solutions to recurring problems. Research on architectural styles, frameworks and design patterns are part of this approach. Our research recognizes the complementarity of these two approaches, in particular in the design step. Indeed within the model-driven development context, we view software design as the process of applying codified solution patterns to input models.
Software design is typically defined in terms of architectural design and detailed design. Architectural design aims at organizing the software in modules or components that meet a set of non-functional requirements while detailed design isâin some wayâconcerned by the contents of the identified components. Architectural design relies on architectural styles which are principles of organization to optimize certain quality requirements, whereas detailed design relies on design patterns to assign responsibilities to classes. Both architectural styles and design patterns are design artifacts that encode proven solutions to recurring design problems. While these design artifacts are documented, the decision to apply them remains essentially manual. Besides, once a decision has been made to use a design artifact, there is no adequate support to apply it to existing models.
As design patterns present an ââeasierââ problem to solve, and because architectural styles implementation relies on design patterns, our strategy for addressing these issues was to try to solve the problem for design patterns first, and then tackle architectural styles. Hence, in this thesis, we propose an approach for representing and applying design patterns. Our approach is based on an explicit representation of the problems solved by design patterns. Indeed, and explicit representation of the problem solved by a pattern enables to: 1) better understand the pattern, 2) recognize the opportunity of applying the pattern by matching the representation of the problem against the models of the considered system, and 3) specify declaratively the application of the pattern as a transformation of an instance of the problem into an instance of the solution.
To verify and validate the proposed approach, we used it to represent and apply several design patterns. We also conducted practical tests on models generated from open source systems
Mise en Ćuvre des patrons de conception par reprĂ©sentation explicite du problĂšme
Les patrons de conception constituent une codification intuitive de solutions Ă©prouvĂ©es Ă des problĂšmes de conception rĂ©currents. Plusieurs ont cherchĂ© Ă dĂ©velopper des mĂ©thodes pour la reprĂ©sentation et la mise en oeuvre des patrons. Or, aucune des approches que nous avons Ă©tudiĂ©es ne reprĂ©sente explicitement le problĂšme de conception que le patron cherche Ă rĂ©soudre. La reprĂ©sentation du problĂšme a plusieurs avantages, dont : 1) une meilleure caractĂ©risation de l'applicabilitĂ© des patrons plus prĂ©cise que la description textuelle prĂ©conisĂ©e par (Gamma et al., 1995), 2) une reprĂ©sentation plus naturelle des transformations inhĂ©rentes aux patrons, et 3) la possibilitĂ© d'identifier automatiquement les opportunitĂ©s d'application de patrons dans un modĂšle d'analyse. Dans cet article, nous dĂ©crivons les principes de notre reprĂ©sentation, et son implantation dans le cadre EMF d'ĂclipseTM
Model refactoring using examples: a searchâbased approach
One of the important challenges in modelâdriven engineering is how to improve the quality of the models' design in order to help designers understand them. Refactoring represents an efficient technique to improve the quality of a design while preserving its behavior. Most of existing work on model refactoring relies on declarative rules to detect refactoring opportunities and to apply the appropriate refactorings. However, a complete specification of refactoring opportunities requires a huge number of rules. In this paper, we consider the refactoring mechanism as a combinatorial optimization problem where the goal is to find good refactoring suggestions starting from a small set of refactoring examples applied to similar contexts. Our approach, named model refactoring by example, takes as input an initial model to refactor, a set of structural metrics calculated on both initial model and models in the base of examples, and a base of refactoring examples extracted from different software systems and generates as output a sequence of refactorings. A solution is defined as a combination of refactoring operations that should maximize as much as possible the structural similarity based on metrics between the initial model and the models in the base of examples. A heuristic method is used to explore the space of possible refactoring solutions. To this end, we used and adapted a genetic algorithm as a global heuristic search. The validation results on different systems of realâworld models taken from openâsource projects confirm the effectiveness of our approach. Copyright © 2014 John Wiley & Sons, Ltd.Peer Reviewedhttp://deepblue.lib.umich.edu/bitstream/2027.42/108085/1/smr1644.pd