Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

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.

License

Notifications You must be signed in to change notification settings

churchilldu/ClassTrim

Repository files navigation

ClassTrim

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.

Quick start

  1. Prerequisites
  • JDK 17+
  • Maven 3.8+
  1. Configure environment
  • Copy src/main/resources/config.properties.example to src/main/resources/config.properties.
  • Edit the new config.properties and set values for your environment:
    • mavenRepo: absolute path to your local Maven repository
    • datasetRoot: absolute path to the datasets root folder
    • outputFolder: output folder for results (optional; default output)
    • projectCacheFolder: folder for serialized project cache (optional; default .project)
    • notifyUrl: optional webhook for notifications
  1. Entry point
    • org.classtrim.Main run the move method refactoring algorithm on each project.
    • org.classtrim.NSGAII or org.classtrim.NSGAIII run it once.
    • org.classtrim.baseline.BaselineRefactor run baseline comparison experiment.

How I calculate metrics and some common question are in wiki.

Baseline comparison (baseline/)

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., *.tsv summaries)

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.

Code features

  1. Follow unix philosophy.
  2. Uses Lombok to simplify data classes (getters/setters, constructors)
  3. Uses Java 8 Optional to handle nulls elegantly
  4. Emphasizes immutability; returns unmodified collections
  5. Caches computed objects to improve performance
  6. Keeps dependencies minimal
  7. Automatically records experiment results and summaries (summary may be improved by using a database)
  8. Includes unit tests

Thanks

License

MIT

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages