arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2003.03201cs.SE

Android应用程序中资源泄漏的自动修复

Automated Repair of Resource Leaks in Android Applications

Bhargav Nagaraja Bhatt, Carlo A. Furia

AI总结:

本文提出PlumbDroid,通过静态分析识别可能泄漏资源的执行轨迹,并自动在合适位置插入释放操作;实验表明其可精确修复多种Android资源泄漏且修复更小、更快。

摘要:

资源泄漏——即程序没有释放其先前获取的资源——是Android应用程序中一类常见的缺陷。即使借助现有的自动检测泄漏技术,编写无泄漏的程序仍然十分棘手。原因之一在于Android的事件驱动编程模型,它使得理解应用程序的整体控制流变得复杂。在本文中,我们提出了PlumbDroid:一种自动检测并修复Android应用程序中资源泄漏的技术。PlumbDroid使用静态分析来查找可能泄漏资源的执行轨迹。为检测而构建的信息也支撑了修复方案的自动构建——该修复由在适当位置执行的释放操作组成——可消除泄漏,且不会以其他方式影响应用程序对该资源的使用。对来自DroidLeaks精选集合的资源泄漏进行的实证评估表明,PlumbDroid的方法具有可扩展性、精确性,并能针对多种资源泄漏缺陷生成正确的修复:PlumbDroid自动发现并修复了50个泄漏,这些泄漏影响Android系统的9种广泛使用的资源,包括DroidLeaks为这些资源收集的全部泄漏;平均而言,检测并修复一个泄漏仅需2分钟。PlumbDroid与Relda2/RelFix——唯一另一种全自动修复Android资源泄漏的方法——相比也表现出色,因为它通常能检测更多泄漏、具有更高精度并生成更小的修复。这些结果表明,PlumbDroid能够在实践中为提升Android应用程序质量提供有价值的支持。

英文摘要:

Resource leaks -- a program does not release resources it previously acquired -- are a common kind of bug in Android applications. Even with the help of existing techniques to automatically detect leaks, writing a leak-free program remains tricky. One of the reasons is Android's event-driven programming model, which complicates the understanding of an application's overall control flow. In this paper, we present PlumbDroid: a technique to automatically detect and fix resource leaks in Android applications. PlumbDroid uses static analysis to find execution traces that may leak a resource. The information built for detection also undergirds automatically building a fix -- consisting of release operations performed at appropriate locations -- that removes the leak and does not otherwise affect the application's usage of the resource. An empirical evaluation on resource leaks from the DroidLeaks curated collection demonstrates that PlumbDroid's approach is scalable, precise, and produces correct fixes for a variety of resource leak bugs: PlumbDroid automatically found and repaired 50 leaks that affect 9 widely used resources of the Android system, including all those collected by DroidLeaks for those resources; on average, it took just 2 minutes to detect and repair a leak. PlumbDroid also compares favorably to Relda2/RelFix -- the only other fully automated approach to repair Android resource leaks -- since it usually detects more leaks with higher precision and producing smaller fixes. These results indicate that PlumbDroid can provide valuable support to enhance the quality of Android applications in practice.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