We use cookies to improve your experience with our site.
钱巨, 周迪. 面向Android应用程序内存泄漏的测试用例优先级方法[J]. 计算机科学技术学报, 2016, 31(5): 869-882. DOI: 10.1007/s11390-016-1670-2
引用本文: 钱巨, 周迪. 面向Android应用程序内存泄漏的测试用例优先级方法[J]. 计算机科学技术学报, 2016, 31(5): 869-882. DOI: 10.1007/s11390-016-1670-2
Ju Qian, Di Zhou. Prioritizing Test Cases for Memory Leaks in Android Applications[J]. Journal of Computer Science and Technology, 2016, 31(5): 869-882. DOI: 10.1007/s11390-016-1670-2
Citation: Ju Qian, Di Zhou. Prioritizing Test Cases for Memory Leaks in Android Applications[J]. Journal of Computer Science and Technology, 2016, 31(5): 869-882. DOI: 10.1007/s11390-016-1670-2

面向Android应用程序内存泄漏的测试用例优先级方法

Prioritizing Test Cases for Memory Leaks in Android Applications

  • 摘要: 移动应用通常只能访问非常有限的内存。不恰当地使用这些内存可能造成内存泄漏,从而影响程序性能,甚至导致程序被意外终止。尽管目前人们已对内存泄漏的诊断问题进行了较多研究,但关于如何首先发现内存泄漏现象,仍存在许多挑战。测试是发现失效现象的一种常用方法,然而传统的测试技术对于内存泄漏的发现缺乏针对性。它们可能耗费大量的时间来执行那些不太可能导致泄漏的用例,这降低了测试的效率。为解决该问题,本文提出了一种基于泄漏可能性评估进行测试用例优先级排序的方法。它首先从代码特征出发,基于机器学习方法,构建一个预测模型来判定某一测试用例导致泄漏的风险。然后,对于每个待执行的用例,我们部分运行它来收集其代码特征,从而预测该用例具体的泄漏可能性程度。那些被认为最可能导致泄漏的测试用例将优先运行,从而尽早发现泄漏问题。在一组Android应用程序上的实验表明,该方法是有效的。

     

    Abstract: Mobile applications usually can only access limited amount of memory. Improper use of the memory can cause memory leaks, which may lead to performance slowdowns or even cause applications to be unexpectedly killed. Although a large body of research has been devoted into the memory leak diagnosing techniques after leaks have been discovered, it is still challenging to find out the memory leak phenomena at first. Testing is the most widely used technique for failure discovery. However, traditional testing techniques are not directed for the discovery of memory leaks. They may spend lots of time on testing unlikely leaking executions and therefore can be inefficient. To address the problem, we propose a novel approach to prioritize test cases according to their likelihood to cause memory leaks in a given test suite. It firstly builds a prediction model to determine whether each test can potentially lead to memory leaks based on machine learning on selected code features. Then, for each input test case, we partly run it to get its code features and predict its likelihood to cause leaks. The most suspicious test cases will be suggested to run at first in order to reveal memory leak faults as soon as possible. Experimental evaluation on several Android applications shows that our approach is effective.

     

/

返回文章
返回