It is shown how data mining can be used to discover library reuse patterns in existing applications. Specifically, we consider the problem of discovering library classes and member functions that are typically reused in combination by application classes. The paper improves upon earlier research using "association rules" (A. Michail, 1999) by taking into account the inheritance hierarchy using "generalized association rules". This turns out to be a non-trivial but worthwhile endeavor. By browsing generalized association rules, a developer can discover patterns in library usage in a way that takes into account inheritance relationships. For example, such a rule might tell us that application classes that inherit from a particular library class often instantiate another class or one of its descendents. We illustrate the approach using our tool, CodeWeb, by demonstrating characteristic ways in which applications reuse classes in the KDE application framework.
展开▼