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 develop 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. Using three open-source Kotlin-Java mixing projects as our subjects, Depends-Kotlin demonstrates high accuracy and performance in resolving Kotlin-Kotlin and Kotlin-Java dependencies relations. The source code of Depends-Kotlin and the dataset used have been made available at https: //github.com/XYZboom/depends-kotlin. We also provide a screen-cast presenting Depends-Kotlin at https://youtu.be/ZPq8SRhgXzM.
翻译:自 2017 年 Google 将 Kotlin 引入作为 Android 应用开发的官方编程语言以来,Kotlin 在 Android 开发中获得了广泛采用。然而,与 Java 相比,对作为软件分析基础的 Kotlin 代码依赖分析的支持有限。为弥补这一差距,我们开发了 Depends-Kotlin 以提取 Kotlin 源代码中的实体及其依赖关系。Depends-Kotlin 不仅支持提取 Kotlin 代码中实体间的依赖关系,还能提取 Kotlin 与 Java 之间的依赖关系。通过在三个开源 Kotlin-Java 混合项目上进行测试,Depends-Kotlin 在解析 Kotlin-Kotlin 与 Kotlin-Java 依赖关系方面展现出高准确性与良好性能。Depends-Kotlin 的源代码及所用数据集已在 https://github.com/XYZboom/depends-kotlin 公开。我们还在 https://youtu.be/ZPq8SRhgXzM 提供了展示 Depends-Kotlin 功能的演示视频。