Code Smell Detection in Eclipse

Refactoring is a software engineering technique that, by applying a series of small behavior-preserving transformations, can improve a software system’s design, readability and extensibility. Code smells are signs that indicate that source code might need refactoring. The goal of this thesis project was to develop a prototype of a code smell detection plug-in for the Eclipse IDE framework. In earlier research by Van Emden and Moonen, a tool was developed to detect code smells in Java source code and visualize them in graph views. CodeNose, the plug-in prototype created in this thesis project, presents code smells in the Tasks View in Eclipse, similar to the way compiler errors and warnings are presented. These code smell reports provide feedback about the quality of a software system. CodeNose uses the Eclipse JDT parser to build abstract syntax trees that represent the source code. A tree visitor detects primitive code smells and collects derived smell aspects, which are written to a fact database and passed to a relational algebra calculator, the Grok tool. The results of the calculations on these facts can be used to infer more complex code smells. In a case study, the plug-in was tested by performing the code smell detection process on an existing software system. We present the case study results, focusing at performance of the plug-in and usefulness of the code smells that were detected.

[1]  Murray Hill,et al.  Lint, a C Program Checker , 1978 .

[2]  Hausi A. Müller,et al.  Programmable Reverse Engineering , 1994, Int. J. Softw. Eng. Knowl. Eng..

[3]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[4]  Andrew W. Appel Modern Compiler Implementation in ML: Basic Techniques , 1997 .

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

[6]  Thomas J. Mowbray,et al.  AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis , 1998 .

[7]  Richard C. Holt,et al.  Linux as a case study: its extracted software architecture , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[8]  Michele Lanza,et al.  A hybrid reverse engineering platform combining metrics and program visualization , 1999 .

[9]  Hausi A. Müller,et al.  Reverse engineering: a roadmap , 2000, ICSE '00.

[10]  Keith H. Bennett,et al.  Software maintenance and evolution: a roadmap , 2000, ICSE '00.

[11]  Hausi A. Müller,et al.  Analyzing Java software by combining metrics and program visualization , 2000, Proceedings of the Fourth European Conference on Software Maintenance and Reengineering.

[12]  Arie van Deursen,et al.  The ASF+SDF Meta-environment: A Component-Based Language Development Environment , 2001 .

[13]  Armin Biere,et al.  Applying static analysis to large-scale, multi-threaded Java programs , 2001, Proceedings 2001 Australian Software Engineering Conference.

[14]  Arie van Deursen,et al.  Refactoring test code , 2001 .

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

[16]  James R. Cordy,et al.  An Interactive Interface for Refactoring Using Source Transformation , 2003 .

[17]  David Osborne,et al.  J2EE AntiPatterns , 2003 .

[18]  William Crawford,et al.  J2EE Design Patterns , 2003 .

[19]  Joshua Kerievsky,et al.  Refactoring to Patterns , 2004, XP/Agile Universe.

[20]  Dieter Maurer,et al.  Compiler Design , 2013, Springer Berlin Heidelberg.