Skip to main content
QUICK REVIEW

[Paper Review] DroidLeaks: Benchmarking Resource Leak Bugs for Android Applications

Yepang Liu, Lili Wei|arXiv (Cornell University)|Nov 24, 2016
Software Testing and Debugging TechniquesComputer Science14 references3 citations
TL;DR

This paper introduces DroidLeaks, a benchmark of 298 real-world resource leak bugs in 32 large-scale open-source Android apps, mined from 124,215 code revisions. The authors identify common fault patterns and root causes through empirical analysis and validate the benchmark by implementing a static checker that effectively detects similar leaks in popular apps.

ABSTRACT

Resource leak bugs in Android apps are pervasive and can cause serious performance degradation and system crashes. In recent years, several resource leak detection techniques have been proposed to assist Android developers in correctly managing system resources. Yet, there exist no common bug benchmarks for effectively and reliably comparing such techniques and quantitatively evaluating their strengths and weaknesses. This paper describes our initial contribution towards constructing such a benchmark. To locate real resource leak bugs, we mined 124,215 code revisions of 34 large-scale open-source Android apps. We successfully found 298 fixed resource leaks, which cover a diverse set of resource classes, from 32 out of the 34 apps. To understand the characteristics of these bugs, we conducted an empirical study, which revealed the root causes of frequent resource leaks in Android apps and common patterns of faults made by developers. With our findings, we further implemented a static checker to detect a common pattern of resource leaks in Android apps. Experiments showed that the checker can effectively locate real resource leaks in popular Android apps, confirming the usefulness of our work.

Motivation & Objective

  • To address the lack of a standardized, real-world benchmark for evaluating Android resource leak detection techniques.
  • To identify and collect real, fixed resource leak bugs in large-scale, well-maintained Android applications.
  • To analyze the root causes and common fault patterns behind resource leaks in Android apps.
  • To validate the usefulness of the collected bugs by implementing and evaluating a static checker for detecting similar leaks.
  • To support future research in automated resource leak detection and patching through a comprehensive, representative benchmark.

Proposed method

  • Mining 124,215 code revisions from 34 large-scale open-source Android apps hosted on F-Droid to locate resource leak fixes.
  • Manually validating patches and bug reports to confirm the presence of resource leaks and collect detailed metadata.
  • Classifying leaks by resource type, bug location, fix patches, and presence in issue trackers.
  • Conducting an empirical study on the 298 bugs to analyze fault patterns and root causes.
  • Implementing a static checker based on identified common fault patterns to detect similar leaks in other apps.
  • Evaluating the checker on representative Android apps to assess its effectiveness in real-world detection.

Experimental results

Research questions

  • RQ1What types of system resources are leaked, and what are the consequences of these leaks? Are they specific to Android?
  • RQ2Do developers forget to release resources completely, or only on certain execution or exceptional paths?
  • RQ3Are there recurring fault patterns made by developers that lead to resource leaks?
  • RQ4How representative and comprehensive is the collected benchmark for evaluating existing and future detection techniques?

Key findings

  • 64.1% of the 298 resource leaks (191 bugs) resulted from developers completely forgetting to release resources due to complex event-driven control flows.
  • Only 4.7% (14 out of 298) of the leaks were documented in issue tracking systems, highlighting the importance of code repository mining.
  • Five root causes were identified, including unexpected user interactions and environment interplay, which frequently lead to resource leaks.
  • Three common fault patterns were found: API misuses, losing references to resource objects, and incomplete cleanup in control flow.
  • The benchmark covers all resource types used in recent detection tools and includes additional types, confirming its comprehensiveness and representativeness.
  • The implemented static checker successfully detected real resource leaks in popular Android apps, validating the utility of the DroidLeaks benchmark.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.