Skip to main content
QUICK REVIEW

[論文レビュー] How and Why did developers migrate Android Applications from Java to Kotlin? A study based on code analysis and interviews with developers.

Matías Martínez, Bruno Góis Mateus|arXiv (Cornell University)|Mar 28, 2020
Mobile and Web Applications被引用数 10
ひとこと要約

本研究では、Android開発者がJavaからKotlinに移行する理由と方法を、374のAndroidアプリのコードコミットを分析し、独自開発したツールMigAを用い、78名の開発者へのインタビューを通じて調査した。移行のための10の主要な動機を特定し、移行過程における実用的な課題と戦略についての実践的知見を提供している。

ABSTRACT

Nowadays, the majority of the apps running on mobile devices are Android apps developed in Java. However, developers now have the possibility to write Android applications using a new programming language: Kotlin. Android developers can: a) start writing an Android application from scratch using Koltin, b) evolve their existing Android applications written in Java by adding Kotlin code (that is possible thanks to the interoperability between those languages), or c) migrate their Android apps from Java to Kotlin. This paper aims at studying this latter case. We want to know Why and How Android developers have migrated Java code to Kotlin. For that, we first built a tool, named MigA, which analyzes the history of applications having Java and Kotlin code and is able to detect commits that migrate code. We executed MigA on a dataset with 374 Android applications. Then, we interviewed 78 developers from those applications that have written, at least, one commit that migrates Java code to Kotlin. Our main goal was to know why those developers have done that code migrations. This paper presents the main ten reasons of migration that we obtained from the interviews. Moreover, by combining code analysis done by MigA and the information obtained from the interviews, we present a deeper characterization of the migration activity. Finally, we present and discuss the experiences and advises we obtained from developers that migrated code.

研究の動機と目的

  • 既存のアプリケーションにおいて、Android開発者がJavaからKotlinに移行する動機を理解すること。
  • コードベースを移行する意思決定に影響する技術的および組織的要因を分析すること。
  • 自動化されたコード解析と開発者インタビューを通じて、実際の移行プロセスを特徴づけること。
  • JavaからKotlinへの移行を完了させた開発者から得た実践的経験と提言を抽出すること。

提案手法

  • バージョン管理履歴を分析することで、JavaコードをKotlinに移行するコミットを特定するツールMigAを開発した。
  • JavaとKotlinの両方のコードを含む374のAndroidアプリケーションのデータセットに対して、MigAを実行した。
  • 少なくとも1回の移行コミットを実施した78名の開発者に対して、準構造的インタビューを実施した。
  • MigAによる定量的コード解析とインタビューによる定性的インサイトを統合し、移行パターンと動機を特徴づけた。
  • インタビュー回答に基づいて移行理由を分類し、コードレベルの観察と照合することで、調査結果を検証した。

実験結果

リサーチクエスチョン

  • RQ1AndroidアプリケーションをJavaからKotlinに移行する際、開発者が主にどのような理由で移行を選びますか?
  • RQ2開発者は実際のプロジェクトで、どのようにJavaコードをKotlinに移行していますか?
  • RQ3移行プロセス中に一般的に観察される課題と戦略は何ですか?
  • RQ4プロジェクトの規模やチーム構成の違いによって、移行パターンはどのように異なりますか?

主な発見

  • 移行の上位10の理由には、コードの簡潔さの向上、より良いnull安全性、Kotlinにおけるツールサポートの向上が含まれる。
  • 80%を超える移行コミットが、個々のメソッドやクラスの変換といった小規模な変更を含んでおり、大規模なリファクタリングではない。
  • 開発者たちは頻繁に、Kotlinのnull安全性と拡張関数が、言語採用の主な動機であると述べた。
  • JavaとKotlinの相互運用性により、段階的移行が可能になり、既存の機能を破壊するリスクが低減された。
  • 多くの開発者が、Kotlinによりコードの可読性が向上し、ボイラー・プレートが削減されたと報告しており、長期的な保守性向上に寄与した。
  • 移行プロセスはしばしば反復的かつチーム主導であり、複数の開発者が時間をかけて移行に貢献していた。

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

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

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

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