1. Detecting resource leaks through dynamical mining of resource usage patterns
- Author
-
Gang Wu, Zhidong Yu, Xuezhi Xing, Kingsum Chow, and Huxing Zhang
- Subjects
Association rule learning ,Database ,Java ,Efficient algorithm ,Computer science ,business.industry ,computer.software_genre ,Open source ,Software ,Software bug ,business ,computer ,Software production ,computer.programming_language - Abstract
Resource management is crucial to software productions. Resources must be carefully acquired and released, or a resource leak might occur. For open source projects, resource leaks can be easily introduced during code check-in, and it is laborious to review, identify, report, and fix such leaks. Recently, there has been a growing interest in data mining API usage patterns to discover potential bugs such as resource leaks. However, the usage patterns mined are specific to a certain library, which cannot be applied to detect bugs in other libraries. In this paper, we present an idea called MODE, “Mine Once, Detect Everywhere”, to address the universality of such patterns, and use them to detect potential resource leaks automatically before code check-in. We propose an efficient algorithm to record the most valuable API calls that are related to resource usage during program execution, and mine resource usage patterns from the traces with a sequence miner. To verify the effectiveness of the patterns, experiments are given to use them to detect real resource leaks in large open source projects.
- Published
- 2011