Developers heavily rely on Application Programming Interfaces (APIs) from libraries to build their software. As software evolves, developers may need to replace the used libraries with alternate libraries, a process known as library migration. Doing this manually can be tedious, time-consuming, and prone to errors. Automated migration techniques can help alleviate some of this burden. However, designing effective automated migration techniques requires understanding the types of code changes required to transform client code that used the old library to the new library. This paper contributes an empirical study that provides a holistic view of Python library migrations, both in terms of the code changes required in a migration and the typical development effort involved. We manually label 3,096 migration-related code changes in 335 Python library migrations from 311 client repositories spanning 141 library pairs from 35 domains. Based on our labeled data, we derive a taxonomy for describing migration-related code changes, PyMigTax. Leveraging PyMigTax and our labeled data, we investigate various characteristics of Python library migrations, such as the types of program elements and properties of API mappings, the combinations of types of migration-related code changes in a migration, and the typical development effort required for a migration. Our findings highlight various potential shortcomings of current library migration tools. For example, we find that 40% of library pairs have API mappings that involve non-function program elements, while most library migration techniques typically assume that function calls from the source library will map into (one or more) function calls from the target library. As an approximation for the development effort involved, we find that, on average, a developer needs to learn about 4 APIs and 2 API mappings to perform a migration, and ... (truncated)
LibRec: Benchmarking Retrieval-Augmented LLMs for Library Migration Recommendations
School of Computer and Computing Science, Hangzhou City University(杭州城市大学计算机与计算科学学院);Polytechnic Institute, Zhejiang University(浙江大学多技术学院);School of Computer Science, Shanghai Jiao Tong University(上海交通大学计算机科学学院);School of Computer Science and Technology, Harbin Institute of Technology(哈尔滨工业大学深圳学院);College of Computer Science and Technology, Huazhong University of Science and Technology(华中科技大学计算机科学与技术学院);School of Computing and Information Systems, Singapore Management University(新加坡管理大学计算机与信息科学学院);College of Computer Science and Technology, Zhejiang University(浙江大学计算机科学与技术学院)
MVOS_HSI: A Python Library for Preprocessing Agricultural Crop Hyperspectral Data
Machine Vision and Optical Sensor (MVOS) Lab, Dept. of Agricultural and Biosystems Engineering, South Dakota State University(农业与生物系统工程系机器视觉与光学传感器实验室,南达科他州立大学);USDA/ARS Environmental Microbial and Food Safety Laboratory(美国农业部/动植物卫生检验局环境微生物与食品安全实验室);Department of Agricultural and Biological Engineering, University of Florida(农业与生物工程系,佛罗里达大学)