Mining Unit Tests for Discovery and Migration of Math APIs

Author:

Santhiar Anirudh1,Pandita Omesh1,Kanade Aditya1

Affiliation:

1. Indian Institute of Science

Abstract

Today's programming languages are supported by powerful third-party APIs. For a given application domain, it is common to have many competing APIs that provide similar functionality. Programmer productivity therefore depends heavily on the programmer's ability to discover suitable APIs both during an initial coding phase, as well as during software maintenance. The aim of this work is to support the discovery and migration of math APIs. Math APIs are at the heart of many application domains ranging from machine learning to scientific computations. Our approach, called M ath F inder , combines executable specifications of mathematical computations with unit tests (operational specifications) of API methods. Given a math expression, M ath F inder synthesizes pseudo-code comprised of API methods to compute the expression by mining unit tests of the API methods. We present a sequential version of our unit test mining algorithm and also design a more scalable data-parallel version. We perform extensive evaluation of M ath F inder (1) for API discovery , where math algorithms are to be implemented from scratch and (2) for API migration , where client programs utilizing a math API are to be migrated to another API. We evaluated the precision and recall of M ath F inder on a diverse collection of math expressions, culled from algorithms used in a wide range of application areas such as control systems and structural dynamics. In a user study to evaluate the productivity gains obtained by using M ath F inder for API discovery, the programmers who used M ath F inder finished their programming tasks twice as fast as their counterparts who used the usual techniques like web and code search, IDE code completion, and manual inspection of library documentation. For the problem of API migration, as a case study, we used M ath F inder to migrate Weka, a popular machine learning library. Overall, our evaluation shows that M ath F inder is easy to use, provides highly precise results across several math APIs and application domains even with a small number of unit tests per method, and scales to large collections of unit tests.

Funder

Indian Institute of Science

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference61 articles.

1. P. J. Acklam. 2003. MATLAB array manipulation tips and tricks. http://home.online.no/∼pjacklam/matlab/doc/mtt/doc/mtt.pdf. (Oct. 2003). P. J. Acklam. 2003. MATLAB array manipulation tips and tricks. http://home.online.no/∼pjacklam/matlab/doc/mtt/doc/mtt.pdf. (Oct. 2003).

2. Refactoring support for class library migration

3. Swing to SWT and back: Patterns for API migration by wrapping

Cited by 5 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Mining Software Information Sites to Recommend Cross-Language Analogical Libraries;2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER);2022-03

2. Mining Likely Analogical APIs Across Third-Party Libraries via Large-Scale Unsupervised API Semantics Embedding;IEEE Transactions on Software Engineering;2021-03-01

3. A Multi-Metric Ranking Approach for Library Migration Recommendations;2021 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER);2021-03

4. Monotone Precision and Recall Measures for Comparing Executions and Specifications of Dynamic Systems;ACM Transactions on Software Engineering and Methodology;2020-07-31

5. Discovering discrepancies in numerical libraries;Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis;2020-07-13

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

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

www.globalauthorid.com

TOP

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