Information and Software Technology ( IF 3.8 ) Pub Date : 2021-05-27 , DOI: 10.1016/j.infsof.2021.106619 Yanjie Zhao , Li Li , Xiaoyu Sun , Pei Liu , John Grundy
Context:
Event-driven programming plays a crucial role in implementing GUI-based software systems such as Android apps. However, such event-driven code is inherently challenging to design and implement correctly. Despite a significant amount of research to help developers efficiently implement such software, improved approaches are still needed to assist developers in better handling events and associated callback methods.
Objective:
This work aims at inventing an intelligent recommendation system for helping app developers efficiently and effectively implement Android GUI components.
Methods:
To achieve the aforementioned objective, we introduce in this work a novel approach called Icon2Code. Given an icon or UI widget provided by designers as input, Icon2Code first searches from a large-scale app database to locate similar icons used in existing popular apps. It then learns from the implementation of these similar apps and leverages a collaborative filtering model to select and recommend the most relevant APIs.
Results:
Our approach can achieve an 81% success rate when only five recommended APIs are considered, and a 94% success rate if twenty results are considered, based on ten-fold cross-validation with a large-scale dataset containing over 45,000 icons and their code implementations.
Conclusion:
It is feasible to automatically recommend code implementations for Android GUI components and Icon2Code is useful and effective in helping achieve such an objective.
中文翻译:
Icon2Code:Android GUI 组件的推荐代码实现
语境:
事件驱动的编程在实现基于 GUI 的软件系统(如 Android 应用程序)中起着至关重要的作用。然而,这种事件驱动的代码对于正确设计和实现具有固有的挑战性。尽管进行了大量研究以帮助开发人员有效地实现此类软件,但仍需要改进的方法来帮助开发人员更好地处理事件和相关的回调方法。
客观的:
这项工作旨在发明一种智能推荐系统,以帮助应用程序开发人员高效地实现 Android GUI 组件。
方法:
为了实现上述目标,我们在这项工作中引入了一种称为 Icon2Code 的新方法。给定设计师提供的图标或 UI 小部件作为输入,Icon2Code 首先从大型应用程序数据库中搜索,以查找现有流行应用程序中使用的类似图标。然后它从这些类似应用程序的实现中学习,并利用协同过滤模型来选择和推荐最相关的 API。
结果:
基于对包含超过 45,000 个图标及其代码的大规模数据集进行十倍交叉验证,我们的方法在仅考虑 5 个推荐的 API 时可以实现 81% 的成功率,如果考虑 20 个结果,则可以实现 94% 的成功率实现。
结论:
为 Android GUI 组件自动推荐代码实现是可行的,Icon2Code 在帮助实现这一目标方面非常有用和有效。