Mapping APIs in Dynamic-typed Programs by Leveraging Transfer Learning

Author:

Huang Zhenfei1ORCID,Chen Junjie1ORCID,Jiang Jiajun1ORCID,Liang Yihua1ORCID,You Hanmo1ORCID,Li Fengjie1ORCID

Affiliation:

1. Tianjin University, Tianjin, China

Abstract

Application Programming Interface (API) migration is a common task for adapting software across different programming languages and platforms, where manually constructing the mapping relations between APIs is indeed time-consuming and error-prone. To facilitate this process, many automated API mapping approaches have been proposed. However, existing approaches were mainly designed and evaluated for mapping APIs of statically-typed languages, while their performance on dynamically-typed languages remains unexplored. In this article, we conduct the first extensive study to explore existing API mapping approaches’ performance for mapping APIs in dynamically-typed languages, for which we have manually constructed a high-quality dataset. According to the empirical results, we have summarized several insights. In particular, the source code implementations of APIs can significantly improve the effectiveness of API mapping. However, due to the confidentiality policy, they may not be available in practice. To overcome this, we propose a novel API mapping approach, named Matl , which leverages the transfer learning technique to learn the semantic embeddings of source code implementations from large-scale open-source repositories and then transfers the learned model to facilitate the mapping of APIs. In this way, Matl can produce more accurate API embedding of its functionality for more effective mapping without knowing the source code of the APIs. To evaluate the performance of Matl , we have conducted an extensive study by comparing Matl with state-of-the-art approaches. The results demonstrate that Matl is indeed effective as it improves the state-of-the-art approach by at least 18.36% for mapping APIs of dynamically-typed language and by 30.77% for mapping APIs of the statically-typed language.

Funder

National Natural Science Foundation of China

Publisher

Association for Computing Machinery (ACM)

Reference89 articles.

1. Accessed: May 2 2023. Bert. Retrieved from https://storage.googleapis.com/bert_models/2020_02_20/uncased_L-12_H-768_A-12.zip

2. Accessed: May 2 2023. CNTK. Retrieved from https://cntk.azurewebsites.net/pythondocs/

3. Accessed: May 2 2023. GitHub. Retrieved from https://github.com/

4. Accessed: May 2 2023. GraphCodeBert. Retrieved from https://github.com/microsoft/CodeBERT/tree/master/GraphCodeBERT/codesearch/

5. Accessed: May 2 2023. MXNet. Retrieved from https://mxnet.apache.org/

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3