DOI: 10.5281/zenodo.17990016
title: PatternForge: A Benchmark Dataset for Pattern-Based Refactoring of Code Smells

description: PatternForge Dataset and Artifacts


This repository provides the complete dataset and experimental artifacts used in the study:



PatternForge: A Multi-Agent LLM Framework for Refactoring Code Smells into Design Patterns


The repository is intended to support transparency, reproducibility, and reuse of the benchmark introduced in the paper. All artifacts required to inspect, reproduce, and extend the experimental results are publicly available.





Repository Contents


The dataset is organized according to a standardized and documented directory structure.Each instance corresponds to a single dominant code smell, a fixed complexity level, and a specific programming language.

dataset/ └── SmellType/ └── ComplexityLevel/ └── InstanceID/ ├── original/ # Original smelly implementation ├── refactored/ # Refactored version generated by PatternForge ├── tests/ # Executable test suite for behavioral validation └── metadata.json # Smell type, target pattern, language, complexity

This separation explicitly distinguishes input artifacts from generated outputs, preventing ambiguity between manually authored code and automatically refactored results.





Dataset Description


The dataset consists of 72 curated instances, evenly distributed across:



Six canonical code smellsLong Method, God Class, Feature Envy, Switch Statement, Data Class, Duplicated Code

Three complexity tiersEasy, Medium, Hard

Two statically typed object-oriented languagesJava and C#


Each instance is designed to exhibit one dominant architectural deficiency, following canonical definitions from the refactoring literature (e.g., Fowler, Kerievsky, Olbrich et al.).Overlapping or confounding smells are intentionally avoided to enable controlled, fine-grained architectural analysis.





Refactored Implementations


All code under the refactored/ directories is generated exclusively by the PatternForge framework using:



prompt-guided, multi-agent reasoning,

explicit pattern-role planning,

bounded validation with compilation and test execution.


No manual post-editing or corrective intervention has been applied to the refactored outputs.





Behavioral Validation


Each dataset instance includes an executable test suite under the tests/ directory.These tests are used to verify behavioral equivalence between the original and refactored implementations.

The test suites are intentionally lightweight and instance-specific, serving as a conservative oracle to detect functional deviations introduced during architecture-level refactoring.





Metadata


Each instance is accompanied by a metadata.json file containing:



code smell category,

target design pattern,

programming language,

complexity level,

instance identifier.


This metadata enables automated analysis, aggregation of results, and reproducibility of experimental configurations.



Intended Use


This dataset is designed for:



evaluating architecture-level refactoring frameworks,

studying pattern-aware automated refactoring,

benchmarking LLM-based multi-agent code transformation systems.


It is intended as a capability and feasibility benchmark, not as a large-scale industrial corpus.



License


This repository is released for research and academic use.Please refer to the LICENSE file for details.





Reviewer-Oriented Note


This repository is structured to ensure:



clear separation between original and generated artifacts,

full inspectability of refactoring outputs,

reproducibility of behavioral validation,

alignment with artifact availability standards expected by SCI-indexed journals.