Automatic Identification of Machine Learning-Specific Code Smells

2508.02541v1 cs.SE, cs.AI 2025-08-09
Авторы:

Peter Hamfelt, Ricardo Britto, Lincoln Rocha, Camilo Almendra

Резюме на русском

Увеличивающийся интерес к машинному обучению (ML) приводит к появлению новых типов кодовых запутанностей, которые могут повлиять на качество и эффективность ML-систем. Однако существуют недостаточно исследований и инструментов, посвященных идентификации и оценке таких ML-специфических кодовых запутанностей. В данной работе предлагается инструмент MLpylint, основанный на гуманных критериях кодовых запутанностей, для статического анализа ML-кода. Инструмент разработан с использованием Design Science Methodology, включая литературный обзор, консультации с экспертами и оценку на данных из 160 открытых ML-проектов. Экспертные оценки подтвердили эффективность MLpylint. Результаты указывают на возможность интеграции инструмента в разработческий процесс, что может повысить качество ML-систем и улучшить производительность разработчиков.

Abstract

Machine learning (ML) has rapidly grown in popularity, becoming vital to many industries. Currently, the research on code smells in ML applications lacks tools and studies that address the identification and validity of ML-specific code smells. This work investigates suitable methods and tools to design and develop a static code analysis tool (MLpylint) based on code smell criteria. This research employed the Design Science Methodology. In the problem identification phase, a literature review was conducted to identify ML-specific code smells. In solution design, a secondary literature review and consultations with experts were performed to select methods and tools for implementing the tool. We evaluated the tool on data from 160 open-source ML applications sourced from GitHub. We also conducted a static validation through an expert survey involving 15 ML professionals. The results indicate the effectiveness and usefulness of the MLpylint. We aim to extend our current approach by investigating ways to introduce MLpylint seamlessly into development workflows, fostering a more productive and innovative developer environment.

Ссылки и действия