Graph-based detection of library API imitations

Authors: Chengnian Sun Siau-Cheng Khoo Shao Jie Zhang

Venue: ICSME   2011 27th IEEE International Conference on Software Maintenance (ICSM), pp. 183-192, 2011

Year: 2011

Abstract: It has been a common practice nowadays to employ third-party libraries in software projects. Software libraries encapsulate a large number of useful, well-tested and robust functions, so that they can help improve programmers' productivity and program quality. To interact with libraries, programmers only need to invoke Application Programming Interfaces (APIs) exported from libraries. However, programmers do not always use libraries as effectively as expected in their application development. One commonly observed phenomenon is that some library behaviors are re-implemented by client code. Such re-implementation, or imitation, is not just a waste of resource and energy, but its failure to abstract away similar code also tends to make software error-prone. In this paper, we propose a novel approach based on trace subsumption relation of data dependency graphs to detect imitations of library APIs for achieving better software maintainability. Furthermore, we have implemented a prototype of this approach and applied it to ten large real-world open-source projects. The experiments show 313 imitations of explicitly imported libraries with high precision average of 82%, and 116 imitations of static libraries with precision average of 75%.

BibTeX:

@inproceedings{chengniansun2011gdolai,
    author = "Chengnian Sun and Siau-Cheng Khoo and Shao Jie Zhang",
    title = "Graph-based detection of library API imitations",
    year = "2011",
    pages = "183-192",
    booktitle = "Proceedings of 2011 27th IEEE International Conference on Software Maintenance (ICSM)"
}

Plain Text:

Chengnian Sun, Siau-Cheng Khoo, and Shao Jie Zhang, "Graph-based detection of library API imitations," 2011 27th IEEE International Conference on Software Maintenance (ICSM), pp. 183-192