01-11-2016, 12:23 PM
1462949006-LiteratureReview.docx (Size: 251.15 KB / Downloads: 1)
Introduction
Model Driven Engineering(MDE) has become a new trend in software development paradigm.MDE considers the models a main artifact and uses it at various stages of software development taking the focus away from program code. With the increasing importance of models, quality assessment of models has become an important issue too. Refactoring is used for improving the quality of the software by making the internal structure of the program better without making any changes in the functionality of software. Bad Smell Detection is the idea of identifying the opportunities for refactoring-called bad smells. Refacoring makes the design of the software more understandable, modular, reusable, extensible and maintainable. Refactoring is very crucial for software development where a lot of development is done in iteration through changes as changes can cause depletion in software quality. Refactoring works against the software quality depletion and makes the design of the software more understandable,modular,reusable,extensible and maintainable Manual inspection of models for finding bad smells will be very time consuming so tool assistance is needed.
A lot of works has been done in area of bad smell detection at code level but at model level it is still at infant stage. Very few tools exist for bad smells detection in models like SDMetrics,MagicDraw,EMF Refactor.Various tools that are mentioned in research papers either does not exist on internet or are developed at academic level and are not industrially approved.
2. Motivation and need for bad smell detection in UML models/Background
Software evolution and software maintenance are now the central activities of software development because most of the software development is done through changes in form of iterations. Software could be changed due to one of these reasons:-
To add new function
To improve the existing function
To correct faults
To make software more scalable
A widely references study by has shown that 70% of the total expenditure spent on software is on these two activities. Changes are an inevitable part of software and a costly affair.Softwares are not of good quality that makes the change difficult and also with changes software quality goes down making the further software changes more difficult and expensive. A process that wworks for keeping the software quality up is Refactoring. Refactoring works by improving the internal structure of code and preserving the external behavior of the software.Refactoring is implemented by first identifying the required pieces of software that needs refactoring called bad smells and then applying appropriate refactoring action. Therefore Bad smell Detection is an important sub-activity of Refactoring process.
Bad smell detection of models is still at its earlier stages unlike code smell detection.UML is standard language for modellng the software thus most of the research is based on UML models. Bad smell detection in uml models has become more important due to new trend in software engineering of MDE.MDE mainly focuses on uml models for software development.
UML plays an important role in MDE by providing a language for creating and transforming models.UML give a standard way to write system models, covering conceptual ideas.
3.Bad Smells
Bad smell a term that was coined by Kent Beck on Wards Wiki in the late 1990s.Use of this term was increased after it was related to Refactoring process in the Refactoring:Improving the Design of Existing Code.According to Fowler”Smells are the certain structures in the code that suggests (sometimes scream for ) the possibility of refactoring”.Same thing applies for design i.e. UML models.
Bad smells are not technical bugs,as they do not prevent the system from performing a certain task.They are quality riented and indivates the opportuinity for improvemmnet i.e. refactoring.
A term that is alternatively used for bad smells is Anti-Patterns. Anti-patterns or bad smells are the poor solutions to recurring design problems.
Design smells makes the design fragile and difficult to maintain. Thus making the software maintenance and evolution a costly affair. That’s why it’s important that bad smells are detected and detecting bad smells in UML models offer various advantages over detecting bad smells in code like earlier detection of bad smells no need to wait till code is ready, detection can be done after design phase. Another advantage is tools and strategies developed for bad smell detection in models are implementation language independent.
(Catalog of bad smells)
4.Review: Literature Survey of bad smell detetction of UML models
A lot of work has been done in the field of detection of bad smells using code whereas field of detection of bad smells in models is still in its infancy stage. Development in the automation of model transformation has fueled the interest in this area of research.
Mohammed Misbhaudding, Mohammad Alshayeb (2013), has mentioned that based on the study different research papers there are three main approaches being followed to specify bad smells in models Metric Based, Pattern Based, Rule Based. Metric based approach has advantage that it could be integrated to already existing modeling tools. Its con is specification of appropriate threshold value for metrics as it has decisive influence on detection accuracy. Pattern based approach is based on the concept of first search for design problems within the model and then suggesting corrections for them in the form of design patterns. Rule-Based smell detection approach identifies both model smells and ant patterns using a declarative rule definition. These rules are manually defined to identify the symptoms that characterize the smell.
Out of the 22 code smells proposed by (Fowler et al.1999); only 10 are extended and discussed with regards to model refactoring. Although some of these smells cannot be applied to UML models exclusively (such as Long Method, Switch Statements, Comments etc.), quite a few can be addressed by considering other UML views or richer models such as ones augmented with formal specifications. For instance, inter-class smells such as Divergent Change, Shotgun Surgery, Feature Envy and Inappropriate Intimacy can be identified by using message exchange details from interaction diagrams such as sequence diagrams and functional composition information from use case diagrams. (Misbhauddin & Alshayeb, 2013)
Ananda Rao, K Narendar Reddy(2008), has mentioned that design smells are used to detect design defects in object oriented software design. Detection of bad smells allows us to imply Refactoring thus improving the quality of the software and making it more maintainable. In existing systems of bad detection there is a lack of quantitative approaches. Quantitative methods are free from any human bias and could be automated.
This paper proposes the idea of use of DCPP matrix to detect two important bad smells Shotgun Surgery and Divergent change. These smells are also referred as maintenance smells as their effect on maintenance efforts is noticeable one. A matrix is created on the basis of how a change made in one artifact is propagated to other artifacts. Using these matrix artifacts of design suffering from above mentioned smells are identified. (Rao & K, 2008)
Anti-patterns are the bad solutions to the design problems that occurs repeatedly. Anti-patterns provides the solution to the current problem but their effect on the software quality and maintenance cost is adverse. This approach is combination of pattern and metric based approaches towards detection of bad smell in models. Most of the anti-patterns outlined in literature has been defined in terms of code quality metrics. Detection of anti-patterns at design level offers advantages like improved quality of code, language independent detection approaches and reduced cost of detection of defects during later stages over their detection at code level.
Rahma Fourati, Nadia Bouassida, Hanene Ben Abdallah has mentioned a metric based approach for Anti-pattern detection in UML diagrams in their papers. This approach examines the class diagram and behavioral diagrams of the software system for detection of Anti-patterns at design level. Use of existing metrics and few newly defined has been made for detection of five types of Anti-patterns Blob, Lava Flow, Functional Decomposition, Poltergeists and Swiss Army Knife. (Fourati, Bouassids, & Abdallah, 2011)
Thesis report by Petra Beczi was the first approach toward the anti-pattern detection in UML class diagrams. He has introduced approach called RADAR, which is a solution to detect inter alia, Complex Class, Large Class, Lazy Class, and ManyFieldAttributesButNotComplex (MFABNC) in UML class diagrams and returns warnings of the results. Essentially, RADAR uses a combination of some existing software design (SD) metrics and rules of the anti-patterns, moreover provides a flexible algorithmic procedure. This approach’s accuracy of RADAR in the detection of Large Class is between the averages of 38%-75%, and 55%- 80% for MFABNC. Regarding to the average accuracy of the other two anti-patterns, the detection of Complex Class is determined as between 68%-70%, and 80%-99% for Lazy Class on the basis of survey. (BÉCZI, 2015)
5.Tools
Refactoring and smell detection in UML lacks a standard and industry accepted tool. Most of the tools that are developed for this purpose are academic based,poorly maintained or currently not available. Two tools considered for review are
• EMF Refactor
• SDMetrics
5.1 EMF Refactor
EMF Refactor is an open source eclipse tool environment that provides standard quality assurance process for models based on eclipse modeling framework.Tool environment consists of mainly two modules application module and specification module.Application module of emf-refactor provides the facility of calculation of existing metrics,smell and applying refactoring.Specification module allows the generation of new metrics and smells. This module provides us with the facility of generating new metrics and smells using specification technologies like Java,OCL,Henshin (Arendt, 2014).EMF refactor also facilitates the generation of metric and smell detection reports for further analysis
5.2 SDMetrics
SDMetric is an another tool available for smell detection inuml models.In SDMetrics there is no facility of drawing UML diagrams instead xmi file of uml model generated from another tool like ArgoUML etc is imported.SDMetrics tool provides the measure of all design attributes size,coupling,complexity etc. at all level of design like on model,package,subsystem etc.It facilitated the automatic check for design rules.SDMetrics refers to the process of bad smell detection as process of “checking design rules”.SDMetric checks adherence to the UML design rules like DupOps, God class etc. New metrics and design rules can be defined .We are not restricted to existing metrics and design rules. SDMetrics has a very large list of metrics and design rules against which the quality of model is measured.