Android apps are event-driven, and their execution is often interrupted by external events. This interruption can cause data loss issues that annoy users. For instance, when the screen is rotated, the current app page will be destroyed and recreated. If the app state is improperly preserved, user data will be lost. In this work, we present an approach and tool iFixDataloss that automatically detects and fixes data loss issues in Android apps. To achieve this, we identify scenarios in which data loss issues may occur, develop strategies to reveal data loss issues, and design patch templates to fix them. Our experiments on 66 Android apps show iFixDataloss detected 374 data loss issues (284 of them were previously unknown) and successfully generated patches for 188 of the 374 issues. Out of 20 submitted patches, 16 have been accepted by developers. In comparison with state-of-the-art techniques, iFixDataloss performed significantly better in terms of the number of detected data loss issues and the quality of generated patches.
翻译:Android 应用程序是事件驱动的, 其执行经常因外部事件而中断。 这种中断可能会造成数据丢失问题, 让用户感到烦恼。 例如, 当屏幕旋转时, 当前应用程序页面将被销毁并重新创建。 如果应用程序状态被不当保存, 用户数据将会丢失。 在此工作中, 我们提出了一个方法和工具 iFixDataloss, 自动检测和修正 Android 应用程序中的数据丢失问题。 为了实现这一点, 我们确定数据丢失问题可能发生的情景, 制定揭示数据丢失问题的策略, 并设计修补模板 。 我们在66 Android Apps上进行的实验显示 iFixDataloss 检测到374个数据丢失问题( 284个以前未知), 并成功生成了374个问题中的188个补丁。 在提交的20个补丁中, 16个被开发者接受了。 与最先进的技术相比, iFixDataloss在检测到的数据丢失问题的数量和生成的补丁的质量方面表现得好得多 。