›› 2016,Vol. 31 ›› Issue (5): 869-882.doi: 10.1007/s11390-016-1670-2

• Special Section on Selected Paper from NPC 2011 • 上一篇    下一篇

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

Ju Qian(钱巨)1,2,3, Member, CCF, and Di Zhou(周迪)1,3   

  1. 1 College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China;
    2 State Key Laboratory of Software Engineering, Wuhan University, Wuhan 430072, China;
    3 Collaborative Innovation Center of Novel Software Technology and Industrialization, Nanjing 210023, China
  • 收稿日期:2016-03-20 修回日期:2016-07-17 出版日期:2016-09-05 发布日期:2016-09-05
  • 作者简介:Ju Qian received his B.S. and Ph.D. degrees in computer science from Southeast University, Nanjing, in 2003 and 2009, respectively. He is currently an associate professor in the College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing. His research interests include program analysis, software testing, debugging, and evolution.
  • 基金资助:

    This work was supported by the Defense Industrial Technology Development Program of China under Grant Nos. JCKY2016- 206B001 and JCKY2014206C002, the Open Project of State Key Laboratory of Software Engineering of Wuhan University under Grant No. SKLSE2014-10-13, and the Fundamental Research Funds of Nanjing University of Aeronautics and Astronautics under Grant No. NS2013088.

Prioritizing Test Cases for Memory Leaks in Android Applications

Ju Qian(钱巨)1,2,3, Member, CCF, and Di Zhou(周迪)1,3   

  1. 1 College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China;
    2 State Key Laboratory of Software Engineering, Wuhan University, Wuhan 430072, China;
    3 Collaborative Innovation Center of Novel Software Technology and Industrialization, Nanjing 210023, China
  • Received:2016-03-20 Revised:2016-07-17 Online:2016-09-05 Published:2016-09-05
  • About author:Ju Qian received his B.S. and Ph.D. degrees in computer science from Southeast University, Nanjing, in 2003 and 2009, respectively. He is currently an associate professor in the College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing. His research interests include program analysis, software testing, debugging, and evolution.
  • Supported by:

    This work was supported by the Defense Industrial Technology Development Program of China under Grant Nos. JCKY2016- 206B001 and JCKY2014206C002, the Open Project of State Key Laboratory of Software Engineering of Wuhan University under Grant No. SKLSE2014-10-13, and the Fundamental Research Funds of Nanjing University of Aeronautics and Astronautics under Grant No. NS2013088.

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

[1] Šor V, Srirama S N. Memory leak detection in Java: Taxonomy and classification of approaches. Journal of Systems and Software, 2014, 96: 139-151.

[2] Pienaar J A, Hundt R. JSWhiz: Static analysis for JavaScript memory leaks. In Proc. the IEEE/ACM International Symposium on Code Generation and Optimization (CGO), February 2013, pp.11:1-11:11.

[3] Yan D, Xu G, Yang S, Rountev A. LeakChecker: Practical static memory leak detection for managed languages. In Proc. the IEEE/ACM International Symposium on Code Generation and Optimization (CGO), February 2014, pp.87-97.

[4] Jump M, McKinley K S. Detecting memory leaks in managed languages with Cork. Software: Practice and Experience, 2010, 40(1): 1-22.

[5] De Pauw W, Sevitsky G. Visualizing reference patterns for solving memory leaks in Java. In Proc. the 13th European Conference on Object-Oriented Programming (ECOOP), June 1999, pp.116-134.

[6] Xu G, Bond M D, Qin F, Rountev A. LeakChaser: Helping programmers narrow down causes of memory leaks. In Proc. the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ), June 2011, pp.270-282.

[7] Rayside D, Mendel L. Object ownership profiling: A technique for finding and fixing memory leaks. In Proc. the 22nd IEEE/ACM International Conference on Automated Software Engineering (ASE), November 2007, pp.194-203.

[8] Mitchell N, Sevitsky G. LeakBot: An automated and lightweight tool for diagnosing memory leaks in large Java applications. In Proc. the 17th European Conference on Object-Oriented Computing (ECOOP), July 2003, pp.351-377.

[9] Maxwell E K, Back G, Ramakrishnan N. Diagnosing memory leaks using graph mining on heap dumps. In Proc. the 16th International Conference on Knowledge Discovery and Data Mining (KDD), July 2010, pp.115-124.

[10] Bond M D, McKinley K S. Bell: Bit-encoding online memory leak detection. In Proc. the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), October 2006, pp.61-72.

[11] Xu G, Rountev A. Precise memory leak detection for Java software using container profiling. ACM Transactions on Software Engineering and Methodology (TOSEM), 2013, 22(3): Article No. 17.

[12] Guo C, Zhang J, Yan J, Zhang Z, Zhang Y. Characterizing and detecting resource leaks in Android applications. In Proc. the 28th IEEE/ACM International Conference on Automated Software Engineering (ASE), November 2013, pp.389-398.

