Specification and Automated Detection of Code Smells using OCL

The words Code smells mean certain code lines which makes problems in source code. It also means that code lines in bad design shape or any code made by bad coding habits. There are a few studies found in code smells detecting field. But these studies have their own weaknesses which are detecting only particular kinds of code smells and lack of expressing what the problems are. In this paper, we newly define code smells by using specification language OCL and use these models in auto detection. To construct our new code smells model, we first transform java source into XMI document format based on JavaEAST metamodel which is expanded from JavaAST meta-model. The prepared OCL will be run through OCL component based on Eclipse plug-in. Finally the effectiveness of the model will be verified by applying on primitive smell and derived smell in java source code.

[1]  Leon Moonen,et al.  Java quality assurance by detecting code smells , 2002, Ninth Working Conference on Reverse Engineering, 2002. Proceedings..

[2]  Stéphane Ducasse,et al.  A language independent approach for detecting duplicated code , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[3]  Claus Lewerentz,et al.  Metrics Based Refactoring , 2001, CSMR.

[4]  William G. Griswold,et al.  Automated support for program refactoring using invariants , 2001, Proceedings IEEE International Conference on Software Maintenance. ICSM 2001.

[5]  Stefan Slinger Code Smell Detection in Eclipse , 2005 .

[6]  Richard C. Holt Structural manipulations of software architecture using Tarski relational algebra , 1998, Proceedings Fifth Working Conference on Reverse Engineering (Cat. No.98TB100261).

[7]  Andrew P. Black,et al.  An interactive ambient visualization for code smells , 2010, SOFTVIS '10.