A comparative literature review and empirical analysis of large Java file decomposition methods : rule-based, machine learning, and AI-agent approaches
Vo, Gia Bach (2026)
Kandidaatintyö
Vo, Gia Bach
2026
School of Engineering Science, Tietotekniikka
Kaikki oikeudet pidätetään.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi-fe2026042029352
https://urn.fi/URN:NBN:fi-fe2026042029352
Tiivistelmä
The proliferation of legacy Java systems has intensified the need for automated tools to detect and decompose God Classes — large, monolithic classes that violate the Single Responsibility Principle and impair software maintainability. This thesis presents a comprehensive comparative analysis of three distinct methodological approaches to God Class detection and decomposition: Rule-Based methods, Machine Learning (ML) techniques, and AI-Agent systems.
The Rule-Based approach implements threshold-based detection using the CK Metrics Suite (Chidamber & Kemerer, 1994), achieving 33% exact accuracy with 100% adjacent accuracy with sub-second processing times. The Machine Learning approach employs Random Forest, XGBoost, and Gradient Boosting classifiers with SMOTE data balancing and PCA variance analysis, achieving 95–99% accuracy on synthetic benchmark data, demonstrating pipeline correctness. The AI-Agent approach evaluates three Large Language Models — Claude 3.5 Sonnet, GPT-4 Turbo, and Gemini Pro — achieving 100% classification accuracy on four single-run evaluations with detailed refactoring suggestions, though with higher latency (15–45 seconds) and non-deterministic outputs.
Comparative analysis across six Java test files reveals complementary strengths: Rule-Based methods excel in CI/CD integration; ML approaches provide high accuracy with moderate overhead; AI-Agents deliver the highest quality recommendations for complex decomposition planning. Supplementary validation on 19 real-world classes from Apache and Spring Framework repositories yielded 63% rule-based and 74% ML accuracy (both with 100% adjacent accuracy), confirming that synthetic test data overestimates performance while providing preliminary evidence that ML classification adds value over fixed thresholds on real-world code. A hybrid methodology combining all three approaches is proposed for optimal results in enterprise software maintenance scenarios. Tämä opinnäytetyö esittää vertailevan analyysin kolmesta metodologisesta lähestymistavasta God Class -koodihajun tunnistamiseen ja hajottamiseen: sääntöpohjaiset menetelmät, koneoppimismenetelmät ja tekoälyagentit. Sääntöpohjainen lähestymistapa saavuttaa 33 % tarkan tarkkuuden testitiedostoilla 100 % viereisen tarkkuuden kanssa alle sekunnin käsittelyajalla. Koneoppimismenetelmät saavuttavat 95–99 % tarkkuuden synteettisillä vertailudatoilla. Tekoälyagentit saavuttavat 100 % luokittelutarkkuuden neljällä yksittäisellä ajolla yksityiskohtaisilla suosituksilla. Lisävalidointi 19 reaalimaailman Java-luokalla osoitti sääntöpohjaisen tarkkuuden olevan 63 % ja koneoppimismenetelmän 74 %, mikä vahvistaa synteettisen arvioinnin rajoitukset. Työssä ehdotetaan kolmivaiheista hybridimenettelytapaa.
The Rule-Based approach implements threshold-based detection using the CK Metrics Suite (Chidamber & Kemerer, 1994), achieving 33% exact accuracy with 100% adjacent accuracy with sub-second processing times. The Machine Learning approach employs Random Forest, XGBoost, and Gradient Boosting classifiers with SMOTE data balancing and PCA variance analysis, achieving 95–99% accuracy on synthetic benchmark data, demonstrating pipeline correctness. The AI-Agent approach evaluates three Large Language Models — Claude 3.5 Sonnet, GPT-4 Turbo, and Gemini Pro — achieving 100% classification accuracy on four single-run evaluations with detailed refactoring suggestions, though with higher latency (15–45 seconds) and non-deterministic outputs.
Comparative analysis across six Java test files reveals complementary strengths: Rule-Based methods excel in CI/CD integration; ML approaches provide high accuracy with moderate overhead; AI-Agents deliver the highest quality recommendations for complex decomposition planning. Supplementary validation on 19 real-world classes from Apache and Spring Framework repositories yielded 63% rule-based and 74% ML accuracy (both with 100% adjacent accuracy), confirming that synthetic test data overestimates performance while providing preliminary evidence that ML classification adds value over fixed thresholds on real-world code. A hybrid methodology combining all three approaches is proposed for optimal results in enterprise software maintenance scenarios.
