Automated unit-level testing of java memory leaks

Automated unit-level testing of java memory leaks

Lijuan Hong, Ju Qian, Jifeng Cui

College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China

Java programs may suffer from serious memory leak bugs. To resolve these bugs, various leak diagnosing and even fixing techniques have been proposed. However, in literature, there is very few work, which focuses on memory leak testing. Without revealing leak phenomenon by testing in advance, even excellent leak diagnosing and fixing techniques can be hard to work. In software testing, unit testing is a technique to avoid faults at early stage of software development. This paper proposes an automated unit-level memory leak testing approach to find potential leak bugs in Java methods. It firstly identifies the methods with high leaking risks. Then, strengthened unit tests are generated accordingly to check whether those risky modules can really cause leaks. Cases studies show that our method could be valuable for real programs.