Reproducibility Package for "Validating LLM-Generated Monolith Decompositions with Structural Evidence from Source Code"
收藏资源简介:
This repository contains all artifacts required to reproduce the experimental evaluation described in the paper "Validando Decomposições de Monólitos Geradas por LLMs com Evidências Estruturais do Código-Fonte" (submitted to the Software Engineering course). The study assesses the structural adherence of microservice decompositions produced by the Gemini gemini-pro-latest large language model, using zero-shot and few-shot prompting strategies. Two open-source Java systems—Spring PetClinic and Bookstore—are used as subjects. The package includes: Generation scripts: gemini_agent.py, which calls the Gemini API to produce 30 independent decomposition CSV files for each combination of system and prompting strategy (120 files total). Validation pipeline: Python scripts (violation_detection.py, static analysis modules) that extract dependency graphs from source code using Tree-sitter and NetworkX, map classes to services, detect structural violations, and compute the metrics TVD (Dependency Violation Rate), TPD (Dependency Preservation Rate), and granularity. Batch evaluation scripts: batch_bookstore_normalized.py and batch_petclinic_normalized.py that process all generated CSV files, produce raw metric CSVs (30 runs per strategy), and compute normalized metrics by intersecting the class-to-service mappings of the two strategies to control for coverage bias. Input data: source code of the monoliths (PetClinic and Bookstore), textual requirements, and few-shot examples. Intermediate outputs: dependency graphs in GraphML format, edge lists, and class-to-service mapping tables. Compiled results: raw metrics CSV (resultados_bookstore_30_runs.csv, resultados_petclinic_30_runs.csv) and normalized metrics CSV (resultados_bookstore_30_runs_normalized.csv, resultados_petclinic_30_runs_normalized.csv). Statistical analysis: scripts and a Markdown report (Statistical_Results.md) that present descriptive statistics, Mann‑Whitney U tests, confidence intervals, and effect sizes, along with the pgfplots code for the figures embedded in the paper. Instructions: a README.md file detailing the required environment (Python 3.8+, Tree-sitter, NetworkX, Pandas, google-generativeai) and step-by-step commands to regenerate decompositions, run evaluations, and reproduce the statistical analyses. All artifacts are organized to facilitate reuse and extension with other systems or LLMs.



