Search code examples
androidtestingmemorydocumentationieee

What are the software testing techniques that can be used for memory testing in Android?


Background:

I have done memory testing for my Android application using Eclipse Memory Analyzer Tool and identified the memory leaks.

I have referred to http://android-developers.blogspot.com/2011/03/memory-analysis-for-android.html

However, the problem that I am facing is how to to be put this in a proper testing documentation following ISO/IEC/IEEE 29119-3: Test Documentation.

Current understanding:

In testing involving the GUI, I can use techniques like equivalence partition, decision table testing etc to identify test cases such as what happens when user presses the back button etc. Then, I will design the test cases from the those techniques.

How to do this for memory testing in Android? Any help would be greatly appreciated. Thank you.


Solution

  • Test that onStop() code sets every global variable to null.

    Surprisingly its when the app is in the background where most android memory problems are. The GC couldn't reclaim memory because something wasn't set to null so the app holding the memory is killed. The user sees unfortunately app has stopped.

    Testing for App doesn't crash while in the background.

    • Start the app run it put it in the background.
    • Automated run a custom memory hungry app that just fills buffers with data creates bitmaps and such.
    • Manual run a memory hungry app like Facehooker it's like an endless stream of data and bitmaps that are displayed to the user.