ClassTrim is a framework to recommend move method refactoring using Non-dominated Sorting Genetic Algorithm-III ( NSGA-III) to minimizing the number of classes that exceed predefined metric thresholds.
- Prerequisites
- JDK 17+
- Maven 3.8+
- Configure environment
- Copy
src/main/resources/config.properties.exampletosrc/main/resources/config.properties. - Edit the new
config.propertiesand set values for your environment:mavenRepo: absolute path to your local Maven repositorydatasetRoot: absolute path to the datasets root folderoutputFolder: output folder for results (optional; defaultoutput)projectCacheFolder: folder for serialized project cache (optional; default.project)notifyUrl: optional webhook for notifications
- Entry point
org.classtrim.Mainrun the move method refactoring algorithm on each project.org.classtrim.NSGAIIororg.classtrim.NSGAIIIrun it once.org.classtrim.baseline.BaselineRefactorrun baseline comparison experiment.
How I calculate metrics and some common question are in wiki.
This folder contains results from baseline tools for comparison, including:
- Runtime screenshots produced during baseline runs
- Suggested outputs generated by each baseline tool (e.g.,
*.tsvsummaries)
Typical subfolders include JDeodorant/, JMove/, HMove/ and REsolution/, each organized by project-version. These
provide reference suggestions and artifacts to compare against this project's NSGA-based refactoring outputs.
- Follow unix philosophy.
- Uses Lombok to simplify data classes (getters/setters, constructors)
- Uses Java 8
Optionalto handle nulls elegantly - Emphasizes immutability; returns unmodified collections
- Caches computed objects to improve performance
- Keeps dependencies minimal
- Automatically records experiment results and summaries (summary may be improved by using a database)
- Includes unit tests