Since Google introduced Kotlin as an official programming language for developing Android apps in 2017, Kotlin has gained widespread adoption in Android development. However, compared to Java, there is limited support for Kotlin code dependency analysis, which is the foundation to software analysis. To bridge this gap, we developed Depends-Kotlin to extract entities and their dependencies in Kotlin source code. Not only does Depends-Kotlin support extracting entities' dependencies in Kotlin code, but it can also extract dependency relations between Kotlin and Java. The extraction of such cross-language dependencies can help developers understand the migration process from Java to Kotlin. Additionally, we used a Java project with confirmed dependencies as a benchmark and converted this project to two projects: Kotlin-only and a combination of Kotlin and Java. The dependencies in these two projects were then extracted using our tool. The consistency observed among dependency relations in all three projects confirms the accuracy of Depends-Kotlin. Furthermore, the performance of Depends-Kotlin was assessed using another three projects of varying sizes. The source code of Depends-Kotlin and the dataset used in this demo paper have been uploaded to https://github.com/XYZboom/depends-kotlin. We also provided a screencast presenting Depends-Kotlin https://youtu.be/daZuXOwn1Ls.
翻译:自谷歌于2017年将Kotlin列为Android应用开发的官方编程语言以来,Kotlin在Android开发中获得了广泛采用。然而,与Java相比,Kotlin代码依赖分析的支持较为有限,而依赖分析是软件分析的基础。为弥补这一差距,我们开发了Depends-Kotlin,用于提取Kotlin源代码中的实体及其依赖关系。Depends-Kotlin不仅能提取Kotlin代码中实体的依赖关系,还能提取Kotlin与Java之间的跨语言依赖关系。这种跨语言依赖关系的提取有助于开发者理解从Java迁移到Kotlin的过程。此外,我们以一个具有已知依赖关系的Java项目为基准,将该项目转换为两个项目:纯Kotlin项目以及Kotlin与Java混合项目。然后使用我们的工具提取这两个项目中的依赖关系。三个项目中依赖关系的一致性验证了Depends-Kotlin的准确性。进一步地,我们使用另外三个规模不同的项目评估了Depends-Kotlin的性能。Depends-Kotlin的源代码以及本演示论文所使用的数据集已上传至https://github.com/XYZboom/depends-kotlin。我们还提供了展示Depends-Kotlin的屏幕录像:https://youtu.be/daZuXOwn1Ls。