SOAR:数据科学重构的综合方法API
SOAR: A Synthesis Approach for Data Science API Refactoring
摘要:
随着开源源数据科学界的发展,数据科学库的数量和同一库的版本数量都在迅速增加。为了与这些库中不断发展的API相匹配,开源组织通常必须手动重构代码库中使用的API。此外,由于类似的开源库非常丰富,从事某个应用程序的数据科学家可能有大量的库可供选择、维护和迁移。API之间的手动重构是一项繁琐且容易出错的任务。尽管最近的研究工作是在不同语言之间执行自动API重构,但以前的工作依赖于使用收集的成对训练数据进行统计学习以进行API匹配和迁移。使用大型统计数据进行重构并不理想,因为这样的训练数据将不可用于新的库或相同库的新版本。我们介绍了一种新的技术,不需要训练数据就可以实现API的迁移和重构。SOAR仅依赖于库发布时随时可用的文档来学习API表示和库之间的映射。使用程序合成,SOAR自动计算API参数的正确配置以及调用这些API所需的任何粘合代码。在运行重构代码时,SOAR还使用解释器的错误消息来生成逻辑约束,这些约束可用于修剪搜索空间。我们的实证评估表明,SOAR可以成功重构80%的基准测试,对应于多达44层的深度学习模型,平均运行时间为97.23秒,90%的数据争用基准测试,平均运行时间为17.31秒。
英文摘要:
With the growth of the open-source data science community, both the number of data science libraries and the number of versions for the same library are increasing rapidly. To match the evolving APIs from those libraries, open-source organizations often have to exert manual effort to refactor the APIs used in the code base. Moreover, due to the abundance of similar open-source libraries, data scientists working on a certain application may have an abundance of libraries to choose, maintain and migrate between. The manual refactoring between APIs is a tedious and error-prone task. Although recent research efforts were made on performing automatic API refactoring between different languages, previous work relies on statistical learning with collected pairwise training data for the API matching and migration. Using large statistical data for refactoring is not ideal because such training data will not be available for a new library or a new version of the same library. We introduce Synthesis for Open-Source API Refactoring (SOAR), a novel technique that requires no training data to achieve API migration and refactoring. SOAR relies only on the documentation that is readily available at the release of the library to learn API representations and mapping between libraries. Using program synthesis, SOAR automatically computes the correct configuration of arguments to the APIs and any glue code required to invoke those APIs. SOAR also uses the interpreter's error messages when running refactored code to generate logical constraints that can be used to prune the search space. Our empirical evaluation shows that SOAR can successfully refactor 80% of our benchmarks corresponding to deep learning models with up to 44 layers with an average run time of 97.23 seconds, and 90% of the data wrangling benchmarks with an average run time of 17.31 seconds.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。