[13] Yan D, Yang S, Rountev A. Systematic testing for resource leaks in Android applications. In Proc. the 24th IEEE International Symposium on Software Reliability Engineering (ISSRE), November 2013, pp.411-420.

[14] Zhang H, Wu H, Rountev A. Automated test generation for detection of leaks in Android applications. In Proc. the 11th IEEE/ACM International Workshop on Automation of Software Test (AST), May 2016, pp.64-70.

[15] Shahriar H, North S, Mawangi E. Testing of memory leak in Android applications. In Proc. the 15th IEEE International Symposium on High-Assurance Systems Engineering (HASE), January 2014, pp.176-183.

[16] Park J, Choi B. Automated memory leakage detection in Android based systems. International Journal of Control and Automation, 2012, 5(2): 35-42

[17] Vallée-Rai R, Co P, Gaghon E et al. Soot – A Java optimization framework. In Proc. the IBM Centre for Advanced Studies Conference (CASCON), November 1999, Article No. 13.

[18] Joachims T. Optimizing search engines using ClickThrough data. In Proc. the ACM Conference on Knowledge Discovery and Data Mining (KDD), July 2002, pp.133-142.

[19] Yang W, Prasad M, Xie T. A grey-box approach for automated GUI-model generation of mobile applications. In Proc. the International Conference on Fundamental Approaches to Software Engineering (FASE), March 2013, pp.250-265.

[20] Zhang P, Elbaum S. Amplifying tests to validate exception handling code. In Proc. the 34th International Conference on Software Engineering (ICSE), June 2012, pp.595-605.

[21] Xie Y, Aiken A. Context-and path-sensitive memory leak detection. In Proc. the 10th European Software Engineering Conference Held Jointly with the 13th ACM SIGSOFT International Symposium on Foundations of Software Engineering, September 2005, pp.115-125.

[22] Dor N, Rodeh M, Sagiv S. Checking cleanness in linked lists. In Proc. the International Static Analysis Symposium (SAS), June 29-July 1, 2000, pp.115-134

[23] Heine D L, Lam M S. A practical flow-sensitive and contextsensitive C and C++ memory leak detector. In Proc. the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ), June 2003, pp.168-181.

[24] Sui Y, Ye D, Xue J. Static memory leak detection using fullsparse value-flow analysis. In Proc. the International Symposium on Software Testing and Analysis (ISSTA), July 2012, pp.254-264.

[25] Hastings R, Joyce B. Purify: Fast detection of memory leaks and access errors. In Proc. the Winter USENIX Conference, January 1992, pp.125-138

[26] Jung C, Lee S, Raman E et al. Automated memory leak detection for production use. In Proc. the 36th International Conference on Software Engineering (ICSE), May 31-June 7, 2014, pp.825-836.

[27] Lee S, Jung C, Pande S. Detecting memory leaks through introspective dynamic behavior modelling using machine learning. In Proc. the 36th International Conference on Software Engineering, May 31-June 7, 2014, pp.814-824.

[28] Li M, Chen Y,Wang L, Xu G. Dynamically validating static memory leak warnings. In Proc. the ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA), July 2013, pp.112-122.

[29] Gao Q, Xiong Y, Mi Y, Zhang L, Yang W, Zhou Z, Xie B, Mei H. Safe memory-leak fixing for C programs. In Proc. the 37th International Conference on Software Engineering (ICSE), May 2015, pp.459-470.
No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
[1] 金兰; 杨元元;. A Modified Version of Chordal Ring[J]. , 1986, 1(3): 15 -32 .
[2] 范植华;. Vectorization for Loops with Three-Forked Jumps[J]. , 1988, 3(3): 186 -202 .
[3] 朱明远;. Two Congruent Semantics for Prolog with CUT[J]. , 1990, 5(1): 82 -91 .
[4] 郭庆平; Y.Paker;. Communication Analysis and Granularity Assessment for a Transputer-Based System[J]. , 1990, 5(4): 347 -362 .
[5] 周勇; 唐泽圣;. Constructing Isosurfaces from 3D Data Sets Taking Account of Depth Sorting of Polyhedra[J]. , 1994, 9(2): 117 -127 .
[6] 曹存根;. Expansion Nets and Expansion Processes of Elementary Net Systems[J]. , 1995, 10(4): 325 -333 .
[7] 廖乐健; 史忠植;. Minimal Model Semantics for Sorted Constraint Representation[J]. , 1995, 10(5): 439 -446 .
[8] 赵彧; 张琼; 向辉; 石教英; 何志均;. A Simplified Model for Generating 3D Realistic Sound in the Multimedia and Virtual Reality Systems[J]. , 1996, 11(4): 461 -470 .
[9] 汪芸; 顾冠群; 兑继英;. Research on Protocol Migration[J]. , 1996, 11(6): 601 -606 .
[10] 程歧; 朱洪;. MNP: A Class of NP Optimization Problems[J]. , 1997, 12(4): 306 -313 .
版权所有 © 《计算机科学技术学报》编辑部
本系统由北京玛格泰克科技发展有限公司设计开发 技术支持:support@magtech.com.cn
总访问量: