Code and design smells are implementation and design problems that come from "poor" recurring design choices. They may hinder development and maintenance of systems by making them hard for software engineers to change and evolve. A semi-automatic detection and correction are thus key factors to ease the maintenance and evolution stages.
Techniques and tools have been proposed in the literature both for the detection and correction of smells. The detection techniques proposed consist mainly in defining rules for detecting smells and applying them to the source code of a system. As for the correction techniques, they consist in applying automatically refactorings in the source code of the system analysed to restructure it and correct the smells. However, software engineers have to identify manually how the system must be restructured. Thus, it is not possible to correct directly and automatically the detected smells. This problem is due to the fact that the detection and the correction of smells are treated independently.
Thus, we propose D ECOR , a method that encompasses and defines all steps necessary for the detection and correction of code and design smells. This method allows software engineers to specify detection rules at a high level of abstraction and to obtain automatically suggestions for code restructuring.
We apply and validate our method on open-source object-oriented systems to show that our method allows a precise detection and a suitable correction of smells.
Keywords . design smells, antipatterns, code smells, specification, detection, correction, restructuring, refactorings, JAVA.
Cited By
- Pérez J and Crespo Y Computation of refactoring plans from refactoring strategies using HTN planning Proceedings of the Fifth Workshop on Refactoring Tools, (24-31)
- Pérez J and Crespo Y Perspectives on automated correction of bad smells Proceedings of the joint international and annual ERCIM workshops on Principles of software evolution (IWPSE) and software evolution (Evol) workshops, (99-108)
Recommendations
DECOR: A Method for the Specification and Detection of Code and Design Smells
Code and design smells are poor solutions to recurring implementation and design problems. They may hinder the evolution of a system by making it hard for software engineers to carry out changes. We propose three contributions to the research field ...
Decor: a tool for the detection of design defects
ASE '07: Proceedings of the 22nd IEEE/ACM International Conference on Automated Software EngineeringSoftware engineers often need to identify design defects, recurring design problems that hinder the development process, to improve and assess the quality of their systems. However, this is di±cult because of the lack of specifications and tools. We ...