Software Engineering
Researchers Build Large-Scale Code Smell Dataset to Improve Software Quality Detection
A new semi-automated approach combines human expertise with machine learning to create a high-quality benchmark dataset for identifying design flaws in software.
Identifying code smells—subtle design and implementation issues that undermine software maintainability—has become a critical task as machine learning techniques increasingly support automated refactoring work. Yet applying these techniques at scale has hit a fundamental roadblock: the scarcity of reliable, labeled datasets large enough to train effective models.
The Dataset Challenge#
Building robust training data for code smell detection presents conflicting pressures. Manual curation guarantees quality and accuracy but demands extensive expertise and months of tedious work from experienced developers. Fully automated generation, conversely, can produce thousands of labeled samples at scale but frequently sacrifices label reliability and introduces noise that degrades model performance. Researchers have struggled to find a middle ground that balances speed with rigor.
A Hybrid Solution#
To bridge this gap, researchers developed a semi-automatic generation strategy that leverages both machines and human judgment. The workflow begins with automatic rules that flag candidate code samples exhibiting smell patterns. A suite of metrics then sorts samples into two streams: those confident enough to accept outright, and those ambiguous enough to warrant expert review. This triage approach focuses limited human effort where it matters most—on edge cases that machines find uncertain.
The team built structured annotation guidelines and created a specialized review tool to standardize how reviewers evaluate borderline samples, reducing subjective variation and ensuring consistent labeling quality.
The SACS Dataset#
Using this hybrid approach, the researchers created SACS (Semantic Analysis of Code Smells), an open-source dataset now available to the research community. The benchmark covers three widely-studied code smell categories—Long Method, Large Class, and Feature Envy—with more than 10,000 labeled examples in each category. This volume makes SACS substantially larger and more accessible than prior efforts.
The dataset is intended to serve as a public foundation for advancing code smell detection research and fueling development of better automated refactoring tools that can help developers maintain codebases more effectively.