Discovering Repetitive Code Changes in Python ML Systems
Malinda Dilhara, Ameya Ketkar, Nikhith Sannidhi, Danny Dig
Abstract
Over the years, researchers capitalized on the repetitiveness of software changes to automate many software evolution tasks. Despite the extraordinary rise in popularity of Python-based ML systems, they do not benefit from these advances. Without knowing what are the repetitive changes that ML developers make, researchers, tool, and library designers miss opportunities for automation, and ML developers fail to learn and use best coding practices. To fill the knowledge gap and advance the science and tooling in ML software evolution, we conducted the first and most finegrained study on code change patterns in a diverse corpus of 1000 top-rated ML systems comprising 58 million SLOC. To conduct this study we reuse, adapt, and improve upon the state-of-the-art repetitive change mining techniques. Our novel tool, R-CPatMiner, mines over 4M commits and constructs 350K fine-grained change graphs and detects 28K change patterns. Using thematic analysis, we identified 22 pattern groups and we reveal 4 major trends of how ML developers change their code. We surveyed 650 ML developers to further shed light on these patterns and their applications, and we received a 15% response rate. We present actionable, empiricallyjustified implications for four audiences: (i) researchers, (ii) tool builders, (iii) ML library vendors, and (iv) developers and educators.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
8 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- PYEVOLVE: Automating Frequent Code Changes in Python ML Systems cites Making Python code idiomatic by automatic refactoring non-idiomatic Python code with pythonic idioms
- PYEVOLVE: Automating Frequent Code Changes in Python ML Systems cites Inferring and Applying Type Changes
- A comprehensive study on challenges in deploying deep learning based software cites Taxonomy of real faults in deep learning systems
- DeepCrime: mutation testing of deep learning systems based on real faults cites Taxonomy of real faults in deep learning systems
- Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Example cites Making Python code idiomatic by automatic refactoring non-idiomatic Python code with pythonic idioms
- Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Example cites PYEVOLVE: Automating Frequent Code Changes in Python ML Systems
- Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Example cites Inferring and Applying Type Changes
Cited by top-tier papers8
- PYEVOLVE: Automating Frequent Code Changes in Python ML SystemsMalinda Dilhara, Danny Dig, Ameya KetkarICSE 2023 · 46 citations
- Making Python code idiomatic by automatic refactoring non-idiomatic Python code with pythonic idiomsZejun Zhang, Zhenchang Xing, Xin Xia, Xiwei Xu et al.FSE 2022 · 35 citations
- Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by ExampleMalinda Dilhara, Abhiram Bellur, Timofey Bryksin, Danny DigFSE 2024 · 18 citations
- Inferring and Applying Type ChangesAmeya Ketkar, Oleg Smirnov, Nikolaos Tsantalis, Danny Dig et al.ICSE 2022 · 17 citations
- Manas: Mining Software Repositories to Assist AutoMLGiang Nguyen, Md Johirul Islam, Rangeet Pan, Hridesh RajanICSE 2022 · 15 citations
Builds on14
- Taxonomy of real faults in deep learning systemsNargiz Humbatova, Gunel Jahangirova, Gabriele Bavota, Vincenzo Riccio et al.ICSE 2020 · 281 citations
- Is neuron coverage a meaningful measure for testing deep neural networks?Fabrice Harel-Canada, Lingxiao Wang, Muhammad Ali Gulzar, Quanquan Gu et al.FSE 2020 · 149 citations
- A comprehensive study of deep learning compiler bugsQingchao Shen, Haoyang Ma, Junjie Chen, Yongqiang Tian et al.FSE 2021 · 123 citations
- A comprehensive study on challenges in deploying deep learning based softwareZhenpeng Chen, Yanbin Cao, Yuanqiang Liu, Haoyu Wang et al.FSE 2020 · 121 citations
- DeepCrime: mutation testing of deep learning systems based on real faultsNargiz Humbatova, Gunel Jahangirova, Paolo TonellaISSTA 2021 · 114 citations
Related papers
- From Code Changes to Quality Gains: An Empirical Study in Python ML Systems with PyQuMohamed Almukhtar, Anwar Ghammam, Marouane Kessentini, Hua MingICSE 2026
- Understanding type changes in JavaAmeya Ketkar, Nikolaos Tsantalis, Danny DigFSE 2020 · 17 citations
- An Empirical Study of Refactorings and Technical Debt in Machine Learning SystemsYiming Tang, Raffi Khatchadourian, Mehdi Bagherzadeh, Rhia Singh et al.ICSE 2021 · 60 citations
- API recommendation for machine learning libraries: how far are we?Moshi Wei, Yuchao Huang, Junjie Wang, Jiho Shin et al.FSE 2022 · 6 citations
- A Large-Scale Study of Model Integration in ML-Enabled Software SystemsYorick Sens, Henriette Knopp, Sven Peldszus, Thorsten BergerICSE 2025 · 3 citations
