| With the popularity of mobile devices, more and more mobile applications have been developed. Those mobile applications running on hard-carry devices usually can only access limited memory resources. Even though with garbage collection supports, memory leak is still a problem for Android applications. The memory leaks may lead to negative user experience, performances slowdowns, or even crashes. Although a large body of research has been conducted on the diagnosing techniques after memory leaks having been discovered, it is still challenging to find out the memory leak phenomenon at first.Testing is the mostly used technique for failure discovering. However, traditional testing techniques are not directed for memory leak phenomenon discovering. They may spend lots of time on testing unlikely leaking executions and therefore can be inefficient. To address the problem, in this paper, we propose a novel test approach to prioritize test cases with potential memory leaks in a given test suite. Then we use the approach to pick up GUI events with high scores and based on these events to generate memory-enhanced test cases.(1) Firstly, we have analyzed the Android applications with memory leak to find out memory leak relevant code features. Based on these code features, for each input test cases, we executed them to get their memory vectors as input data in next step.(2) Then, we build a memory leak prediction model by RankingSVM algorithm to predict likelihood to causing leaks. The most suspicious test cases will be selected for testing in order to reveal memory leak faults in as short as possible time.(3) We analyze the GUI of Android applications under test and extract GUI event-memory flow graph. Based on the found suspicious event operations and the GUI flow graph, high memory-consumption test cases are generated.Finally, experimental evaluation on several Android applications shows that our method is effective, which shows the ability of the proposed approaches. The approach can help users to eliminate the memory leak errors, and thereby improves the quality of Android applications. |