JDeodorant is an Eclipse plug-in that identifies design problems in software, known as bad smells, and resolves them by applying appropriate refactorings.
JDeodorant employs employs a variety of novel methods and techniques in order to identify code smells and suggest the appropriate refactorings that resolve them.
For the moment, the tool identifies four kinds of bad smells, namely Feature Envy, Type Checking, Long Method and God Class.
Feature Envy problems are resolved by appropriate Move Method refactorings.
Type Checking problems are resolved by appropriate Replace Conditional with Polymorphism and Replace Type code with State/Strategy refactorings.
Long Method problems are resolved by appropriate Extract Method refactorings.
God Class problems are resolved by appropriate Extract Class refactorings.
The tool is the outcome of the research performed in the Department of Computer Science and Software Engineering at Concordia University, Canada and the
Computational Systems and Software Engineering Lab at the Department of Applied Informatics, University of Macedonia, Thessaloniki, Greece.
JDeodorant encompasses a number of innovative features:
- Transformation of expert knowledge to fully automated processes
- Pre-Evaluation of the effect for each suggested solution
- User guidance in comprehending the design problems
- User friendliness (one-click approach in improving design quality)
Latest features:
-
[28/02/2013] Fixed a bug in the construction of control flow graphs. Many thanks to Danny Verloop (TU Delft) for reporting the problem.
-
[06/11/2012] JDeodorant was updated to support Union Types introduced in Java 7. Union types are mainly used in the new Multicatch feature.
-
[04/11/2012] JDeodorant was updated to support the Java Language Specification 4 (Java 7). This affected the construction of Control Flow and Program Dependence graphs, since try statements may declare resources in JLS 4. More details can be found at the JDeodorant ChangeLog.
-
[26/10/2012] Alias analysis in the detection of Extract Method refactoring opportunities (Long method code smell) caused in some cases an infinite recursion. The new implementation of alias analysis improves significantly the performance. This is an important update.
-
[09/10/2012] The exclusion of classes containing method with @Test annotations from the analysis may cause NullPointer exceptions (such a case was found in JUnit). As a result, test methods are not excluded from the analysis.
- [28/02/2012] Created a Standalone version of JDeodorant for the detection of refactoring opportunities from Eclipse applications.
The results of Type Checking bad smell are now reported in a tree view and are grouped per inheritance hierarchy or named constants.
- [16/11/2011] Added a new precondition for Move Method refactoring. The variable (parameter or field of target class type) through which the moved method will be invoked must not be assigned within the body of the candidate method to be moved.
- [04/09/2011] Fixed the unnecessary importing of nested types in all implemented refactorings.
- [22/04/2011] Several improvements in the identification process and presentation of Extract Class refactoring opportunities.
The application of the Extract Class Refactoring has been improved to handle the extraction of static members and the proper initialization of final fields in the extracted class when they are initialized inside constructors.
More details can be found at the JDeodorant ChangeLog.
- [15/03/2011] Added a user option in the input pages of the Move Method and Extract Class refactorings allowing to keep delegates to the public moved methods.
- [12/03/2011] Extract Class Refactoring has been implemented from scratch and several bugs have been fixed.
Added user rating support for the identified Extract Class refactoring opportunities.
- [09/01/2011] Try/catch blocks and throw statements are handled according to the approach proposed by Allen & Horwitz (2003).
Added a rule for the preservation of output dependences.
M. Allen, and S. Horwitz, "Slicing Java Programs that Throw and Catch Exceptions", ACM SIGPLAN Workshop on Partial Evaluation and semantics-based Program Manipulation, pp. 44-54, 2003.
- [25/12/2010] The unlabeled break and continue statements within the body of loops and the break statements within the body of switch statements are handled according to the augmented program dependence graph (APDG) approach proposed by Ball & Horwitz (1993), Kumar & Horwitz (2002).
T. Ball, and S. Horwitz, "Slicing Programs with Arbitrary Control Flow", First International Workshop on Automated and Algorithmic Debugging, pp. 206-222, 1993.
S. Kumar, and S. Horwitz, "Better Slicing of Programs with Jumps and Switches", Fifth International Conference on Fundamental Approaches to Software Engineering, pp. 96-112, 2002.
- [02/12/2010] Fixed a variety of problems related with the Type checking code smell.
- [08/11/2010] Added functionality allowing the user to rate each identified refactoring opportunity with a rating ranging from 0 to 5 stars. The ratings provided by the users will help JDeodorant team to improve the ranking mechanism that sorts the identified refactoring opportunities.
- [27/08/2010] Added support for code smell evolution analysis throughout successive versions of a given Java project. Just select an identified refactoring opportunity from the table view and click on "Evolution Analysis" button. JDeodorant will automatically analyze the evolution of the corresponding code smell in the relevant project versions loaded in the workspace. Eventually, JDeodorant will present a table showing the changes regarding the severity of the code smell among the successive project versions. Watch out the screencast showing the evolution analysis for a Feature Envy code smell.
- [12/07/2010] Added an Update Site for JDeodorant.
- [11/07/2010] The tool supports the identification of Extract Class refactoring opportunities for the decomposition of "God" classes. This feature is the outcome of a joint research effort with the SSRG Lab at the Department of Computing Science, University of Alberta.
- [01/07/2010] The speed of slice computation when constructing unions of slices has been significantly improved.
- [15/06/2010] A flexible calculator for slice-based cohesion metrics. Just right-click on a method from Package Explorer and click on "Slice-based Cohesion Metrics..." from the menu. The calculator will automatically compute the slices for all the variables which are declared within the body of the selected method and visually present its slice profile. The user can enable/disable any variable from the slice profile. The statements which are common to all enabled slices are highlighted in green color. The slice-based cohesion metrics (overlap, tightness, coverage) are dynamically re-calculated after each modification of the slice profile. See the screenshots for details.
Reviews
Relevancy
Tested on my code suggestions and corrections are not relevant. Use checkstyle/pmd/findbugs instead...