Skip to main content
QUICK REVIEW

[論文レビュー] A4: Automatically Assisting Android API Migrations Using Code Examples.

Maxime Lamothe, Weiyi Shang|arXiv (Cornell University)|Dec 12, 2018
Software Engineering Research参考文献 62被引用数 14
ひとこと要約

本論文では、Google Samplesなどのコード例からAndroid API移行パターンを自動で学習し、それを実際のAndroidアプリに適用するA4という手法を提案する。コード例における使用法の変更を分析することで、80件のケースのうち71件でAPI移行を成功させ、呼び出しの自動移行または実行可能なガイダンスを提供した。

ABSTRACT

The fast-paced evolution of Android APIs has posed a challenging task for Android app developers. To leverage the newly and frequently released APIs from Android, developers often must spend considerable effort on API migrations. Prior research work and Android official documentation typically provide enough information to guide developers in identifying both the changed API calls that need to be migrated and the corresponding API calls in the new version of Android (what to migrate). However, the API migration task is still challenging since developers lack the knowledge of how to migrate the API calls. In addition to the official documentation, there exist code examples, such as Google Samples, that illustrate the usage of APIs. We posit that by analyzing the changes of API usage in code examples, we may be able to learn API migration patterns to assist developers with API migrations. In this paper, we propose an approach that automatically learns API migration patterns from code examples and applies these patterns to the source code of Android apps for API migration. To evaluate our approach, we migrate API calls in open source Android apps by learning API migration patterns from both public and manually generated code examples. We find that our approach can successfully learn API migration patterns and provide API migration assistance in 71 out of 80 cases. In particular, our approach can either automatically migrate API calls with little to no extra modifications needed or provide guidance to assist with the migrations. Our approach can be adopted by Android developers to reduce the effort they spend on regularly migrating Android APIs.

研究の動機と目的

  • 頻繁なAPI変更に起因する、手作業で時間がかかるAndroid API移行の課題に対処すること。
  • 単に「何を移行すべきか」を知るのではなく、「どのように移行するか」についての開発者知識のギャップを埋めること。
  • 公開済みのコード例(例:Google Samples)を活用して再利用可能な移行パターンを抽出すること。
  • 学習したパターンを実際のAndroidアプリコードに適用する自動化システムを開発し、実用的な移行支援を提供すること。

提案手法

  • Google Samplesのような公開コード例におけるAndroidバージョン間でのAPI使用法の変更を分析し、移行パターンを抽出する。
  • 古いAPI呼び出しを新しいものにマッピングする変換ルールとして、API移行パターンを定式化し、対応する使用意味を保持する。
  • Androidバージョン間のコード例のAST(抽象構文木)を解析・比較することで、API使用法における意味的変更を検出する。
  • オープンソースAndroidアプリのソースコードに学習済みの移行パターンを適用し、移行の提案または自動移行を実行する。
  • ヒューリスティクスおよび構文的・意味的マッチングを用いて、適用前の移行提案の検証と精練を実施する。

実験結果

リサーチクエスチョン

  • RQ1コード例は、Android API移行に再利用可能なパターンを効果的に明らかにできるか?
  • RQ2自動で学習された移行パターンは、実世界のAndroidアプリにどの程度適用可能か?
  • RQ3提案されたアプローチが生成する移行提案は、実際の移行シナリオにおいてどれほど正確で実用的か?
  • RQ4公式ドキュメントのみに依存する場合と比較して、このシステムは開発者の移行作業負荷をどれほど軽減できるか?

主な発見

  • 提案手法は、テストした80件のケースのうち71件でAPI移行パターンを効果的に学習および適用した。
  • 71%のケースで、システムは最小限または完全に手動介入なしにAPI呼び出しを自動で移行した。
  • 残りの9件のケースでは、開発者が移行を完了できるよう、実行可能なガイダンスを提供した。
  • 公式ドキュメントのみに依存する場合と比較して、本手法は具体的な使用例に基づいた移行例を提供することで優れた性能を示した。
  • 本手法は実際のオープンソースAndroidアプリにおいて実用的応用が可能であることが示され、開発ワークフローへの統合の強い可能性を示した。

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。