evaluation_results | ||
src | ||
test_data | ||
README.md |
The the Hulk tool has been integrated into the GRaViTY tool: https://github.com/GRaViTY-Tool
This repository only hosts the version presented on ASE 2016 in Singapore and will not receive any maintenance. Please use the GRaViTY tool if you are not explicitly interested in this specific version of Hulk.
The work contained in this repository has been published as:
HULK - Continuous Object-Oriented Design-Flaw Detection
Design flaws in object-oriented programs may seriously corrupt code quality thus increasing the risk for introducing subtle errors during software maintenance and evolution. Most recent approaches identify design flaws in an ad-hoc manner, either focusing on software metrics, locally restricted code smells, or on coarse-grained architectural anti-patterns. In our approach, we utilize an abstract program model capturing high-level object-oriented code entities, further augmented with qualitative and quantitative design-related information such as coupling/cohesion. Based on this model, we propose a comprehensive methodology for specifying object-oriented design flaws by means of compound rules integrating code metrics, code smells and anti-patterns in a modular way. This approach allows for efficient, automated design-flaw detection through incremental multi-pattern matching, by facilitating systematic information reuse among multiple detection rules as well as between subsequent detection runs on continuously evolving programs.
This site contains the source code of our tool implementation HULK which comprises well-known anti-patterns for Java programs, as well as the results of our experimental evaluation which show high detection precision, scalability to real-size programs, as well as a remarkable gain in efficiency due to information reuse.
Installation and Usage
Requirements:
- Eclipse Modeling Tools (tested with Mars.2)
- Eclipse plug-ins:
- Xtext (available at the Eclipse Marketplace)
- MoDisco (available at the Eclipse Modeling Components)
- eMoflon (installation instructions at http://www.emoflon.org)
- SourceMeter (https://www.sourcemeter.com/)
Installation:
- Download the HULK source from src
- Import HULK as Eclipse projects
- Launch a fresh Eclipse instance from the workspace containing the HULK projects
- Import source code of Java projects to be analysed into the freshly opened workspace
- Create an environment variable "SOURCE_METER_JAVA" pointing to the SourceMeterJava executable
Usage:
- Right-click on the project folder to be analysed -> Hulk -> Scan...
- In the pop-up window, choose anti-patterns and/or code smells to be detected
- After detection, results appear in a fresh pop-up window, where all the relecant symptoms and metrics can be explored
Evaluation
We evaluated HULK on an established corpus of 13 open-source Java projects selected from related literature on anti-pattern and code smell detection. Sources for the corpus are:
- Moha et al.: DECOR - A Method for the Specification and Detection of Code and Design Smells. In: Transactions on Software Engineering, vol. 36, 2010.
- Khomh et al.: BDTEX - A GQM-based Bayesian Approach for the Detection of Antipatterns. In: Journal of Systems and Software, vol. 84, 2011.
- Ujhelyi et al.: Anti-Pattern Detection with Model Queries: A Comparison of Approaches. In: Proceedings of CSMR-WCRE 2014.
Based on these papers and our own investigations for simple examples, the following projects has been selected for the evaluation corpus:
- Azureus, version 2.3.0.6: an open-source BitTorrent client, now called Vuze
- Gantt, version 1.10.2: an open-source project scheduling and management tool
- JEdit, version 4.0: an open-source text editor
- JSciCalc, version 2.1.0: an open-source scientific calculator
- JTransforms, version 3.1: an open-source FFT library
- JUnit, version 3.8.2: an open-source unit testing framework
- log4j, version 1.2.17: an open-source logging lramework for Java
- Lucene, version 1.4.3: an open-source indexing and search engine
- Nutch, version 0.9: an open-source Web crawler
- PMD, version 3.9: an open-source static code analyzer
- QuickUML, version 2001: an open-source, light-weight UML editor
- SvnKit, version 1.8.12: an open-source Subversion library
- Xerces, version 2.7.0: an open-source XML parser
All source codes can be found under test_data. Evaluation results can be found under evaluation_results.