Proceedings

APIMig: A Project-Level Cross-Multi-Version API Migration Framework Based on Evolution Knowledge Graph

Download BibTeX Cite

Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 7455-7463.

https://doi.org/10.24963/ijcai.2025/829

Abstract

API migration is essential for software maintenance due to the rapid evolution of third-party libraries where API elements may change continuously through updates. There are two main challenges for API migration at the project level, especially across multiple versions: 1) lack of specific library evolution knowledge across multi-version; 2) difficulty in identifying the chain of changes at the project level. This paper proposes a project-level cross-multi-version API migration framework APIMig. We first construct an API evolution knowledge graph (KG) to capture changes between adjacent library versions and then derive coherent cross-version API evolution knowledge by KG reasoning. Second, we design a chain exploration algorithm to track the chain of changes and aggregate the affected code segments. Finally, a large language model is employed in completing API migration by providing the API evolution knowledge and the chain of changes. We construct an evolution KG for the Lucene library from version 4.0.0 to 10.1.0 and evaluate our approach through project migration pairs that depend on different major versions. Our framework shows improvements over the baseline in migrating projects across 7 major versions, achieving average increases of 16.52% in CodeBLEU scores and 28.49% in VCEU scores in GPT-4o.

  1. [Almeida et al., 2024] Aylton Almeida, Laerte Xavier, and Marco Túlio Valente. Automatic library migration using large language models: First results. In Xavier Franch, Maya Daneva, Silverio Martínez-Fernández, and Luigi Quaranta, editors, Proceedings of the 18th ACM/IEEE In- ternational Symposium on Empirical Software Engineer- ing and Measurement, ESEM 2024, Barcelona, Spain, Oc- tober 24-25, 2024, pages 427-433. ACM, 2024.
  2. [Bai et al., 2024] Weiheng Bai, Keyang Xuan, Pengxiang Huang, Qiushi Wu, Jianing Wen, Jingjing Wu, and Kangjie Lu. Apilot: Navigating large language models to generate secure code by sidestepping outdated api pitfalls. arXiv preprint arXiv:2409.16526, 2024.
  3. [Bairi et al., 2024] Ramakrishna Bairi, Atharv Sonwane, Aditya Kanade, Vageesh D. C., Arun Iyer, Suresh Parthasarathy, Sriram K. Rajamani, Balasubramanyan Ashok, and Shashank Shet. Codeplan: Repository-level coding using llms and planning. Proc. ACM Softw. Eng., 1(FSE):675-698, 2024.
  4. [Fazzini et al., 2019] Mattia Fazzini, Qi Xin, and Alessan- dro Orso. Automated api-usage update for android apps. In Dongmei Zhang and Anders Møller, editors, Proceed- ings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2019, Beijing, China, July 15-19, 2019, pages 204-215. ACM, 2019.
  5. [Kula et al., 2015] Raula Gaikovina Kula, Daniel M. Germán, Takashi Ishio, and Katsuro Inoue. Trusting a library: A study of the latency to adopt the latest maven release. In Yann-Gaël Guéhéneuc, Bram Adams, and Alexander Serebrenik, editors, 22nd IEEE International Conference on Software Analysis, Evolution, and Reengi- neering, SANER 2015, Montreal, QC, Canada, March 2-6, 2015, pages 520-524. IEEE Computer Society, 2015.
  6. [Kula et al., 2018] Raula Gaikovina Kula, Daniel M. Germán, Ali Ouni, Takashi Ishio, and Katsuro Inoue. Do developers update their library dependencies? -an empirical study on the impact of security advisories on library migration. Empir. Softw. Eng., 23(1):384-417, 2018.
  7. [Lam et al., 2020] Patrick Lam, Jens Dietrich, and David J Pearce. Putting the semantics into semantic version- ing. In Proceedings of the 2020 ACM SIGPLAN Interna- tional Symposium on New Ideas, New Paradigms, and Re- flections on Programming and Software, pages 157-179, 2020.
  8. [Lamothe et al., 2022] Maxime Lamothe, Weiyi Shang, and Tse-Hsun Peter Chen. A3: assisting android API migra- tions using code examples. IEEE Trans. Software Eng., 48(2):417-431, 2022.
  9. [Liu et al., 2023] Mingwei Liu, Yanjun Yang, Yiling Lou, Xin Peng, Zhong Zhou, Xueying Du, and Tianyong Yang. Recommending analogical apis via knowledge graph em- bedding. In Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pages 1496-1508, 2023.
  10. [Mahmud et al., 2021] Tarek Mahmud, Meiru Che, and Guowei Yang. Android compatibility issue detection using api differences. In 2021 IEEE international conference on software analysis, evolution and reengineering (SANER), pages 480-490. IEEE, 2021.
  11. [Nguyen et al., 2010] Hoan Anh Nguyen, Tung Thanh Nguyen, Gary Wilson Jr., Anh Tuan Nguyen, Miryung Kim, and Tien N. Nguyen. A graph-based approach to API usage adaptation. In William R. Cook, Siobhán Clarke, and Martin C. Rinard, editors, Proceedings of the 25th An- nual ACM SIGPLAN Conference on Object-Oriented Pro- gramming, Systems, Languages, and Applications, OOP- SLA 2010, October 17-21, 2010, Reno/Tahoe, Nevada, USA, pages 302-321. ACM, 2010.
  12. [Nielsen et al., 2021] Benjamin Barslev Nielsen, Mar- tin Toldam Torp, and Anders Møller. Semantic patches for adaptation of javascript programs to evolving libraries. In 43rd IEEE/ACM International Conference on Software Engineering, ICSE 2021, Madrid, Spain, 22-30 May 2021, pages 74-85. IEEE, 2021.
  13. [Preston-Werner, 2013] Tom Preston-Werner. Semantic ver- sioning 2.0.0, 2013.
  14. [Ren et al., 2020] Shuo Ren, Daya Guo, Shuai Lu, Long Zhou, Shujie Liu, Duyu Tang, Neel Sundaresan, Ming Zhou, Ambrosio Blanco, and Shuai Ma. Codebleu: a method for automatic evaluation of code synthesis. arXiv preprint arXiv:2009.10297, 2020.
  15. [Wang and Yu, 2022] Kai Wang and Ping Yu. Augraft: Graft new API usage into old code. In Internetware 2022: 13th Asia-Pacific Symposium on Internetware, Hohhot, China, June 11 -12, 2022, pages 55-64. ACM, 2022.
  16. [Wang et al., 2020] Ying Wang, Bihuan Chen, Kaifeng Huang, Bowen Shi, Congying Xu, Xin Peng, Yijian Wu, and Yang Liu. An empirical study of usages, updates and risks of third-party libraries in java projects. In 2020 IEEE International Conference on Software Maintenance and Evolution (ICSME), pages 35-45. IEEE, 2020.
  17. [Wu et al., 2024] Tongtong Wu, Weigang Wu, Xingyu Wang, Kang Xu, Suyu Ma, Bo Jiang, Ping Yang, Zhen- chang Xing, Yuan-Fang Li, and Gholamreza Haffari. Ver- sicode: Towards version-controllable code generation. CoRR, abs/2406.07411, 2024.
  18. [Xu et al., 2019] Shengzhe Xu, Ziqi Dong, and Na Meng. Meditor: inference and application of API migration edits. In Yann-Gaël Guéhéneuc, Foutse Khomh, and Federica Sarro, editors, Proceedings of the 27th International Con- ference on Program Comprehension, ICPC 2019, Mon- treal, QC, Canada, May 25-31, 2019, pages 335-346. IEEE / ACM, 2019.
  19. [Yan et al., 2024] Jiwei Yan, Jinhao Huang, Hengqin Yang, and Jun Yan. Exception-aware lifecycle-model construc- tion for framework apis. CHINESE JOURNAL OF COM- PUTERS, 47(09):1989-2008, 2024.
  20. [Zan et al., 2022] Daoguang Zan, Bei Chen, Zeqi Lin, Bei Guan, Yongji Wang, and Jian-Guang Lou. When language model meets private library. In Yoav Goldberg, Zornitsa Kozareva, and Yue Zhang, editors, Findings of the As- sociation for Computational Linguistics: EMNLP 2022, Abu Dhabi, United Arab Emirates, December 7-11, 2022, pages 277-288. Association for Computational Linguis- tics, 2022.
  21. [Zhao et al., 2024] Ruilin Zhao, Feng Zhao, Long Wang, Xianzhi Wang, and Guandong Xu. Kg-cot: Chain-of- thought prompting of large language models over knowl- edge graphs for knowledge-aware question answering. In Proceedings of the Thirty-Third International Joint Con- ference on Artificial Intelligence (IJCAI-24), pages 6642- 6650. International Joint Conferences on Artificial Intelli- gence, 2024.
  22. [Zhong and Meng, 2024] Hao Zhong and Na Meng. Compiler-directed migrating api callsite of client code. In Proceedings of the IEEE/ACM 46th International Conference on Software Engineering, pages 1-12, 2024.
  23. [Zhou et al., 2023a] Bingzhe Zhou, Xinying Wang, Sheng- bin Xu, Yuan Yao, Minxue Pan, Feng Xu, and Xiaoxing Ma. Hybrid api migration: A marriage of small api map- ping models and large language models. In Proceedings of the 14th Asia-Pacific Symposium on Internetware, pages 12-21, 2023.
  24. [Zhou et al., 2023b] Shuyan Zhou, Uri Alon, Frank F. Xu, Zhengbao Jiang, and Graham Neubig. Docprompting: Generating code by retrieving the docs. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenRe- view.net, 2023.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards