Skip to main content
QUICK REVIEW

[Paper Review] DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning

Xiaodong Gu, Hongyu Zhang|arXiv (Cornell University)|Apr 25, 2017
Software Engineering ResearchComputer Science11 references17 citations
TL;DR

DeepAM is a deep learning system that enables automatic API migration between programming languages by learning joint semantic embeddings of API sequences using multi-modal sequence-to-sequence learning on a large-scale code corpus. It significantly outperforms state-of-the-art methods by mining 808,488 API mappings—over 8x more than StaMiner—while maintaining high accuracy (88.2% correctness) and achieving 72.4% alignment accuracy, surpassing traditional IR-based approaches.

ABSTRACT

Computer programs written in one language are often required to be ported to other languages to support multiple devices and environments. When programs use language specific APIs (Application Programming Interfaces), it is very challenging to migrate these APIs to the corresponding APIs written in other languages. Existing approaches mine API mappings from projects that have corresponding versions in two languages. They rely on the sparse availability of bilingual projects, thus producing a limited number of API mappings. In this paper, we propose an intelligent system called DeepAM for automatically mining API mappings from a large-scale code corpus without bilingual projects. The key component of DeepAM is based on the multimodal sequence to sequence learning architecture that aims to learn joint semantic representations of bilingual API sequences from big source code data. Experimental results indicate that DeepAM significantly increases the accuracy of API mappings as well as the number of API mappings, when compared with the state-of-the-art approaches.

Motivation & Objective

  • To address the scarcity of bilingual projects, which limits the number of available API mappings in existing migration tools.
  • To reduce manual effort in defining migration rules by automating the discovery of equivalent API sequences across languages.
  • To improve the accuracy and coverage of API mapping by learning deep semantic representations from large-scale commented code corpora.
  • To enable the mining of API mappings without requiring paired source and target language projects.

Proposed method

  • Extracts API sequences and their natural language descriptions from commented code snippets in a large corpus of 10 million code snippets.
  • Applies a multi-modal sequence-to-sequence learning model to embed both source and target language API sequences into a shared, high-dimensional semantic space.
  • Uses these joint embeddings to align semantically similar API sequences across languages by measuring vector similarity.
  • Leverages the aligned sequences to extract general API mappings using statistical machine translation techniques.
  • Employs a deep neural network architecture that jointly models API sequences and their textual descriptions to learn richer semantic representations than traditional shallow models.
  • Validates alignment quality via manual inspection of 500 randomly sampled pairs, comparing performance against an IR-based baseline using text similarity.

Experimental results

Research questions

  • RQ1Can a deep learning model effectively learn joint semantic representations of API sequences across programming languages without relying on bilingual projects?
  • RQ2How does the performance of multi-modal sequence-to-sequence learning compare to traditional IR-based methods in aligning equivalent API sequences?
  • RQ3To what extent can the proposed method scale in terms of the number of mined API mappings compared to state-of-the-art approaches?
  • RQ4Does the model maintain high accuracy even for longer API sequences that are more complex to map?

Key findings

  • DeepAM mined 808,488 API mappings, which is over 8 times more than StaMiner’s 100,825 mappings, demonstrating a significant scale-up in coverage.
  • The correctness of DeepAM’s mappings reached 88.2%, slightly higher than StaMiner’s 87.1%, indicating comparable or better quality despite the larger scale.
  • The alignment accuracy of DeepAM was 72.4%, substantially outperforming the IR-based baseline at 40.8%, proving the effectiveness of deep semantic embeddings.
  • DeepAM achieved particularly strong performance on longer API sequences, such as 'copy file' and 'play audio', which are challenging for traditional methods.
  • The system’s ability to learn from a large-scale code corpus without requiring bilingual projects enables broader applicability and scalability in real-world code migration.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.